load balancing
Load Balancing Algorithms
Distribute incoming traffic across multiple servers to maximize throughput and minimize response time.
// concept
Load balancers act as reverse proxies, distributing client requests across backend servers. The algorithm determines which server handles each request.
Round Robin
Distribute requests sequentially across servers in a circular order. Simple and fair for uniform workloads.
Weighted Round Robin
Assign weights to servers based on capacity. Higher-weight servers receive proportionally more traffic.
Least Connections
Route to the server with the fewest active connections. Adapts to varying request durations.
IP Hashing
Hash client IP to deterministically select a server. Ensures session affinity without shared state.
Consistent Hashing
Map keys to a ring of nodes. Adding/removing nodes only redistributes a fraction of keys.