# erikgrinaker/toydb

Distributed SQL database in Rust, written as an educational project

Repository: https://github.com/erikgrinaker/toydb
Canonical: https://ross.abutalabs.com/products/toydb
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: rust, distributed, database, raft, sql, mvcc
Last push: 2026-07-27T22:10:04+00:00

## Health v2 (maintenance only)
Score: 75/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 94, release rhythm 35, longevity 100
- inputs: {"age_days": 2684, "days_push": 37, "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 7276, forks 625 (observed 2026-08-28T04:09:57.971592+00:00)

## What it is
toyDB is a distributed SQL database written in Rust, built from scratch as an educational project to illustrate database internals. It features Raft consensus, MVCC-based ACID transactions, pluggable storage engines, and a SQL query engine, prioritizing simplicity and correctness over performance.

## Use cases
- learn how distributed SQL databases work internally
- study Raft consensus implementation in Rust
- understand MVCC and snapshot isolation transactions
- explore how a SQL query engine and optimizer are built
- read a simple codebase to learn database architecture
- run a small local Raft cluster for experimentation

## When to choose
- you want to learn database internals from readable source code
- you need a teaching example of Raft, MVCC, and SQL execution
- you prefer correctness and clarity over production features

## When to avoid
- you need a production database with performance, scalability, or availability guarantees
- you need a fully featured SQL dialect or rich tooling
- you need long-term support or a large contributor community

## Facets
- artifact type: learning-resource
- maturity: stable
- function: database, search-engine, parser
- domain: databases, microservices, education, developer-tools
- platform: windows, rust, cli
- tags: raft, mvcc, sql, educational, distributed-consensus, storage-engine, query-engine, linux, macos

## Member repositories
- erikgrinaker/toydb (main) score 75

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:57.971592+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:38:54.375664+00:00, confidence not recorded.
  - readme: https://github.com/erikgrinaker/toydb (fetched 2026-08-28T04:09:57.971592+00:00, sha be7cc02ecfd9)
  - registry_crates: https://crates.io/api/v1/crates/toydb (fetched 2026-08-29T08:34:12.275666+00:00, sha 753bfab1419c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
