Implement Database Sharding

hash and range shard routing

Challenge 1 of Partitioning & ReplicationAdvanced~60 minFree

Split data across many nodes: route keys to shards with a deterministic hash, store and fetch from the right shard, scatter-gather across all shards, shard by key range instead of hash, and reshard by rehashing every key when you add a node.

5 steps

  1. 1Hash-Based Routing
  2. 2Storing and Fetching
  3. 3Scatter-Gather
  4. 4Range Sharding
  5. 5Resharding
Start step 1