Load Balancing
Load balancers distribute requests across healthy instances.
Common strategies include round robin, weighted routing, least connections, and latency-aware routing.
Health checks can be shallow, such as checking whether a process responds, or deeper, such as checking critical dependencies. Deep health checks must be designed carefully because a dependency outage should not necessarily cause every instance to be removed from service.
Graceful shutdown is important: an instance should stop accepting new work while allowing active requests to finish.
Key Takeaways
- Gateways and reverse proxies are infrastructure layers, not substitutes for API design.
- Load balancers enable horizontal scaling.
- Graceful shutdown is essential during deployments.