Search code examples
cassandraflushtombstone

where else tombstones are used in Cassandra other than SSTables?


Does Memtables and commit logs have Tombstones for marking deleted data? How does data deleted in Memtables are marked before flushing data?


Solution

  • Yes and yes. The commit log contains mutations which may be tombstones. They are not read though unless the node goes down improperly, which is than used to rebuild memtable for durabilities sake.

    Memtables have the tombstones just like the sstables do. When you do a read the data from the memtable and the sstables are merged and the highest timestamp wins. Keep in mind a delete doesn't actually "delete" data from the memtable or sstables. It writes a marker (the tombstone) which is treated like any other piece of data.