leafstore · visual B+ tree

On-disk B+ tree KV in TypeScript — this page is a live teaching model of insert / get / range. source

Ready — insert a few keys and watch the tree.
Tree

Leaves hold key→value pairs in sorted order. Internals hold separator keys. When a leaf overflows (order 4 = max 3 keys), it splits and a separator bubbles up — that’s why B+ trees stay balanced for disk pages.

← portfolio