Database / RocksDB Basics Interview Questions
What is a MemTable in RocksDB?
A MemTable is RocksDB's in-memory buffer that absorbs all new writes before they're ever touched by disk.
- Every Put, Delete, or Merge operation is applied to the active MemTable first
- Keeps data in sorted order, so it can be flushed directly into a sorted file later
- Has a configurable maximum size, with a default around 64 megabytes, after which it's swapped out for a fresh one
Because writes only need to touch memory to be considered durable-in-progress, once combined with the write-ahead log, the MemTable is central to why RocksDB can sustain such high write throughput.
More Related questions...