Skip to main content
>_ supraj.dev
TOPIC NETWORKING
API Gateway a single front door for all your backend services
IN 10 SECONDS

An API Gateway sits between clients and your microservices, handling authentication, rate limiting, request routing, response transformation, and API versioning — so your backend services don't have to. Common implementations: AWS API Gateway, Kong, NGINX, Envoy, and Zuul.

GOTCHA Your API Gateway is a single point of failure and a potential performance bottleneck. Always deploy at least two instances across AZs and monitor its latency. A slow gateway makes every API call slow.
HOW AN API GATEWAY PROCESSES A REQUEST
01 Client sends a request to the gateway's endpoint (e.g., `https://api.example.com/orders`).
02 Gateway auth validates the API key, JWT, or OAuth token before the request reaches any backend.
03 Rate limiter checks the client's usage against its quota. If exceeded, returns `429 Too Many Requests`.
04 Router maps the path `/orders` to the Orders microservice and proxies the request.
05 Response pipeline the gateway can transform, cache, or aggregate responses before sending them back.
POKE IT YOURSELF
curl -s -o /dev/null -w "%{http_code}" https://api.example.com/health — check gateway health status
aws apigateway get-usage-plan-keys --usage-plan-id PLAN_ID — list API keys for a usage plan