← Back to microservices patterns mapgateway
🌐
Microservices Pattern
API Gateway Pattern
A single entry point routes, authenticates, rate-limits, and protects backend services.
Detailed Description
Gateways are edge infrastructure. They protect internal services from client-specific routing, authentication, throttling, and protocol concerns.
Keep business logic out of the gateway so it does not become a second monolith.
Visual Diagram
Request Flow through Gateway
Client → [API Gateway]
│ 1. Authenticate (JWT/OAuth)
│ 2. Rate limit check
│ 3. Route to service
│ 4. Load balance
↓
GET /users → UserService
POST /orders → OrderService
GET /products → ProductServiceTradeoffs
Pros
Centralizes cross-cutting concerns, hides topology
Cons
Can become bottleneck or single point of failure
Examples: Kong, AWS API Gateway, Nginx, Traefik
API Gateway Pattern: Request Flow
Client
->
API Gateway
- 1. Authenticate (JWT/OAuth)
- 2. Rate limit check
- 3. Route to service
- 4. Load balance
->
Services
GET /users -> UserService
POST /orders -> OrderService
GET /products -> ProductService