An API Gateway is a single entry point for all client requests to a system made up of multiple backend services (usually microservices). It acts as a reverse proxy that routes, secures, and manages API traffic.

Why It Exists:

Without it:

Clients have to talk to each microservice directly → complex, tightly coupled.

With API Gateway:

Clients talk to just one endpoint → clean, controlled, manageable.

Key Responsibilities:

FeatureWhat It Does
Request RoutingForwards requests to correct backend service
Load BalancingDistributes traffic across multiple service instances
Authentication/AuthzVerifies identity & access (e.g., via JWT, OAuth)
Rate LimitingBlocks abuse (e.g., 1000 req/min)
CachingStores frequent responses to reduce latency/load
Logging/MonitoringTracks API usage, errors, performance
Request TransformationModify headers/body before forwarding to services

Diagram:

Client ─────► API Gateway ─────► Service A
                      │
                      ├────────► Service B
                      │
                      └────────► Service C
  • AWS API Gateway
  • NGINX
  • Kong
  • Istio (Service mesh with gateway features)
  • Apigee

When to Use: