Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Practice build · Data stores and distributed systems

Build your own Database

A small relational database: a REPL, an on-disk page format, a B+tree index, a SQL subset and crash-safe writes.

  • Advanced
  • About 30–60 h
  • 5 checkpoints
  • 4 tutorials · Go, C, Python

Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.

Choose a tutorial

Why build it

Query plans, indexes and isolation levels become concrete once you have stored rows in pages and searched a B+tree yourself.

You will be able to

  • Store rows in fixed-size pages and persist them to a file.
  • Implement a B+tree for key lookups and range scans.
  • Parse and execute a small SQL subset.
  • Make writes atomic with a journal or copy-on-write, and state which isolation you provide.

Skills it exercises

Recommended on Backend Engineer and Data Engineer.

Checkpoints

How you know you are there

Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.

  1. Checkpoint 1Self-check

    REPL

    Done when: insert 1 ada [email protected] and select work in a REPL with errors for bad input, and tests drive the REPL as a subprocess.

  2. Checkpoint 2Self-check

    Persistence

    Done when: Rows survive closing and reopening the database file, stored in fixed-size pages through a pager.

  3. Checkpoint 3Self-check

    B+tree

    Done when: Lookups use a B+tree that splits leaf and internal nodes; a test inserts 10,000 keys in random order and reads them back sorted.

  4. Checkpoint 4Self-check

    SQL subset

    Done when: CREATE TABLE, INSERT and SELECT with a WHERE range work, and a log line or EXPLAIN shows when the index is used.

  5. Checkpoint 5Self-check

    Crash safety

    Done when: Killing the process mid-write never corrupts the file: a crash test always finds either the old or the new data.

Stretch goals

  • Secondary indexes.
  • Concurrent readers with one writer.
  • A free list that reuses deleted pages.
Follow a tutorial

Step-by-step guides

Pick one in a language you know (tutorial languages: Go, C, Python). They open on the author’s site.

Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.

Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.