Protocol in Code · Track

Load Balancer

picking strategies, consistent hashing, and health as a state machine

6 sessions Course material (English)

Sessions

Load Balancer track sessions

Session 01

Round Robin Is One Index

How do you spread requests evenly across backends when you are willing to know nothing else about them?

Open Session 01
Session 02

Least Connections Is a Counter

If you're willing to track one number per backend, what does that number buy you that round robin's blind index can't?

Open Session 02
Session 03

Hashing Keeps You on the Same Server

How do you guarantee the same client lands on the same backend every time, with no state at all — and what does that guarantee cost you when the backend list changes?

Open Session 03
Session 04

The Ring Survives a Server Change

Session 03 showed that folding a client key onto len(backends) with modulo remaps almost every key when membership changes. What has to change about the fold so that only the keys that truly need to move actually move?

Open Session 04
Session 05

Health Is a State Machine

None of the picking strategies taught so far know whether a backend is actually answering — only that it exists. What turns a stream of probe results into a routing decision, and why is going down fast and coming back slow the same design, not two different ones?

Open Session 05
Session 06

Build the Toy Load Balancer Loop

Five earlier files each answer one question in isolation — how to pick among backends assumed to be up, and how to know which ones actually are. What does the smallest object look like that filters a live request through health *before* handing it to whichever picking strategy is configured?

Open Session 06