[!todo] Seed note. A starting point, not a finished note yet.
A log-structured merge-tree (LSM-tree) is the storage engine under Cassandra, RocksDB, ScyllaDB, and many others. Instead of updating data in place like a B-tree, it buffers writes in memory, appends them sequentially, then periodically flushes sorted files to disk and compacts them in the background. That makes writes fast and disk-friendly, since even SSDs prefer sequential I/O, at the cost of reads that may consult several files and compaction that periodically rewrites data. Leveled compaction can rewrite a given record on the order of 50x over its lifetime, the write amplification an LSM accepts to keep the write path sequential. It is the standing counterexample to the B-tree: a storage structure can optimize for at most two of read, write, and space amplification, and the LSM picks writes. Seeded from A Mental Model for Databases.