# cstack/db_tutorial

Writing a sqlite clone from scratch in C

Repository: https://github.com/cstack/db_tutorial
Canonical: https://ross.abutalabs.com/products/db_tutorial
Homepage: https://cstack.github.io/db_tutorial
Language: C
License: MIT
License Family: permissive
Topics: database
Last push: 2024-03-04T14:18:06+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3289, "days_push": 912, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 10504, forks 1032 (observed 2026-08-28T04:10:42.139921+00:00)

## What it is
A step-by-step tutorial that builds a SQLite clone from scratch in C, covering a REPL, a simple SQL compiler and virtual machine, persistence, cursors, and B-tree indexes. The accompanying code is a learning artifact rather than production software.

## Use cases
- learn how databases work internally
- build a sqlite clone from scratch in c
- understand b-tree index implementation
- learn how sql is parsed and executed
- study database persistence to disk
- follow a hands-on systems programming tutorial

## When to choose
- you want to deeply understand database internals by building one
- you're learning C through a substantial systems project
- you want a guided tutorial covering compilers, VMs, and B-trees

## When to avoid
- you need a real database for an application
- you expect active development or support
- you want a production-ready SQL engine

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: database, parser, interpreter
- domain: databases, education, tutorials
- platform: c, cli
- tags: sqlite-clone, b-tree, tutorial, repl, virtual-machine, systems-programming, linux, macos

## Member repositories
- cstack/db_tutorial (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:42.139921+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:18:57.566005+00:00, confidence not recorded.
  - readme: https://github.com/cstack/db_tutorial (fetched 2026-08-28T04:10:42.139921+00:00, sha cd18e3d1e44f)
  - homepage: https://cstack.github.io/db_tutorial (fetched 2026-08-29T08:17:55.005919+00:00, sha 40d82e4cee8b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
