Dev.to
7/20/2026

Building SaarDB, Part 3: Compaction
Short summary
Part 3 of a database storage engine series explains why LSM-tree-based systems need compaction: unbounded SSTable files cause read amplification and duplicate keys waste disk space. Compaction merges files and deduplicates keys, trading write amplification for better read performance and reduced storage. The article covers the three-way tension between read, write, and space amplification and explains threshold-based compaction strategies.
- •LSM trees accumulate SSTable files causing read and space amplification
- •Compaction merges and deduplicates files, trading write amplification for read performance
- •Three-way tradeoff: read vs write vs space amplification cannot all be minimized simultaneously
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



