System Design Fundamentals
Vote

0% completed

B-Tree vs. LSM Tree

A B-tree changes data where it already lives. An LSM tree never does. That single difference decides whether a database is good at writes or good at reads, and it is why Cassandra and PostgreSQL behave so differently under the same load.

This is the most common storage question an interviewer can ask that candidates have no answer for.

1. The Problem With Updating in Place

Look again at what a B-tree write costs.

The database finds the page holding the key, changes it, and writes the page back. Two things make that expensive.

**The write is random

.....

.....

.....

Like the course? Get enrolled and start learning!