# ngaut/builddatabase

Build a distributed SQL database from the ground up

Repository: https://github.com/ngaut/builddatabase
Canonical: https://ross.abutalabs.com/products/builddatabase
License Family: other
Last push: 2022-09-11T10:54:09+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4049, "days_push": 1452, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2149, forks 307 (observed 2026-08-28T04:06:19.241146+00:00)

## What it is
An open-source book/course that teaches how to build a distributed SQL database from scratch, using TiDB and TiKV source code as reference examples. It covers SQL parsing, the MySQL wire protocol, query optimization, distributed transactions, Raft, schema changes, and distributed system testing.

## Use cases
- learn how distributed SQL databases work internally
- understand TiDB and TiKV source code
- study SQL parser implementation with goyacc and golex
- learn distributed transaction models like Percolator and Spanner
- understand Raft consensus and distributed key-value engines
- learn how to test distributed systems with Jepsen and fault injection

## When to choose
- you want a deep, source-code-driven guide to distributed database internals
- you are studying TiDB/TiKV or planning to contribute to them
- you want to learn SQL parsing, optimization, and Raft in one curriculum

## When to avoid
- you need a production-ready database rather than educational material
- you want a maintained tutorial with recent updates and active community
- you cannot read Chinese, since the content is written in Chinese

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: database, parser, documentation
- domain: databases, microservices, tutorials, education
- platform: cross-platform
- tags: distributed-sql, tidb, tikv, book, open-source-course, chinese-language

## Member repositories
- ngaut/builddatabase (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:19.241146+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-30T02:50:59.760084+00:00, confidence not recorded.
  - readme: https://github.com/ngaut/builddatabase (fetched 2026-08-28T04:06:19.241146+00:00, sha 7458d2a847a9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
