Back to roadmap
Module 5 · APIs & Application LayerDay 04625 min

API Gateways

One entrypoint for cross-cutting concerns.

Day 046

API Gateways

Clients
client
Gateway
edge
Orders
service
Catalog
service
Users
service
Signal path
Gateway in front of services
Clients
client
flow
Gateway
edge
Gateway
edge
flow
Orders
service
Gateway
edge
flow
Catalog
service
Memory hook

API Gateways: one entrypoint for cross-cutting concerns

Mental model

turn boundaries into contracts

Design lens

Gateway is a SPOF — make it HA and observable.

Recall anchors
ConcernsDon't

Why it matters

An API gateway is the single ingress for all clients to a microservice fleet. It handles authentication, rate limiting, request transformation, and routing — keeping these concerns out of every service.

Deep dive

Per-route policies: auth required, rate limit, request size, allowed methods.

Transformation: add/remove headers, normalize errors, mask internal services.

Don't put business logic in the gateway. Keep it dumb and fast.

Demo / scenario

Multi-team microservices behind one gateway.

  1. Gateway authenticates JWT.
  2. Routes /orders → orders-svc, /catalog → catalog-svc.
  3. Applies per-route rate limits.
  4. Returns standardized error envelope.

Tradeoffs

  • Gateway is a SPOF — make it HA and observable.
  • Pull-from-service vs push-config matters at scale.
  • Beware feature creep — many systems regret bloated gateways.

Diagram

Clients
Gateway
auth/route/throttle
Orders
Catalog
Users
Gateway in front of services.

Mind map

Check yourself

Loading quiz…

Sources & further reading