Database / RocksDB Basics Interview Questions
What is a Tombstone in RocksDB?
A Tombstone is the marker RocksDB writes to record that a key has been deleted, without immediately removing any of that key's prior data from disk.
- Behaves like any other write, it goes through the MemTable and WAL just like a Put would
- Causes reads for that key to correctly report it as not found, even though older SSTables might still physically contain earlier values
- Gets physically removed, along with the data it was masking, once compaction processes the SSTables containing it
If too many tombstones accumulate without being compacted away, they can noticeably slow down reads, since the read path has to skip past them to determine a key's true current state.
More Related questions...