Database / RocksDB Basics Interview Questions
What is the purpose of a Data Block within an SSTable?
A Data Block is the actual unit of storage inside an SSTable that holds a contiguous, sorted group of key-value pairs.
- An SSTable is made up of many data blocks, each covering a small portion of that file's overall sorted key range
- The SSTable's index block records where each data block starts, letting RocksDB jump directly to the relevant one
- Data blocks are the unit that gets compressed, cached, and read from disk, rather than the SSTable file as a whole
Splitting an SSTable into many smaller data blocks is what makes it practical to read just the small piece of a large file that's actually relevant to a given lookup.
More Related questions...