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.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
