Last modified: January 24, 2026
This article is written in: 🇺🇸
Load balancing is central to designing robust distributed systems. It ensures that incoming requests or workloads are equitably distributed across multiple servers or nodes, thereby preventing any single server from becoming a bottleneck. This technique also boosts system resilience, providing higher availability and scalability.
ASCII DIAGRAM: High-Level Load Balancing
+---------+
| Client |
+----+----+
|
(HTTP/TCP Requests)
v
+-----+------+
| Load |
| Balancer |
+-----+------+
|
(Distributes requests)
v
+-----------+-----------+
| Server 1 (S1) |
+-----------+-----------+
| Server 2 (S2) |
+-----------+-----------+
| Server 3 (S3) |
+-----------+-----------+
Implementing a load balancer in a distributed system offers multiple advantages:
Load balancers apply algorithms to decide where each incoming request goes. They typically include:
Below are common methods for distributing requests:
Helpful if requests have varying durations, preventing busy servers from becoming overloaded.
Least Response Time
Aims to pick the server that can respond fastest.
Least Bandwidth
Monitors ongoing traffic in Mbps or Gbps and sends new requests to the server with the lowest bandwidth utilization.
Round Robin
Weighted Round Robin accounts for each server’s capacity, giving a powerful server more requests.
IP Hash
Ensures the same client IP typically routes to the same server (session persistence), common in Layer 4 load balancing.
Consistent Hashing
When a server is added or removed, only a small subset of the keys or requests are remapped, aiding caching consistency.
Layer 7 Load Balancing
ASCII DIAGRAM: Multiple Load Balancing Methods
+------------------+
| Load Balancer |
+--------+---------+
|
+---------------+---------------+
| |
v v
+----------------+ +----------------+
| Server Pool | | Routing via |
| (LeastConn, RR)| | IP/Consistent|
| etc. | | Hash, etc. |
+----------------+ +----------------+
Ironically, load balancers can become a single point of failure if not designed carefully. Various techniques mitigate this risk:
A heartbeat mechanism monitors whether a load balancer node has failed.
Active-Passive Pair
Usually involves sharing a virtual IP or using DNS-based failover.
DNS-based Load Balancing
round-robin DNS) distribute traffic among multiple LB IPs.