Skip to main content

Building blocks

The primitives: how a request travels, where data lives, how you find it fast, and how you survive scale and failure.

📄️Consistent hashing: The hash ring

Splitting the data ended on a cliffhanger. Hash-based sharding spreads data beautifully — until you add or remove a shard, and shard = hash(key) % N reshuffles almost everything, because N changed. For a system that's growing, that's a dealbreaker: every time you add capacity, nearly all your data has to move at once. Consistent hashing is the fix — a different way to map keys to shards that moves only a thin slice of the data when the shard count changes.