Load Balancer Algorithms: Round Robin, Least Connections, and Hashing
A tour of the distribution strategies a load balancer can run, and what each one costs you. We trace the same request through round robin, weighted round robin, least connections, least response time, IP hash, and consistent hash, watching the backend pool state after every decision. The point is not which algorithm "wins" — it's what each one ignores: connection length, server capacity, request cost, and session affinity all get traded away in different directions. We show the hot-spot failures each algorithm tolerates and the ones it creates.
Topics covered:
- Round robin and weighted variants, and why weights drift
- Least connections with slow-lingering requests
- IP hash and session stickiness without state
- Consistent hashing with bounded churn
- Picking per workload: short requests, long streams, cache-backed pools
Related articles
A Load Balancer Is Not a Magic Box
Layer 4 vs layer 7, hashing vs health checks, stickiness, and the failure modes hiding behind the most over-trusted building block in web infrastructure.
Leader-Follower vs P2P Architectures
Quorum write cost, gossip convergence time, and when peer-to-peer wins — CDNs, blockchains, and systems that can live without ordering.
Health Checks and Observability
Active vs passive health checks, circuit breaker interplay, and the four concrete reasons a dead node still gets production traffic.
More in System Design
Load Balancers, Explained
Layer 4 vs layer 7, health checks, stickiness, and the failure modes behind the most trusted box in your architecture diagram.
WatchSearch System Design: Inverted Indexes, Tokenization, and Ranking
How a search system actually works — inverted indexes, tokenization, relevance ranking, and the pipeline between a keystroke and ranked results.
DetailsNotification System Design: Fanout, Retries, and Delivery Channels
Designing a notification system — provider abstraction, fanout, retry policies, and how push, email, and SMS channels fail differently.
DetailsChat System Design: WebSockets, Presence, and Message Ordering
Designing a chat system — WebSocket connections, message ordering, presence, and what happens to undelivered messages when a client goes offline.
DetailsRate Limiter Design: Token Bucket, Sliding Window, and Distributed Limits
How rate limiters actually work — token bucket, fixed window, sliding window, and what breaks when the limiter spans multiple machines.
DetailsURL Shortener System Design: Encoding, Storage, and Redirects
Designing a URL shortener — base62 encoding, ID generation, redirect caching, and how the write and read paths differ in scale.
DetailsMessage Queue Design: Topics, Consumer Groups, and Delivery Guarantees
How message queues actually work — topics, partitions, consumer groups, exactly-once semantics, and what guarantees the broker really gives.
DetailsDatabase Replication Topologies Visualized: Leader, Multi-Leader, and Quorum
How database replication topologies actually work — single leader, multi leader, quorum, and what happens to reads and writes when a node fails.
DetailsCaching Strategies: Cache Aside, Write Through, and Cache Invalidation
How caching strategies actually work in production systems — cache aside, read through, write through, write back, and where stale reads come from.
DetailsDepth, delivered weekly
One technical dispatch a week — articles and episode notes before they go public.
One technical dispatch per week. No noise.