The mechanic

shard = hash(key) mod N. Simple, fast, deterministic. Same key always same shard.

Advertisement

The mechanic

shard = hash(key) mod N. Simple, fast, deterministic. Same key always same shard.

Advertisement

Distribution

Good hash function → uniform distribution. No hotspots from natural key clustering (unlike range sharding).