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
- How do you choose a shard key?
- Explain consistent hashing and virtual nodes.
- 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.