Databases · Senior · Question 6 of 75
How do B-tree storage engines and LSM-tree storage engines differ for writes?
- 1B-trees are only used in NoSQL databases
- ✓Correct answer: B-trees update pages in place; LSM trees append to memory and sorted files that are merged later, which makes writes cheaper but reads and compaction more complex
- 3LSM trees can't store sorted data
Explanation
Cassandra, RocksDB and ScyllaDB use LSM trees for write-heavy workloads. PostgreSQL and MySQL InnoDB use B-trees.