An API gateway is a single entry point that sits in front of your microservices. Clients call the gateway, which routes requests to the right service and handles cross-cutting concerns.
An API gateway is a single entry point that sits in front of your microservices. Clients call the gateway, which routes requests to the right service and handles cross-cutting concerns.
/orders/* to the orders service. ┌─────────────────────────────┐
Clients ─▶│ API Gateway │
│ auth · rate-limit · route │
└──┬──────────┬──────────┬────┘
▼ ▼ ▼
Orders Payments Users
# gateway routes
routes:
- path: /orders/**
service: orders-service # forward order traffic here
rateLimit: 100/min # throttle abusive clients
- path: /users/**
service: users-service
auth: required # gateway enforces auth before routing
The gateway can become a single point of failure and a bottleneck. Run it highly available and keep business logic out of it.
A gateway frees each service from re-implementing auth, rate limiting, and TLS, and gives clients one stable URL instead of dozens.
Without it, clients must know every service's address and duplicate cross-cutting logic, which quickly becomes unmanageable.