← All components
Edge & networking
Load balancer
Spreads requests across healthy instances and terminates TLS.
When to use
- In front of every horizontally scaled tier
Pitfalls
- Sticky sessions hide state problems; keep services stateless
- Long-lived WebSockets need L4 or connection-aware balancing
Options by provider
The first option is what diagrams show for that provider.
Amazon Web Services
- Elastic Load Balancing (ALB/NLB)Managed
Google Cloud
- Cloud Load BalancingManaged
Microsoft Azure
- Azure Load BalancerManaged
- Application Gateway — L7Managed
Open source / self-hosted
- NGINXSelf-hosted
- HAProxySelf-hosted
- EnvoySelf-hosted
Related concepts
Used in
- YouTube
- Load balancer — Spreads API and upload traffic across healthy instances
- Instagram
- Load balancer — Distributes API traffic
- Twitter / X
- Load balancer — Spreads API traffic
- WhatsApp / Messenger
- Connection load balancer — Spreads long-lived WebSocket connections (L4)
- API load balancer — Routes HTTPS requests for history, groups and media
- URL shortener
- Load balancer — Spreads traffic across app servers
- Pastebin
- Load balancer — Spreads traffic
- Dropbox
- Load balancer — Spreads API traffic
- WebSockets at scale
- L4 load balancer — Spreads long-lived TCP connections across pods