Reference
Component catalogue
Real tools such as PostgreSQL, Kafka and Redis: what each one does, how it fails and what to say about it in an interview. Then the patterns that combine them.
API gateway
Where it sits
- Client
- API gatewaythis block
- Services
- Database
Every request from outside comes to the gateway first. It checks who is asking, then passes the request to the right service.
What it is
One front door for every request from outside. It checks who is asking, applies limits, and passes the request to the right service.
Why use it
Services stay off the public internet. Login checks, limits and logging live in one place, not in every service.
When to use it
- A system with many services behind one public address.
- One place to check login tokens before a request reaches a service.
- Sending a small share of traffic to a new version, by path or by header.
When not to use it
- A single app on one server. The gateway adds a hop and a part to run, with nothing to route.
- Calls between services inside a trusted network, where a direct call is enough.