A minimal database from scratch using Go. I wanted to understand how databases actually work under the hood, which turned into a fascinating deep-dive into database internals.
I implemented a Data Access Layer (DAL) which is responsible for dividing the database files into fixed size chunks and make managing individual data nodes feasilble.
I chose B Trees because they're practically the industry standard for database indexes. My implementation includes:
- Efficient range queries
- Auto-balancing on insert/delete
- Disk-friendly node structure
- Configurable node size
If you're interested in building your own database, here are some resources I found incredibly helpful: