B-tree vs LSM-tree.
Filing each card neatly in place as it arrives, versus jotting everything in order and tidying up in batches later.
- 1
A B-tree is a librarian who re-shelves every returned book the instant it comes back.
- Back and forth all day.2
Keeping the shelves sorted means lots of walking around — scattered, random writes.
- Right where it should be.3
The payoff: reads are direct. Walk straight to the exact shelf and grab it.
- On the cart, sort it later.4
An LSM-tree dumps returns on a cart and jots them down fast — quick, sequential writes.
- Now where did I put it…5
A reader may now check the cart and several shelves — so reads can touch more places.
- 6
In the background, compaction sweeps the carts onto sorted shelves and drops stale copies.
Semicolony semicolony.dev/eli5/btree-vs-lsm/comic