What not to put in a gateway
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
keep the gateway thin.
Planned topics
- No business rules (pricing, discounts, order validation); they belong in services.
- No data aggregation that grows into a service of its own (see BFF).
- No shared database access, and no per-service special cases that need constant redeploys.
- Keep it stateless and fast; every request pays its cost.
- A gateway that every team must change for each feature becomes a new monolith and a bottleneck.
Draft outline details
Demonstration
| Concern | Gateway | Service |
|---|---|---|
| TLS, CORS, token validation | yes | no |
| Rate limits, correlation id | yes | no |
| Price calculation | no | yes |
| Order ownership check | no | yes |
Check your understanding
Where does "customer may only see their own orders" belong?
Show answer
In the orders service.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.