Split backend into several microservices #11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides a first implementation of splitting the backend into several components, which can be enabled together on a single service, leading to a monolith-like deployment; or enabled separately into several deployments, leading to a microservices-like deployment.
The following groups of API endpoints have been defined:
/api/pizza
/api/names
/api/quotes
/api/adjectives
/api/ingredients/*
/api/doughs
/api/tools
/api/internal/recommendations
(GET and POST)/api/login
(WIP, may not end here)/ws
/
(Static Svelte files)Additionaly, a homemade gateway has been developed. This gateway is automatically enabled together with the Frontend service if the application is deployed using microservices, and allows users to reach services other than the frontend from the browser.
Each of this groups can be deployed as a separate service, or arbitrarily together.
API groups (or services) communicate with each other using HTTP calls, e.g. the Recommendations service queries Catalog for the ingredients list and Copy for names and adjectives. It also POSTs recommendations to the catalog once served. These HTTP requests will take place even if the application is deployed as a single service, meaning the service will query itself. This allows keeping the code simple.
Remaining work:
Distributed tracing, yay!