Prepare for the Cassandra Test with flashcards and multiple-choice questions, each with detailed hints and explanations. Elevate your skills and excel in your exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What happens to tombstones during compaction in Cassandra?

  1. They are always preserved

  2. They are discarded

  3. They are combined with live data

  4. They are archived for recovery

The correct answer is: They are discarded

During compaction in Cassandra, tombstones are discarded. Tombstones are markers that indicate a deletion of data within Cassandra's storage model. When a delete operation occurs, a tombstone is created instead of immediately removing the data. This allows Cassandra to handle eventual consistency and ensures that all nodes in the cluster can recognize that data has been deleted. During the compaction process, which is aimed at reclaiming storage space and improving read performance, tombstones that have reached their specified time-to-live (TTL) threshold are purged from the database. This is a critical component of maintaining database efficiency and managing disk space effectively. Over time, if not cleaned up, accumulated tombstones could lead to increased storage usage and degraded read performance, as they continue to take up space even though they represent deleted data. Because they are no longer necessary after the data they reference has been marked for deletion, their removal during compaction is an important optimization. This process helps keep the data storage clean and efficient, reducing unused space.