Showcase · Document database
ZetaDB
A document database written entirely in the language.
Collections of JSON documents with computed fields, maintained aggregates, indexes, atomic batches, snapshots and realtime watches. One static binary, embedded or over HTTP, with no C runtime underneath.
Results
2.03× faster than SQLite4.01× faster than PostgreSQL19.9× faster than MongoDB
1.79× faster than SQLite3.44× faster than PostgreSQL16.1× faster than MongoDB
2.20× faster than SQLite8.05× faster than PostgreSQL13.5× faster than MongoDB
1.61× faster than SQLite3.91× faster than PostgreSQL26.0× faster than MongoDB
1.68× faster than SQLite2.95× faster than PostgreSQL17.6× faster than MongoDB
37.0× lower than PostgreSQL55.3× lower than MongoDB94.4× lower than SQLite
4.95× lower than SQLite9.37× lower than PostgreSQL42.3× lower than MongoDB
2.28× faster than PostgreSQL2.78× faster than SQLite12.1× faster than MongoDB
4.47× faster than MongoDB5.05× faster than SQLite5.75× faster than PostgreSQL
1.02× less than SQLite4.95× less than PostgreSQL16.2× less than MongoDB
2.44× less than SQLite11.5× less than PostgreSQL53.4× less than MongoDB
x86-64 Linux, one pinned AMD EPYC Genoa vCPU for every engine · Vultr dedicated 2 vCPU, Ubuntu 24.04, Linux 6.8 · 31 October 2026 · bench/common/run.py
Medians of 5 runs after a warm-up, with a fresh database for every run. Every engine, servers included, ran on the same pinned CPU, and every answer was checked against a model before its time counted. SQLite 3.46.1 used WAL mode with synchronous=FULL; PostgreSQL 16.15 used synchronous commits; MongoDB 8.0.34 ran as a one-node replica set (change streams need one) with journaled writes. Each engine used its own idiomatic features: generated columns and triggers in SQLite and PostgreSQL. MongoDB has no stored computed fields or live views, so its totals were refreshed with $merge after each write, inside the write timings. Output goes to a memory-backed file read after the clock stops. Peak memory is the engine process's peak RSS plus, for PostgreSQL and MongoDB, their server processes (PSS) during the run; SQLite runs inside the Go test driver, whose runtime alone takes 10.4 MiB.
What it does
- Insert, upsert, replace, update and delete, with atomic batches that never publish a partial transaction
- Computed fields with dependency ordering and checked arithmetic
- Maintained collections: a $match stage and a final $project or $group, kept up to date with their sources
- Indexes, snapshots, checkpoints and fast reopen
- HTTP RPC and resumable realtime watches over server-sent events, with filtered and projected changes
- A typed client library for applications written in the language
Usage
[
{"op": "create_collection", "collection": "orders"},
{"op": "define_fields", "collection": "orders",
"fields": {"total": {"$multiply": ["$qty", "$price"]}}},
{"op": "insert", "collection": "orders", "key": "one",
"document": {"qty": 3, "price": 7}},
{"op": "get", "collection": "orders", "key": "one"},
{"op": "watch", "collection": "orders", "after": 0}
]
# embedded: one JSON response per command
$ zetadb ./orders commands.json
# HTTP RPC and realtime watches
$ zetadb-server ./orders 8080