Networking & Traffic Management
API Gateways & Service Discovery
A gateway centralizes cross-cutting concerns (auth, rate limiting, routing) at the edge of a microservices system, while service discovery lets services find each other as instances come and go.
- API gateway: a single entry point handling auth, rate limiting (Rate Limiting Algorithms), request routing, and protocol translation, so individual services do not each reimplement them
- Service discovery, client-side: the caller queries a registry directly and picks an instance itself (e.g. Netflix Eureka-style) — no extra hop, but couples every client to the registry
- Service discovery, server-side: a load balancer or gateway queries the registry on the caller's behalf (e.g. via a sidecar or DNS-based discovery) — simpler clients, one more hop
- The registry itself needs heartbeats/health checks — a stale entry pointing at a dead instance is worse than no entry at all
- A gateway becomes a chokepoint exactly like a load balancer: it needs its own redundancy, and every request now pays its added latency, which should be measured, not assumed away
| Client-side | Server-side | |
|---|---|---|
| Who queries the registry | The calling service itself | A gateway or load balancer |
| Extra network hop | No | Yes |
| Client complexity | Higher — needs discovery-aware client library | Lower — client just calls one address |
| Coupling | Clients coupled to registry API | Clients decoupled; gateway coupled instead |