The Desi Architect
Notes / Building Blocks / Partitioning and Sharding
Track 2 · Building Blocks

Partitioning and Sharding

One database box eventually runs out of disk, memory or write capacity. Sharding splits the data across machines by a key. The hard part is choosing that key, because every query, every transaction and every future resize depends on it.

Guide20 min read
On this page
  1. The shard that took all the orders
  2. The simple version
  3. Do not shard yet
  4. Choosing the shard key
  5. How a request finds its shard
  6. Things that get harder after you shard
  7. Hot shards and celebrity keys
  8. Changing shard count without a weekend outage
  9. What real systems do
  10. Decision table
  11. Common traps