Why it matters

Sharding enables massive scale. Understanding shapes scale-out systems.

Advertisement

The architecture

Shard key: determines which shard owns data.

Router: directs queries to right shard.

Sharding elementsShard keyhash or rangeRouter / directorymap key to shardRebalance on scalemove dataCross-shard queries hard; design queries around shard key when possible
Sharding pattern.
Advertisement

How it works end to end

Shard key choice: even distribution + query alignment.

Hot spots: uneven access. Consider salting or consistent hashing.

Rebalancing: consistent hashing minimizes data movement.

Cross-shard transactions: hard; avoid or use 2PC.