Load Balancer
A load balancer is a system that distributes incoming network traffic across multiple servers so that no single server gets overwhelmed.
It works like a traffic controller at a busy intersection, directing each request to the server best able to handle it. This keeps websites and applications fast, reliable, and available even during heavy traffic or if one server goes down.
Load Balancer, explained at three levels
At home
A load balancer sits in front of a group of servers and directs each visitor's request to one of those servers. If one server is busy, the load balancer sends the next request to a less busy one. If a server goes down, the load balancer stops sending traffic to it and directs requests to the remaining healthy servers. This keeps the website or service running smoothly even under heavy demand.
At work
Load balancers are essential for any business application that needs to be reliable and responsive. They ensure that if one server has a problem, users are automatically directed to another server without interruption. This means less downtime, better performance during traffic spikes, and the ability to scale by adding more servers as demand grows. When evaluating hosting and infrastructure for a project, load balancing should be considered a core requirement for any production system.
At home
Load balancers use various algorithms to distribute traffic: round-robin (each server gets a turn), least connections (sends to the server with the fewest active connections), weighted distribution (sends more traffic to more powerful servers), and IP hash (consistently sends the same client to the same server for session persistence). Health checks continuously monitor each server's status; if a server stops responding, the load balancer removes it from the pool until it recovers. Load balancers operate at Layer 4 (transport — TCP/UDP) or Layer 7 (application — HTTP/HTTPS), with Layer 7 balancers able to make routing decisions based on URL, headers, or content.
At work
In enterprise deployments, load balancers handle TLS termination (decrypting HTTPS traffic at the load balancer rather than at each backend server), session affinity (ensuring a user's requests consistently reach the same backend during a session), and connection draining (gracefully removing a server from the pool by finishing existing requests before redirecting new ones). Cloud platforms offer managed load balancing services (AWS ALB/NLB, Azure Load Balancer, GCP Cloud Load Balancing) that scale automatically and integrate with auto-scaling groups to add or remove backend servers based on demand.
At home
Advanced load balancing includes Global Server Load Balancing (GSLB) which distributes traffic across data centres in different geographic regions using DNS-based or anycast routing, directing users to the nearest healthy data centre. Service mesh sidecar proxies (Envoy in Istio) implement client-side load balancing in microservice architectures, making routing decisions at the service level with fine-grained control over retries, timeouts, and circuit breaking. Consistent hashing algorithms distribute traffic while minimising disruption when servers are added or removed from the pool.
At work
At scale, load balancer architecture must address single points of failure — production deployments use active-passive or active-active load balancer pairs with VRRP (Virtual Router Redundancy Protocol) or equivalent failover mechanisms. Observability across the load balancing tier is critical: metrics on connection counts, request rates, error rates, and backend response times drive capacity planning and incident response. For latency-critical applications, kernel bypass load balancers using DPDK or XDP process millions of packets per second with microsecond-level latency. Modern platform engineering teams treat load balancer configuration as code, managed through infrastructure-as-code pipelines with version control and automated testing.
Real-world examples
At home
When thousands of people try to buy concert tickets at the same time, the ticketing site does not rely on a single server. A load balancer distributes all those simultaneous requests across dozens of servers. If any one server gets overloaded or crashes, the load balancer redirects traffic to the others, keeping the site running for people like Nina who is anxiously trying to get her tickets.
At work
When Rebecca's company deploys their customer portal, the infrastructure includes a load balancer in front of four application servers. During normal hours, each server handles roughly equal traffic. When a marketing campaign drives a traffic spike, the auto-scaling group adds two more servers, and the load balancer automatically begins distributing traffic across all six, maintaining fast response times throughout.
Common confusions
- A lot of people believe load balancers are only for massive websites. Any multi-server setup benefits from one, and cloud providers make them easy and affordable to use.
- You might think a load balancer guarantees the site will never go down. It is one component of a broader reliability strategy that also includes monitoring, redundancy, and failover planning.
- Some people are convinced that load balancers only distribute traffic evenly. They can make intelligent routing decisions based on server health, current connections, request content, and user location.
For analysts
If the project requires high availability or the ability to handle variable traffic, load balancing should be in the requirements from the start. Specify the availability target (e.g., 99.9% uptime) and expected traffic patterns (steady, bursty, seasonal). These determine the load balancing approach and whether auto-scaling is needed. A system that works fine on one server in testing can fail dramatically in production without a load balancer when real traffic arrives.
History & origin
Load balancing emerged in the mid-1990s as websites began attracting traffic that a single server could not handle. Early load balancers were dedicated hardware appliances from companies like F5 Networks and Citrix. Over the 2000s and 2010s, software-based and cloud-native load balancers became dominant, and today load balancing is a fundamental component of virtually every production web infrastructure.