Database / Apache Cassandra Intermediate and Advanced interview questions
What is a wide partition in Cassandra and why is it a problem?
A wide partition is a partition that has grown far larger than a healthy size — typically flagged once it approaches the hundreds-of-megabytes range or accumulates millions of cells, though the practical threshold depends on hardware and access patterns.
- Wide partitions usually come from a partition key that's too coarse — for example, partitioning IoT sensor data only by
device_idwith no time bucketing, so a single partition grows forever. - Reads against a wide partition have to work through more SSTable data, more tombstones, and larger in-memory structures, increasing latency and heap/GC pressure.
- Compaction on wide partitions takes longer and uses more temporary disk space, and a single oversized partition can create a "hot" node that's disproportionately loaded compared to its peers.
- Cassandra logs a warning (
compaction_large_partition_warning_threshold_mb) when it encounters unusually large partitions during compaction.
The fix is almost always in the data model: add a bucketing component (like a date or hash bucket) to the partition key so a logically related dataset is split across many smaller, evenly-sized partitions instead of one unbounded one.
More Related questions...