Why Load Balancing Exists
Early websites typically run on a single machine. While this works well for development and early traffic levels, single-server architectures eventually encounter resource limits.
CPU, memory, disk I/O, and network throughput all have ceilings. When visitor traffic approaches those limits, response times degrade and the site becomes unstable.
Load balancing distributes traffic so multiple servers share the workload.
Basic Load Balancing Model
A load balancer sits between the internet and application servers. Instead of sending requests directly to a single machine, the balancer selects which backend system should process each request.
- Round‑robin distribution
- Least‑connections routing
- Latency‑aware routing
- Geographic routing
Reverse Proxy Architecture
Most load balancing is implemented through reverse proxies. A reverse proxy terminates the incoming connection and forwards it to an application server.
- Nginx
- HAProxy
- Envoy
- Cloud load balancers
Horizontal vs Vertical Scaling
Vertical scaling increases the power of a single machine. Horizontal scaling adds more machines.
Load balancing makes horizontal scaling possible.
- More redundancy
- Higher capacity
- Better resilience
Traffic Spike Protection
Unexpected traffic spikes are a major cause of infrastructure failure. When a page suddenly becomes popular, the request volume can exceed server capacity.
Load balancing distributes these spikes across the infrastructure cluster.
CDN Integration
Content delivery networks work alongside load balancers. CDNs cache content at edge nodes while the load balancer manages application servers.
- Lower latency
- Reduced origin load
- Improved global performance
Monitoring and Observability
Infrastructure that distributes traffic must be monitored carefully.
- response times
- error rates
- connection counts
- CPU utilization
Evolution of Infrastructure
Load balancing is typically introduced after early growth.
- shared hosting
- single dedicated server
- reverse proxy
- multi‑server cluster
- global infrastructure
