B-Tree, B+ Tree & Storage Engine Internals Studio
Architect production database storage engines and indexing algorithms: simulate live B+ Tree node splitting and range scans in memory, inspect 8KB slotted page anatomy and line pointers, model Write Amplification Factors (WAF) and SSD endurance degradation, compare PostgreSQL nbtree vs InnoDB clustered index, and synthesize production Go and Rust storage code.
Interactive In-Memory B+ Tree Visualizer
Insert keys, observe automatic node splitting, rebalancing, and pointer chaining.
PostgreSQL & SQLite 8KB Slotted Page Anatomy
Inspect how variable-length row data and fixed-size line pointers share physical 8,192-byte disk pages:
(Block Number, Slot ID) rather than the physical byte offset. If a tuple expands or is defragmented inside the page, the database moves the bytes around in the bottom region and simply updates the 2-byte offset in the Line Pointer array. The external index never needs updating!
Write Amplification Factor (WAF) & SSD Endurance Calculator
Quantify disk write magnification, IOPS saturation, and NVMe SSD flash wear caused by random B+ Tree page updates:
Storage Engine Architecture Metrics
Enterprise Storage Engine Index Architecture Matrix
Compare the underlying storage architectures across modern database engines:
| Engine | Primary Table Layout | Secondary Index Pointers | Page Size | MVCC Mechanism |
|---|---|---|---|---|
| PostgreSQL (nbtree) | Heap-Organized Pages (Unordered) | ctid (6-byte Block + Slot ItemID) | 8 KB (Compile-time tunable) | Tuple header flags (t_xmin, t_xmax). HOT optimization avoids index updates. |
| MySQL (InnoDB) | Clustered Index (B+ Tree contains rows) | Primary Key value (forces bookmark lookup) | 16 KB (Default) | Undo Logs + Rollback Segment (DB_TRX_ID, DB_ROLL_PTR). |
| SQLite | intkey B-Tree (RowID is key) | RowID integer | 4 KB (Default) | Write-Ahead Log (WAL) frame index or rollback journal. |
| MongoDB WiredTiger | B-Tree with hazard pointers | Record ID / B-Tree Leaf | 4 KB to 64 KB configurable | In-memory transaction update chains + snapshot isolation. |