Leveled compaction
Leveled compaction organizes sorted data into levels with size targets and merges selected data with overlapping key ranges in a destination level.
In RocksDB, each nonzero level is one sorted run partitioned across SST files with nonoverlapping key ranges within that level; L0 can contain multiple overlapping runs. One run is not necessarily one file. [1] Compared with tiering, leveling usually trades more rewriting for fewer candidate runs and lower space overhead, but workload skew and file-selection policy affect that trade-off. RocksDB's L0 makes its Level policy a tiered-plus-leveled hybrid. [2]
Relations
- related
- lsm-tree, compaction, tiered-compaction, read-amplification, space-amplification