The idea to keep with you
When using CoW B+Trees, keep read transactions short so old shadow pages can be reclaimed.
TL;DR30-second simplified summary▾
Delivers zero-copy mmap reads at RAM speed with O(log_B N) path-copying writes.
Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
B+Tree page structure
POSIX mmap() & OS page cache
MVCC snapshot isolation
Full walkthrough · 2 stages
01
Stage 1 • Mechanicsintermediate
Shadow Path Cloning & Atomic Root Swap.
Why this matters: Explain how path-copying eliminates page latches and torn-page corruption.
Modifying 1 leaf in a 4-level B+Tree clones 4 pages into free space, leaving the previous root's entire tree intact for active readers.
02
Stage 2 • Trade-Offsadvanced
Long-Lived Reader Page Bloat & Write Amplification.
Why this matters: Highlight the operational boundary conditions of CoW B+Trees.
If a read transaction stays open for hours, freed shadow pages pinned by that old root cannot be reclaimed until the reader closes, causing file growth.
Practice · Explain the consequences
Practice: Make the trade-off yourself.
Question 1 of 3
Score: 0/3Why do readers in LMDB require zero page latches?
Recommended Learning Flow