Examples
Which keys move when a cache server joins
Three cache servers and four keys hashed onto a ring, each key going to the next server clockwise; a fourth server joins and only one key moves to it.
This video was made with the System design skill.
- 0:58
- System design
- Narrated by Kore
- English
Made from a prompt
Explain consistent hashing with a hash ring: which keys move when a server is added?
Video transcript
Adding one cache server should not force every cached key to move.
We hash cache server A onto a circle, then place servers B and C.
Now hash apple, book, cat, and dog onto that same circle, using their keys.
Each key belongs to the first server clockwise around the ring. So dog wraps past the top to A.
What happens when you need more capacity? Add server D between A and B.
Only book moves from B to D; its hash falls between A and D.
With uniform hashes, adding a fourth server moves about one quarter of keys on average. Real caches must refill moved entries.
Keys mark data; servers own the preceding clockwise interval. Adding D changes only its new interval, keeping other owners stable.
More examples
-
Where the money goes when you buy a $5 coffee A $5 latte split into what it pays for, one hand-drawn picture at a time: ingredients, staff, rent and running costs, the 50¢ left over, and why a quiet day makes every cup carry more rent. 2:14 · English -
Why your stomach gets gassy Where gas comes from, drawn and painted in as it is said: swallowed air, gut bacteria and foods like beans and milk, what normal looks like, what helps, and when to see a doctor. 2:17 · English -
A train’s average speed, then a triangle’s area Two problems on a teacher’s board: the options in a row, every line of working written as it is said, each answer checked before it is drawn. 2:07 · English
Your topic, drawn in about a minute.
Your first 2 videos are free, up to 1 minute each, watermarked. No card required. Full product, every voice and style included.