Partitioning (Sharding)
maang.io System Design Series
Partitioning (sharding) splits a dataset too big for one machine across many, so each node owns a slice. The art is picking a partition scheme β hash (even spread, no range scans) vs range (scannable, but hot-spot prone) β and handling rebalancing and skewed "hot" keys without a full reshuffle. It pairs tightly with Consistent Hashing and Replication.
This deep dive comes in three parts:
- Foundations & Core Concepts β hash vs range partitioning and why
hash % Nis a trap. - Internals β rebalancing strategies, hot keys, secondary-index partitioning, and request routing, with worked numbers.
- Interview β Staff/Principal Q&A: choosing a partition key and taming skew.