LESSON 33.06 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Consistent hashing
Watch 24 sessions find their nodes on a hash ring as nodes join and leave.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 33.06 · RING BAYMOD 4 · 24 SESSIONS ON 4 NODES
01
Stage 1 of 6 · Hash mod n
Each session goes to node hash mod 4. N1 to N4 hold 3, 11, 6 and 4 sessions.
Explain it simply
A hash function turns each session's id into a big number. Divide it by 4 and keep the remainder: 0, 1, 2 or 3. The remainder picks the node, like dealing cards into 4 piles. Each chip is one session, and its height shows its size in MB.
Four node columns, N1 to N4, stack 24 session chips placed by hash mod 4. The tallest stack is N2.
sessionsnodes, positions, 64 MB lineownermoved, or over 64 MBnode down (grey box)
Toy: 24 sessions (140 MB) on N1–N4, 64 MB each; spare N5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
The remainder of the hash divided by n picks the node.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 3 live controls
- 2 mix-up cards and 3 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.