Skip to content

3.1. Data Partitioning / Sharding

Partitioning (sharding) splits a dataset across nodes so that no single machine holds — or is bottlenecked by — all of it. The partitioning scheme you choose determines everything downstream: range partitioning enables efficient scans but invites hot spots, hash partitioning spreads load evenly but destroys locality, and any scheme must survive nodes joining and leaving without a full reshuffle. This chapter covers those trade-offs, consistent hashing as the standard answer to rebalancing, and the secondary-index problem that partitioning quietly creates.