Storage glossary · JSON corpus · llms.txt · hesela.com

leveled-compaction · shipping · also Level compaction

Leveled compaction

Leveled compaction organizes sorted data into levels with size targets and merges selected data with overlapping key ranges in a destination level.

Related Observatory article: Leveled compaction on hesela.com

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

Citations

  1. RocksDB project. Leveled Compaction: sorted runs and the L0 exception. (accessed 2026-10-14)
  2. RocksDB project. Compaction: leveled, tiered and hybrid policies. (accessed 2026-10-14)
  3. Hesela. Bloom filters: optimize the lookup, not each filter; compaction and measurement boundaries. (accessed 2026-10-14)

JSON: /data/terms/leveled-compaction.json