Cassandra hard
A developer runs `DELETE FROM table WHERE id = 1 AND timestamp < yesterday`. This creates a 'Range Tombstone'. Why can this cause subsequent `SELECT` queries for `id = 1` to fail with a timeout?
- A Because range tombstones permanently lock the table until the next full moon.
- B Scanning Complexity: The read path must merge the Range Tombstone from multiple SSTables. If there are many overlapping range tombstones, the database must perform complex 'Interval Tree' logic at read-time, consuming massive CPU/Heap.
- C Range tombstones are stored in the Cloud and require a network timeout to fetch.
- D It is not possible; range deletes are the fastest way to remove data.
Answer: B. Scanning Complexity: The read path must merge the Range Tombstone from multiple SSTables. If there are many overlapping range tombstones, the database must perform complex 'Interval Tree' logic at read-time, consuming massive CPU/Heap.
A Range Tombstone is a single record that says 'Everything between X and Y is dead'. While efficient for writing, it's difficult for reading because the database must check every cell against the 'Death Range' in every SSTable. Too many overlapping range tombstones lead to the dreaded `TombstoneOverwhelmingException`.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In a Cassandra Keyspace, what does a 'Replication Factor of 3' specifically guarantee for your data redundancy?
- Unlike a Leader-Follower architecture (like MySQL or Redis), how does Cassandra maintain high availability within its node cluster?
- Cassandra Query Language (CQL) looks similar to SQL. What is a fundamental SQL feature that CQL does NOT support to ensure distributed performance?
- What is the critical architectural function of the 'Partition Key' in a Cassandra table?
- Apache Cassandra is fundamentally designed as which architectural category of NoSQL database?
- An extreme financial trading application requires 'Batch' sync for the Commit Log. What is the fundamental throughput limitation introduced by this setting?