Concepts

API Gateway Pattern

Pattern providing a single entry point for multiple microservices, handling routing, authentication, rate limiting, and response aggregation.

seed#api-gateway#pattern#microservices#routing#aggregation

What it is

The API Gateway pattern provides a single entry point for clients needing to access multiple microservices. Instead of the client knowing and calling each service, the gateway routes, aggregates, and transforms requests.

Responsibilities

  • Routing: direct requests to the correct service
  • Authentication/Authorization: verify identity centrally
  • Rate limiting: protect services from overload
  • Aggregation: combine responses from multiple services
  • Transformation: adapt formats between client and services
  • Caching: cache frequent responses

Implementations

GatewayTypeStrengthLimitation
AWS API GatewayManagedNative Lambda integration, no infrastructureAdded latency, per-request cost
KongOpen source / managedExtensible plugins, multi-cloudOperational complexity
NGINXOpen sourceExtreme performance, flexible configurationNo native API management features
EnvoyOpen sourceL7 proxy, base for service meshesSteep learning curve
TraefikOpen sourceAuto-discovery with Docker/K8sLess mature for complex APIs

Anti-patterns

  • Gateway containing business logic
  • Gateway as bottleneck (single point of failure)
  • Too much aggregation in the gateway

Why it matters

The API gateway centralizes cross-cutting concerns — authentication, rate limiting, transformation — that would otherwise be duplicated in every microservice. It is the control point that simplifies both operations and the API consumer experience.

References

Concepts