Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split backend into several microservices #11

Merged
merged 10 commits into from
Jul 19, 2023
Merged

Split backend into several microservices #11

merged 10 commits into from
Jul 19, 2023

Conversation

roobre
Copy link
Collaborator

@roobre roobre commented Jul 13, 2023

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:

  • Recommendations
    • /api/pizza
  • Copy
    • /api/names
    • /api/quotes
    • /api/adjectives
  • Catalog
    • /api/ingredients/*
    • /api/doughs
    • /api/tools
    • /api/internal/recommendations (GET and POST)
    • /api/login (WIP, may not end here)
  • Websockets
    • /ws
  • Frontend
    • / (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:

  • Propagate trace ID across requests
  • Propagate user ID across requests
  • Revisit admin authentication

image

Distributed tracing, yay!

image

@roobre roobre force-pushed the microservices branch 2 times, most recently from 0ce61ad to af84d28 Compare July 17, 2023 10:26
@roobre roobre marked this pull request as ready for review July 17, 2023 10:30
@dgzlopes dgzlopes self-requested a review July 19, 2023 09:00
@roobre roobre merged commit e0a3acc into main Jul 19, 2023
1 check passed
@dgzlopes dgzlopes deleted the microservices branch July 19, 2023 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants