A load balancer acts as a reverse proxy that sits in front of a server farm and routes incoming client requests to available backend servers. Its primary purpose is to distribute the workload evenly, preventing any single server from becoming a bottleneck or a single point of failure.
How it works
The balancer performs continuous health checks to ensure target instances are operational. It uses distribution algorithms such as Round Robin, Least Connections, or Source IP Affinity. If a server fails, the balancer removes it from the rotation automatically to maintain service availability.
Load balancing is essential for high-traffic websites and cloud infrastructures. It operates at different layers of the OSI model: L4 (TCP/UDP) for high-performance packet routing or L7 (HTTP/HTTPS) for content-aware routing based on specific request data.
Using solutions like AWS ELB or HAProxy enables seamless horizontal scaling. For instance, a properly configured L7 balancer can handle over 100,000 requests per second while offloading SSL/TLS termination to reduce backend CPU utilization.