System Design Lab

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.

Wiring up the simulator…

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/2

Get 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…

Q2. Adding a server to N servers with consistent hashing moves about…

Watch next

Searches for “consistent hashing” on the channels worth your time.