{
  "slug": "lsm-tree",
  "term": "Log-structured merge-tree",
  "aliases": [
    "LSM-tree",
    "LSM tree",
    "log structured merge tree"
  ],
  "definition": "A write-oriented index that buffers updates and merges sorted components over time, trading write batching against read and compaction work.",
  "note": "Structure: In RocksDB leveled compaction, L0 files may overlap, while each higher level partitions one sorted run across SST files. A run is a logical ordering unit, not necessarily one file. [rocks-levels]\n\nLifecycle: LevelDB buffers recent updates in a memtable and creates persistent sorted tables; compaction merges tables and removes records only when they are no longer needed. Deletion markers can remain to hide older values. These are implementation mechanisms, not a promise that every run contains only the latest visible value. [leveldb]\n\nPolicy: LSM organization does not imply one compaction strategy. The research taxonomy separates the trigger, layout, compaction granularity and data-movement policy. Distinguish a logical run from the files selected for a particular compaction. [compaction-design]",
  "related": [
    "bloom-filter",
    "sstable",
    "write-amplification",
    "lsm-tombstone",
    "key-value-separation",
    "compaction",
    "leveled-compaction",
    "tiered-compaction",
    "read-amplification",
    "space-amplification",
    "b-epsilon-tree",
    "copy-on-abundant-write",
    "sorted-run",
    "fragmented-lsm-tree",
    "vt-tree",
    "bourbon",
    "lsm-trie",
    "spandb",
    "slimdb",
    "novelsm",
    "matrixkv",
    "tebis",
    "rocksdb",
    "leveldb"
  ],
  "citations": [
    {
      "id": "rocks-levels",
      "title": "RocksDB project. Leveled Compaction: Structure of the files.",
      "url": "https://github.com/facebook/rocksdb/wiki/Leveled-Compaction",
      "accessed": "2026-10-25"
    },
    {
      "id": "leveldb",
      "title": "LevelDB 1.23 implementation note: Sorted tables, Compactions and Timing.",
      "url": "https://github.com/google/leveldb/blob/1.23/doc/impl.md",
      "accessed": "2026-10-25"
    },
    {
      "id": "hesela",
      "title": "Hesela: Bloom filters and the cost of an absent LSM lookup",
      "url": "https://hesela.com/analyses/bloom-filters-lsm-read-cost/",
      "accessed": "2026-10-12"
    },
    {
      "id": "compaction-design",
      "title": "Sarkar et al. Constructing and Analyzing the LSM Compaction Design Space. PVLDB 14(11), 2216-2229 (2021), section 2. DOI: 10.14778/3476249.3476274.",
      "url": "https://www.vldb.org/pvldb/vol14/p2216-sarkar.pdf",
      "accessed": "2026-10-25"
    }
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-30"
}
