← Back to Guide
Chapter 05
5. API Gateway
The traffic cop: Managing security, routing, and rate limiting.
API Gateway: The Guardian
As your backend grows complex, exposing every service directly is risky and messy. Enter the API Gateway.
Core Responsibilities
- Authentication & Authorization: Verifying who the user is (AuthN) and what they can do (AuthZ) before the request reaches your services.
- Rate Limiting: Preventing abuse by limiting how many requests a user can make in a given time.
- Request Routing: Directing
/api/usersto the User Service and/api/ordersto the Order Service. - Protocol Translation: Converting external REST requests to internal gRPC calls for better performance.
Popular Tools
- Kong
- Amazon API Gateway
- Apigee
By centralizing these cross-cutting concerns, you keep your microservices clean and focused on business logic.