Cassandra Interview Questions Interview Questions

[Interview Question] – What are tombstones in Cassandra? Impact of excessive number of tombstones ?


In DSE Cassandra, a tombstone is created when data is deleted from a keyspace that has a replication factor (RF) greater than 1

  • Some operations that generate tombstones:
    • CQL DELETE statement.
    • Expiring data with time-to-live (TTL)
    • Using internal operations(materialized views)
    • INSERT or UPDATE operations with a null value
    • UPDATE operations on a collection column
  • When a tombstone is created, it can be marked on different parts of a partition. Based on the location of the marker, tombstones can be categorized into one of the following groups. Each category typically corresponds to one unique type of data deletion operation
    • Partition tombstones
    • Row tombstones
    • Range tombstones
    • ComplexColumn tombstones
    • Cell tombstones
    • TTL tombstones
  • The tombstones go through the write path, and are written to SSTables on one or more nodes. A key differentiator of a tombstone is a built-in expiration known as the grace period, set by gc_grace_seconds. At the end of its expiration period, the tombstone will be deleted as part of the normal compaction process

An excessive number of tombstones in a table can negatively impact application performance. Many tombstones often indicate potential issues with either the data model or in the application.

  • Partition tombstones : Generated when an entire partition is deleted explicitly
  • Row tombstones : Generated when a particular row within a partition is deleted explicitly
  • Range tombstones : Occur when several rows within a partition that can be expressed through a range search are deleted explicitly
  • ComplexColumn tombstones : Generated when inserting or updating a collection type column, such as set, list, and map
  • Cell tombstones : Generated when explicitly deleting a value from a cell
  • TTL tombstones :  Generated when the TTL (time-to-live) period expires

    PS : Use sstabledump utility to read timestamps and tombstones
    Restriction: DataStax Enterprise must be stopped before you run this command(sstabledump).

Click here for more information

Comments Rating 0 (0 reviews)

About the author


Add Comment

Click here to post a comment