Advanced · Split data across machines, and add machines without chaos.
Sharding & consistent hashing
When data outgrows one database, you split it into shards. The real questions are which shard holds which key, and what happens when you add one more.
Try this
Run each experiment in the simulator above, then tick it off.
Key ideas
hash(key) mod N
Simple, but change N and almost every key lands somewhere new: a massive data shuffle.
Consistent hashing
Servers and keys sit on a ring; each key belongs to the next server clockwise. A new server only takes keys from its neighbour.
Virtual nodes
Each server appears at several points on the ring, so load spreads evenly.
In your Pabbly workflows
Mostly beneath what you'll build day to day, but it's why large platforms grow without downtime, and why “split the sheet by month or by client” is the spreadsheet version of sharding.
Check yourself
0/2Get every question right to mark this lab done. Wrong answers let you try again.
Q1. With hash mod N, going from 4 to 5 servers moves roughly…
A key only stays put if hash mod 4 equals hash mod 5, which is true for about 1 in 5 keys. The other 80% move.
Q2. Adding a server to N servers with consistent hashing moves about…
The newcomer takes roughly its fair share, and only from its neighbours on the ring.
Lab complete
Marked done on this device. On to the next one.
Watch next
Searches for “consistent hashing” on the channels worth your time.