Skip to content
ufraan
← Back

Copia

Writing a database from scratch in Go; implementing a KV storage engine, basic SQL/relational layers, and core indexing data structures

GoDatabase
Mar 2026GitHub

Copia is an ongoing experiment in building a database from scratch in Go. The idea was to go layer by layer - bytes on disk, a key-value storage engine, B-tree and hash indexes, a hand-written SQL parser, and eventually a relational query layer. SELECT, INSERT, UPDATE, DELETE work at a basic level with simple ACID transaction guarantees, but the project is roughly 10% done and has been sitting untouched for a few months.

Database engine built from scratch in Go
Database engine built from scratch in Go

Pure Go, no external dependencies. Custom binary serialization for the storage format and a recursive descent parser for SQL. Each package maps to a database subsystem. Still planning to come back to it - the storage engine and indexing layers are the most complete parts right now.