Datarebalancingshard splitrepartitioning

Resharding

Definition

Resharding redistributes keys across a new set of shards and migrates the data so that every key ends up on the shard the new mapping assigns.

In practice

Shards fill up, or the original count was too small. With hash(key) mod N, changing N moves almost every key, which is why systems use consistent hashing, a fixed large number of logical partitions mapped to fewer nodes, or range splits, so only a fraction of the data moves.

Even then the data must be copied while writes continue: backfill, replay changes made during the copy, verify, then switch routing atomically. This takes days on large datasets, adds load to already-busy shards, and every query path must handle keys in transit. Start with more logical partitions than you need to make later moves cheap.

Example

A cluster with 1,024 logical partitions on 8 nodes grows to 16 nodes by moving 512 whole partitions; no key is rehashed and routing changes one partition at a time.