AlgoMaster Logo

LSM Trees (Log-Structured Merge Trees)

Medium Priority12 min readUpdated October 25, 2026
AI Mock Interview

Practice this topic in a realistic system design interview

Premium Video

This video is available to premium subscribers only

Unlock Full Access

Most relational databases store their data in B-Trees, which update data in place. That works well for reads, but it can struggle when a system has to absorb a constant stream of writes.

LSM Trees, short for Log-Structured Merge Trees, take a different approach. They stop updating pages in place. Writes are collected in memory and written to disk in large, sorted batches, and the data is organized later in the background.

This design powers storage engines such as LevelDB, RocksDB, Cassandra, ScyllaDB, and HBase.

In this chapter, we will learn what an LSM Tree is, why write-heavy databases use it, how writes, reads, and deletes work, and the trade-offs that come with it.

1. The Problem with Updating in Place

Premium Content

This content is for premium members only.