LESSON 33.07 · 5 STAGES · 3 CONTROLS · 2 CHECKSPRO · PREVIEW
Consensus and leader election
Watch five nodes elect a leader, commit a write and survive a crash.
Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 2 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 33.07 · SESSION STORE5 NODES · MAJORITY 3 · 0 DOWN
01
Stage 1 of 5 · Election timers
Each node starts as a follower with a random timer. N2's timer runs out first, at 179 ms.
Explain it simply
Each node waits to hear from a leader, the one node that takes the writes. The ochre ramp on each lane is its timer running down. Each node picks its own wait between 150 and 300 milliseconds. So one node, N2, gives up first and asks to lead.
5 lanes, one per node. Timeouts: N1 224 ms, N2 179 ms, N3 297 ms, N4 180 ms, N5 252 ms.
followercandidate, timerleader, votewritedown, lost (dashed)refused voteheartbeat
Toy: the 33.05 session store on nodes N1–N5, 15 ms per message
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Each node draws its own wait from 150 to 300 ms.
PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
- 4 more stages and 3 live controls
- 2 mix-up cards and 2 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.