Load Balancing Algorithms

Quick Reference: Consistent Hashing | Rate Limiting


Quick Reference

AlgorithmTypeUse CaseProsCons
Round RobinStatelessEqual server capacitySimple, fairIgnores load
Least ConnectionsStatefulVarying request timesHandles loadTracks state
Weighted Round RobinStatelessUnequal capacityConsiders capacityStatic weights
IP HashStatelessSession affinitySticky sessionsUneven distribution
Least Response TimeStatefulPerformance priorityFastest serversOverhead

Clear Definition

Load Balancing distributes incoming requests across multiple servers to improve performance, availability, and scalability. Algorithms determine how requests are routed to backend servers.

šŸ’” Key Insight: Choose algorithm based on server characteristics, session requirements, and performance needs.


Core Concepts

Stateless Algorithms

Round Robin: Distribute requests sequentially
Weighted Round Robin: Distribute based on server capacity
IP Hash: Route based on client IP (session affinity)

Stateful Algorithms

Least Connections: Route to server with fewest active connections
Least Response Time: Route to fastest responding server


Best Practices

  1. Health Checks: Monitor server health
  2. Failover: Remove unhealthy servers
  3. Session Affinity: Use when needed (sticky sessions)
  4. Monitor: Track load distribution

Quick Reference Summary

Load Balancing: Distribute requests across servers for performance and availability.

Algorithms: Round-robin (simple), Least connections (load-aware), Weighted (capacity-aware).


Next Topic: Consistent Hashing →

Back to: Step 6 Overview | Main Index