Systems on Glass is an AI-automation side project of mine. Every episode is generated by Claude (Anthropic's AI, working through Claude Code in my own video studio): the script, the motion graphics, the edit, and the narration in an AI clone of my voice. I choose the topics, bring the stories from my own work, and review each episode before it goes up. Not affiliated with Anthropic.
In 2020 at UMBC, four of us built a file system out of laptops on home Wi-Fi. Put 120 files on three laptops, add a fourth, and the obvious placement moves 88 of them.
The short version
- Sharding cuts the data into slices and gives each machine one. The hard part is knowing which machine holds which file.
- We broadcast it. In 2020 we picked a random laptop for each copy, then sent the whole directory to everyone. It worked for four laptops. Cost: every node learns about every file.
- Hash mod n computes the address, so no directory is needed. But change n and almost every remainder changes: 3 laptops to 4 moved 88 of 120 files.
- Consistent hashing puts files and machines on a ring. A file belongs to the next machine clockwise, so a newcomer only takes files from its neighbour. With one point per machine the load is lopsided (one laptop kept 70), so each machine gets many points: with 16, adding the fourth moved 36 files, all to the new laptop.
- Then and now. Karger and colleagues at MIT named it in 1997; Amazon's Dynamo made it famous in 2007; Cassandra still gives each node 16 points (
num_tokens) by default.
hash mod n: 88 move (73%)
ring, 1 point each: 3 move, but loads A 23 · B 24 · C 70 · D 3
ring, 16 points each: 36 move (30%), all to D · after: A 33 · B 29 · C 22 · D 36
The 2020 system is written up in full, with the same ring you can click, in The File That Wouldn't Die. The numbers here come from the video's own hash (FNV-1a with a murmur3 finish), so yours will differ a little; the shape won't.
Further reading
- Consistent hashing (Wikipedia) — the 1997 origin at MIT, and why only num_keys/num_slots move.
- Amazon's Dynamo (Werner Vogels, 2007) — the paper that put consistent hashing and virtual nodes in production.
- cassandra.yaml: num_tokens (Apache Cassandra docs) — virtual nodes today: 16 per node by default.
Next episode: Shape ≠ Meaning (structured output). Previously: The Model Only Asks. All episodes →