API Gateway
A unified entry point in front of microservices that centralizes cross-cutting concerns such as authentication, rate limiting, routing, protocol translation, and telemetry
Table of Contents
Structure Diagram
What is API Gateway?
A unified entry point in front of microservices that centralizes cross-cutting concerns such as authentication, rate limiting, routing, protocol translation, and telemetry. It is a core concept in Traffic & Scaling within Cloud / DevOps.
Core Principles
An API Gateway acts as the single North-South entry point in front of a fleet of microservices. Going beyond a basic reverse proxy, it centralizes JWT/OAuth2 validation, API key quotas, rate limiting, request/response transformation, versioning, and unified telemetry.
By offloading these cross-cutting concerns to the gateway, individual microservice teams avoid duplicating security boilerplate and can even expose clean REST APIs externally while running gRPC internally.
Practical Takeaways
- Keep business logic out of the gateway: Packing heavy orchestration or domain rules into the gateway turns it into a monolithic bottleneck. Use dedicated Backend-for-Frontend (BFF) services when client-specific aggregation is needed.
- Isolate downstream failures: Configure per-route timeouts, retries, and circuit breakers so one slow microservice cannot exhaust gateway connections for healthy routes.
- Manage routes declaratively: Drive gateway configuration from OpenAPI specs or GitOps CRDs rather than manual admin UI clicks.
Notable Examples
- AWS API Gateway & Azure API Management: Fully managed gateways integrating usage plans, throttling, and serverless backends.
- Kong Gateway & Apache APISIX: High-throughput, plugin-extensible open-source API gateways widely adopted in Kubernetes and hybrid clouds.
- Envoy Gateway: Implements the Kubernetes Gateway API specification with Envoy's battle-tested proxy core.