Code a database in 45 steps
This series of test-driven small coding puzzles lets you code a database from scratch (no dependencies). Through this project, you can:
- Learn database internals and computer science basics.
- Level up your skills through challenging work.
- Build an impressive personal project for your resume.
Project content
The project implements several key parts:
- KV storage engine.
- SQL and relational databases.
- Indexes and data structures.
The scope is wide, but it is split into many tiny steps. Each step is simple, with at most a few dozen lines of code. You will see how complex ideas grow from simple ones. In this sense, you invent a database from zero.
Prerequisites
- Have learned any programming language.
- Can use the command line (Linux or Windows).
Go language
- Go is easy to learn, so no prior experience is needed.
- You may use any language, since the core ideas are language-agnostic.
- It can also be used as a practice project for learning other languages.
Starter code and tests
Each step is in a separate directory. For step 1, enter db_project/0001 and run the tests:
go test .The build will fail. You need to write the missing functions. If you have problems:
- Check the test cases to gain insights.
- Refer to the author’s solution in the
db_solutiondirectory. - Discuss with the author by email: hi@trialofcode.org
Other projects like this
This is first Trial of Code project, I plan to release more puzzles that lead to complex, advanced software. Check my website and subscribe for updates: