Algorithms and Data Structures · Senior · Question 15 of 75

What trade-off do LSM trees make compared with B-trees?

Explanation

Writes go to memory and are flushed as sorted files, so disk writes are sequential. Reads may check several files (Bloom filters help), and background compaction merges them. Cassandra, RocksDB and LevelDB use LSM trees.

Further reading

Problem with a question

Algorithms and Data Structures · Senior · question 15

Test yourself

Take the Algorithms and Data Structures · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz