A single entry point in front of many backend services that handles routing, auth, and cross-cutting concerns.
- Route incoming requests to the right backend service.
- Handle authentication, rate limiting, and TLS termination in one place.
- Be highly available and low latency.
- Support many services and high request volume.
- The gateway routes by path or host to backend services, so clients see one endpoint instead of many.
- Cross-cutting concerns live here: authentication and authorization, rate limiting, TLS termination, request and response transformation, and logging.
- It must not become a single point of failure: run it behind a load balancer as a redundant, stateless fleet.
- Caching and circuit breaking protect slow or failing backends.
flowchart LR
Client --> GW{{API Gateway}}
GW --> S1[Service A]
GW --> S2[Service B]
GW --> S3[Service C]
Auth[Auth / Rate limit] -.-> GW
- Read more (free): Load Balancer vs Reverse Proxy vs API Gateway
- Quick, focused prep: System Design Interview Crash Course
- Full course: Grokking the System Design Interview