A load balancer distributes incoming network traffic across multiple backend servers. It ensures no single server is overwhelmed, provides high availability by routing around failed servers, and enables horizontal scaling.
A load balancer sits between clients and servers, acting as a traffic cop. It receives incoming requests and distributes them across a pool of backend servers based on algorithms like round robin, least connections, or IP hash. Load balancers also perform health checks, removing unhealthy servers from the pool automatically.
When a user sends a request, the load balancer intercepts it and selects a backend server using its configured algorithm. Round robin cycles through servers in order. Least connections sends to the server with fewest active connections. IP hash routes the same client to the same server (session persistence). The load balancer also terminates TLS, so backend servers don't have to.
A load balancer distributes traffic across multiple servers for scalability and availability. A reverse proxy typically serves cached content or protects a single backend. NGINX and HAProxy can function as both.
Yes, load balancers can absorb distributed traffic by distributing it across many backend servers. Cloud load balancers (AWS ALB, Cloudflare) also include DDoS protection features.