LSM-Trees & SSTables
7 min read.
Watch writes land in a memtable and a log, flush into sorted SSTables, get read newest-first with bloom filters, and merge during compaction.
Think of it this way: An LSM-tree is like a busy office that never edits old paperwork. New notes go on a sorted desk pad; when the pad is full it is filed as a dated folder. To answer a question you check the pad, then the newest folder, then older ones. Once a week someone merges old folders and throws away notes that were replaced.
An LSM-tree turns every write into a fast append. Watch 6 writes arrive, including an update and a delete.
Check your understanding
Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.
Follow a write into an LSM-tree
Order what happens from the moment a put arrives until its old value is cleaned up.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
- 1Drop a step here
- 2Drop a step here
- 3Drop a step here
- 4Drop a step here
- 5Drop a step here
Quiz
8 questionsWhere does an LSM-tree put a new write first?
Done with this lesson?
Sign in free to keep your progress, streak and quiz scores.