sagelearnai

Sharding and Consistent Hashing

When one database primary cannot keep up with writes or data volume, you split the data across machines: sharding (partitioning). The shard key is the most consequential decision in the design, because it decides balance, which queries are cheap and how painful growth will be.

In this lesson

  • Learning objectives
  • Partitioning strategies
  • Choosing the shard key
  • Consistent hashing
  • Hot keys and growth
  • Self-check

Questions covered

  1. How do you choose a shard key?
  2. Explain consistent hashing and virtual nodes.
  3. How would you reshard a live database?

This lesson is part of System Design Interview: Concepts, Patterns & Real Designs. Unlock the full course to read it, take the quiz and track your progress.

See plans →

Last reviewed 2026-11-05.