DSA Trainer
← System Design Foundations

System Design · Unit 12

Sharding / partitioning

Replication gave you more read capacity and a way to survive failure, but it has a ceiling. Every replica still holds the entire dataset, and every write still goes through the single leader. So if you have more data than one machine can hold, or more writes than one leader can absorb, replication alone will not save you.

Sharding is the next tool. Instead of copying the whole database, you split it into pieces and put each piece on a different machine. User A's data lives on one shard, user Z's on another. Now the data and the write load are divided across many machines, each responsible for its slice.

That power comes with real complexity: you have to decide how to split the data, watch out for uneven "hotspots", and accept that questions spanning multiple shards get harder. This unit is about making that tradeoff knowingly.

Goal: Explain how splitting data across machines scales writes and storage, how a shard key decides the split, and the hotspots and cross-shard costs it introduces.
Premium unit

The rest of the System Design course is premium

The first two units are free, and this is where the gate sits. Unlocking premium opens this unit and everything else in both courses:

  • This unit: 5 prediction-first lessons, 3 applied drills, and a 5-question graded test
  • All 20 System Design units, caching to CAP & consistency
  • The full DSA course: every unit, guided problem, and drill

Cancel anytime. Not useful within 7 days? Email for a full refund.

Not sure yet? Start with the free units →