← 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.

API Gateway Diagram

Core Responsibilities

  1. Authentication & Authorization: Verifying who the user is (AuthN) and what they can do (AuthZ) before the request reaches your services.
  2. Rate Limiting: Preventing abuse by limiting how many requests a user can make in a given time.
  3. Request Routing: Directing /api/users to the User Service and /api/orders to the Order Service.
  4. 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.