Load balancing algorithms beyond the basics
Round robin and least connections are the two most common starting points, but production systems often use refinements on top of them: weighted round robin, giving more powerful servers a larger share of requests, least response time, factoring in how quickly a server has been answering recently, and consistent hashing, used heavily in caching layers so the same key almost always maps to the same server even as servers are added or removed.
Load balancing in modern, cloud-native infrastructure
Beyond a single dedicated appliance, load balancing today often happens at several layers at once: a cloud provider's managed load balancer in front of the whole application, an ingress controller distributing traffic inside a Kubernetes cluster, and a service mesh handling load balancing between individual internal services. Each layer solves the same basic problem, not overloading any one instance, at a different scope.
Frequently Asked Questions
What happens if the load balancer itself fails?
To avoid the load balancer becoming a single point of failure, real-world deployments usually run at least two load balancers in an active-standby or active-active setup, so if one goes down the other keeps handling traffic without interruption.
Does a small website need load balancing?
Not if a single server comfortably handles its traffic. Once traffic grows enough to require multiple servers, though, a load balancer becomes essential, since there is no other way to split incoming requests across them.