zig [pagerdb_] github↗
query.sql
loading wasm…

My toy relational database, built from scratch in Zig — no dependencies, no prior database experience. I’m learning in public. The goal is a modular architecture where each layer is independently swappable. Early, unstable, and changing fast.

// deps 0
// lang zig
## 02 ─ internal/layers ─────────────────

Each layer is independently swappable — plug in a different buffer pool, storage backend, or transaction strategy without touching the rest. This is also my live progress log: what’s built, what’s planned, and what I’m still working out.

──Dialect + Parser
MySQL Dialect
mostly compatible
○○○○○planned
PostgreSQL Dialect
partial support
○○○○○planned
SQLite Dialect
basic support
○○○○○planned
──Planner
Rule-Based Planner
heuristic rewrites
○○○○
Cost-Based Optimizer
statistics-driven
○○○○○planned
──Transaction
Single-Writer
serializable isolation
●●○○○
MVCC
snapshot reads
○○○○○planned
──Buffer Pool
LRU
least-recently-used eviction
●●●●
Clock
approximate LRU, lower overhead
○○○○○planned
ARC
adaptive replacement cache
○○○○○planned
──Write-Ahead Log
WAL Manager
crash-safe commit records
●●○○○
──Storage Backend
Local File
.db file on disk
●●●○○
Remote / S3
object storage backend
○○○○○planned
In-Memory
ephemeral, no persistence
●●○○○
## 05 ─ frequently asked ───────────────────────────────────────────

Questions no one asked, but I'm answering anyway.

Q.01 is this production-ready?

No. Not even close. It's not mature enough to be considered a toy database, let alone a production one. If you're asking this seriously, I'm concerned.

Q.05 why zig?

I just wanted to learn Zig. No grand vision, no benchmark slides. Just vibes.

Q.03 how do i contribute?

I'm not accepting contributions right now — that would defeat the whole point of a learning project.

Q.04 do you use AI?

Yes, a lot — but I try not to let it just write everything for me. I slow down, read the output, understand it, and rewrite it myself when I can. Muscle memory in Zig won't build itself.