-
A durable OLTP engine, written in Rust
-
A database that shows its work.
-
- Every page is checksummed. Every commit waits for the log. Every
- benchmark names the machine it ran on, and a result is thrown out if a
- single correctness test fails. QuantaDB is being built the slow way:
- storage first, proofs before promises.
+
+
+
+
An OLTP database, measured in the open.
+
+ QuantaDB is a storage engine written in Rust and spoken to over the
+ PostgreSQL wire protocol. Every benchmark names the machine it ran on,
+ runs beside PostgreSQL, MySQL and MariaDB, and gets published whether it
+ wins or loses.
-
-
- data page 42, byte for byte
-
-
-
- 0000
- 51 4E 50 47
- magic "QNPG": this is a page
-
-
- 0004
- 01 00 00 00
- format v1, reserved
-
-
- 0008
- 2A 00 00 00 00 00 00 00
- page ID 42, little endian
-
-
- 0010
- C4 01 00 00 00 00 00 00
- last applied log sequence number
-
-
- 0018
- 9A 00 00 00
- payload length, 154 bytes
-
-
- 001C
- 7B 3D 91 C8
- CRC32 over the whole page
-
-
- 0020
- 00 00 00 00 …
- 32 reserved bytes
-
-
-
0040
-
51 4E 4D 56 01 00 00 00
-
payload: an MVCC version record, "QNMV"
+
+
+
22,528Reads per second, ahead of PostgreSQL
+
<1 msRead latency at the 99th percentile
+
5Machine profiles benched per change
+
Apache-2.0Open source, no paid tier
+
+
+
+
+
+
+
+
Why it exists
+
Most database benchmarks are marketing. These are not.
+
+ Performance claims usually arrive without the hardware, the
+ competitors, or the runs that went badly. QuantaDB publishes all
+ three, because a number you cannot reproduce is not a number.
+
+
+
+
+
Durable by default
+
+ A commit returns once its record is on disk. Pages carry checksums,
+ the log is replayed on restart, and corruption is detected rather
+ than assumed away. There is no faster mode that quietly drops this.
+
-
-
0048
-
1D 00 00 00 00 00 00 00
-
committed at timestamp 29
+
+
Readers never wait for writers
+
+ Snapshot isolation with multi-version reads. A query sees a
+ consistent moment in time and takes no locks, so a long read cannot
+ be blocked by a slow commit.
+
-
-
0050
-
…
-
key, value, zero padding to 8192
+
+
Speaks PostgreSQL
+
+ Connect with psql, psycopg, or any Postgres driver you already use.
+ There is a native protocol and a browser client too, but nothing
+ forces you onto them.
+
-
-
+
-
-
- On disk
- Five magics, one rule: versioned, checksummed, documented.
-
- Everything QuantaDB persists starts with four bytes that say what it is
- and a version that says how to read it. Readers verify before trusting.
- The formats are documented in the repository down to the byte, because a
- storage engine you cannot audit is a storage engine you cannot trust.
+
+
+
+
Benchmarks
+
Four engines, identical containers, one driver.
+
+ Each database runs alone at 2 CPUs and 2 GiB with default durability,
+ driven by the same client over the same protocol. Operations per
+ second, higher is better.
+
+
+
+
+
+
+ | Engine | Reads | Mixed 80/20 | Writes |
+
+
+ | QuantaDB | 22,528 | 16,774 | 8,374 |
+ | PostgreSQL 18 | 17,060 | 17,006 | 11,404 |
+ | MariaDB 11.4 | 3,735 | 4,006 | 6,741 |
+ | MySQL 8.4 | 3,804 | 3,845 | 4,847 |
+
+
+
+
+ QuantaDB leads on reads and ties on mixed. PostgreSQL still leads on
+ writes, and the gap is tracked in the open. Read throughput for MySQL and
+ MariaDB is limited by the shared Python driver; their write numbers are
+ server bound.
-
-
- QNPGdata page8192 bytes, CRC32, identity checked on every read
- QNWLlog recordphysical page image, batch commit, or checkpoint
- QNMVversion recordkey, optional value, commit timestamp
- QNIXindex nodeimmutable B+ tree leaf or internal node
- QNIRindex root48 byte manifest publishing one generation
-
+
-
-
- Architecture
- Six crates, one direction.
-
- The dependency graph is acyclic and enforced: parsing knows nothing of
- storage, the server delegates everything to the engine, and the network
- threads never touch a disk. Each layer is testable, and tested, alone.
-
-
-
- -
-
-
syntax
-
A dependency-light SQL lexer and parser. Every token carries a byte
- span, so an error can point at the exact character that caused it.
-
- -
-
-
storage
-
Checksummed pages, a physical write-ahead log, restart recovery, and
- a group commit coordinator that lets concurrent writers share syncs.
-
- -
-
-
index
-
Immutable B+ tree generations. Readers traverse without locks while
- the next generation is built beside them, never on top of them.
-
- -
-
-
mvcc
-
Snapshot isolation with first-committer-wins conflicts. Versions
- become visible only after the log says they are durable. Old versions
- are reclaimed the moment no snapshot can see them.
-
- -
-
-
engine
-
The relational layer: schemas, constraints, typed expressions, and
- transactional CRUD mapped onto ordered binary keys.
-
- -
-
-
server
-
A TCP server bounded on every axis: connections, in-flight requests,
- frame size, idle time. Overload gets a clean error, not a hung socket.
-
-
+
+
+
+
Get started
+
Running in about a minute.
+
Start the server, then connect with the Postgres client you already have.
+
+
# start a server
+docker run -p 55432:55432 ghcr.io/martian56/quantadb
+
+# connect with psql
+psql "host=127.0.0.1 port=55432 user=quanta dbname=quanta"
+
+CREATE TABLE notes (id BIGINT PRIMARY KEY, body TEXT NOT NULL);
+INSERT INTO notes VALUES (1, 'durable on return');
+SELECT * FROM notes;
+
-
-
- Measured, not promised
- The benchmark log is part of the changelog.
-
- These are medians from the development machine: a Core i5-1035G1 laptop
- with a consumer NVMe drive, full sync on every commit. Not a marketing
- rig. When a change regresses a number, the number gets published anyway
- and the regression gets fixed next.
-
-
-