advanced
Partitioning
Partition workloads or data so ownership, placement, ordering, and failure domains are explicit.
Partitioning divides workloads or datasets so each partition has clear ownership, placement, and failure domain. Database table partitioning splits rows by time or key inside one server. Message partition keys preserve order per entity in Kafka. Service partitioning assigns tenant cohorts to isolated stacks.
Partitioning differs from sharding in scope — you may partition logs by month without multi-node shards — but both aim to bound blast radius and improve parallelism.
On interviews: give examples of partition keys for ordering, explain failure domain benefits, and contrast partition versus shard.
Common pitfalls: partitions too small causing metadata overhead; uneven partition sizes; cross-partition transactions assumed free.
Checklist:
- Define partition key and ownership rules.
- Align partitions with failure domains.
- Plan growth and archival per partition.
- Document cross-partition operation cost.