Reducing Write Amplification of LSM-Tree with Block-Grained Compaction
Xiaoliang Wang, Peiquan Jin, Bei Hua, Hai Long, Wei Huang
Abstract
LSM-tree has been widely used as a write-optimized storage engine in many key-value stores, such as LevelDB and RocksDB. However, conventional compaction operations on the LSM-tree need to read, merge, and write many SSTables, which we call Table Compaction in this paper. Table Compaction will cause two major problems, namely write amplification and block-cache invalidation. They will lower both write and read performance of the LSM-tree. To address these issues, we propose a novel compaction scheme named Block Compaction that adopts a block-grained merging policy to perform compaction operations on the LSM-tree. Block Compaction identifies the boundaries of data blocks and tries to avoid reusing data blocks, which not only reduces the write amplification but also alleviates the block-cache invalidation. We present cost analysis to theoretically demonstrate that Block Compaction is more efficient than the existing Table Compaction. Furthermore, we analyze the side-effects of Block Compaction and present three optimizations: (1) Selective Compaction is to reduce the space amplification of Block Compaction by integrating Table Compaction with Block Compaction. (2) Parallel Merging divides a compaction task into several sub-tasks and uses multiple workers to accomplish sub-tasks in parallel. (3) Lazy Deletion mitigates the overhead caused by traversing files at the tail of compaction operations. We implement a new key-value store named BlockDB based on Block Compaction and its optimizations. Then, we compare BlockDB with LevelDB, RocksDB, and L2SM using the YCSB benchmark. The results show that BlockDB can reduce write amplification up to 32% and running time by up to 43.6%, compared to its competitors. In addition, it can maintain the high performance for point lookups and range scans.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get ce835f82-86ce-4249-a5b8-161f1a6d3603Cited by top-tier papers3
- FluidKV: Seamlessly Bridging the Gap between Indexing Performance and Memory-Footprint on Ultra-Fast StorageZiyi Lu, Qiang Cao, Hong Jiang, Yuxing Chen et al.VLDB 2024 · 8 citations
- Scavenger: Better Space-Time Trade-Offs for Key-Value Separated LSM-treesJianshun Zhang, Fang Wang, Sheng Qiu, Yi Wang et al.ICDE 2024 · 5 citations
- Resystance: Unleashing Hidden Performance of Compaction in LSM-Trees Via eBPFHongsu Byun, Seungjae Lee, Honghyeon Yoo, Myoungjoon Kim et al.ICDE 2026
Related papers
- Range Cache: An Efficient Cache Component for Accelerating Range Queries on LSM - Based Key-Value StoresXiaoliang Wang, Peiquan Jin, Yongping Luo, Zhaole ChuICDE 2024 · 10 citations
- Closing the Performance Gap between Leveling and Tiering Compaction via Bundle CompactionRuicheng Liu, Peiquan Jin, Xiaoliang Wang, Yongping Luo et al.HPDC 2023 · 5 citations
- Less is More: De-amplifying I/Os for Key-value Stores with a Log-assisted LSM-treeKecheng Huang, Zhiping Jia, Zhaoyan Shen, Zili Shao et al.ICDE 2021 · 27 citations
- Spooky: Granulating LSM-Tree Compactions CorrectlyNiv Dayan, Tamar Weiss, Shmuel Dashevsky, Michael Pan et al.VLDB 2022 · 57 citations
- Closing the B+-tree vs. LSM-tree Write Amplification Gap on Modern Storage Hardware with Built-in Transparent CompressionYifan Qiao, Xubin Chen, Ning Zheng, Jiangpeng Li et al.FAST 2022 · 23 citations
