Database / Apache Cassandra Intermediate and Advanced interview questions
What are tombstones in Cassandra?
Because Cassandra's SSTables are immutable once written, it cannot simply erase a row or column in place. Instead, a delete writes a tombstone — a special marker recording that a value was deleted, along with a timestamp.
- Tombstones can exist at the cell, row, range, or partition level, depending on what was deleted.
- During reads, tombstones are merged in like any other value and suppress the deleted data so it does not appear in results.
- Tombstones are only physically removed during compaction, and only after
gc_grace_secondshas passed since the delete, giving the cluster time to replicate the delete everywhere via repair.
DELETE FROM orders WHERE order_id = 'abc123'; -- writes a tombstone, doesn't immediately free disk space
If a tombstone were removed too early — before every replica had seen it — a replica that missed the delete could later resurrect the old value during a read or repair. That's precisely why gc_grace_seconds exists as a safety window before permanent removal.
More Related questions...