Back to all projects

Mini DB

Live
Go
B+Tree
WAL
Transactions
Crash Recovery
LRU Cache
Page-Based Storage
Concurrency
File I/O

Note

The live demo is a B+Tree operations visualizer. The full database engine implementation is in the GitHub repo and is best evaluated via the codebase + test suite.

Project Overview

A file-backed B+Tree database engine implemented in Go with full CRUD, transactions, and Write-Ahead Logging (WAL). It supports crash recovery by replaying WAL entries, a configurable LRU page cache, range queries via leaf linking, and composite keys/typed records.

Challenges & Solutions

Managing concurrency in a multi-threaded environment where multiple operations attempt to modify the B+Tree simultaneously. The multi-step nature of tree operations (splits, borrows, merges) makes fine-grained synchronization extremely complex. The current implementation ensures safety by locking at the tree level, though I am researching more advanced methods like 'B-link Trees' to achieve higher concurrency through latching protocols.

Results & Impact

Delivered a production-style B+Tree engine with durable writes (WAL), automatic crash recovery, and multi-operation transactions. Successfully handled data integrity in concurrent scenarios using tree-level locking while establishing a clear roadmap for future performance optimizations.