Hall of FamePatrick O'Neil, Edward Cheng, Dieter Gawlick, Elizabeth O'Neil199688 min readpaperintermediate
The Log-Structured Merge-Tree (LSM-Tree)
Summary
The Log-Structured Merge-Tree (LSM-tree) is a disk-based data structure designed to provide low-cost indexing for files with high insert rates, like history tables or logs. It defers and batches index changes, cascading them from memory to disk components, significantly reducing disk I/O compared to B-trees for writes.
- LSM-trees reduce disk I/O for high-volume inserts by deferring and batching index changes.
- Changes cascade from an in-memory component to one or more disk components, similar to merge sort.
- All index values remain accessible during the merge process, either in memory or on disk.
- Less efficient for immediate, random read queries compared to traditional B-trees.
Engineers building high-throughput data systems with write-heavy workloads, like databases or logging services, should understand LSM-trees to optimize indexing costs and performance.
9/10


