Experimental / learning project Built in Rust · 4KB Pages · Disk B-Tree · WAL

A tiny SQL database, built from scratch in Rust.

See how INSERT INTO users VALUES (1, 'alice'); travels from plain text into 4KB disk pages and a crash-safe log.

mydb.db — live engine preview
CREATE TABLE users (id INT, name TEXT); src/catalog.rs

              
Isometric diagram of rustdb engine Animated flow across Lexer/Parser, WAL, Buffer Pool, Catalog Page 0, TableHeap Page 1, and DiskBTree Page 2. LEXER + PARSER tokens -> AST WAL (mydb.wal) crash-safe tape BUFFER POOL (RAM) 1024 × 4KB frames PAGE 0: CATALOG table directory PAGE 1: HEAP (1, 'alice') slot 0 PAGE 2: B-TREE row_id 1 -> (1,0)
Creates a page for rows, a B-Tree root, and saves the table in Page 0.
One Idea at a Time

Three places to explore next. Pick your pace.

Try it locally with Cargo. Or stay in the browser to trace it visually.

Run locally (Interactive REPL)
shell
cargo build
cargo run --bin rustdb -- mydb.db
Run one-line demo
scripts/demo.sh
bash scripts/demo.sh