Transactions first
MVCC with snapshot and serializable isolation, a write-ahead log and a crash-safe copy-on-write B+tree underneath every model.
nucleus is a layered, multi-model database written in Rust from scratch. A transactional key-value core sits at the centre — SQL, documents and distribution are built around it, without rewriting what is inside.
# a key-value store, transactional from the first byte
$ nucleus kv ./mydb put greeting "hello world"
# SQL on the same core
$ nucleus sql ./mydb -c "CREATE TABLE t (id INT PRIMARY KEY, name TEXT)"
# serve it — nucleus protocol, and PostgreSQL's too
$ nucleus server ./mydb --pg-compat
nucleus 0.1.0 listening on 127.0.0.1:20035 (nucleus protocol) and 127.0.0.1:5432 (PostgreSQL compatibility) …Get the key-value contract right, and everything above it can grow — or move onto a cluster — without a rewrite. The pattern behind FoundationDB and CockroachDB, built from the ground up.
An ordered, transactional key-value engine: a crash-safe copy-on-write B+tree, a write-ahead log and MVCC with snapshot and serializable isolation. Everything else is built on this contract.
A PostgreSQL-like dialect mapped onto keys and values — joins of every kind, CTEs, foreign keys, a rich type system and a cost-based optimizer.
A document model on the same core, sharing the same transactions — no second engine, no second set of guarantees.
The local core swapped for a partitioned, Raft-replicated one. The layers above keep the same contract, so they do not change.
The core and the SQL layer are here, along with the things a real deployment needs around them.
MVCC with snapshot and serializable isolation, a write-ahead log and a crash-safe copy-on-write B+tree underneath every model.
Its own protocol and the ncsql shell — and with --pg-compat, psql and PostgreSQL drivers connect as they are.
Tables stored as compressed column segments; scans, filters and aggregates run in batches through SIMD kernels — AVX2, AVX-512, NEON — on every core.
A built-in Model Context Protocol server. Comments explain the schema, errors come with a hint, and the dialect is documented for models.
Users, roles, privileges and row-level security. SCRAM-SHA-256, TLS and client certificates, OpenID Connect, LDAP and a hash-chained audit log.
Results stream a batch at a time or arrive as columns — directly into numpy, Arrow, pandas and polars. COPY and load bring data in.
Every list is a registry. Types, operators, orderings and casts are modules; PostgreSQL compatibility is one of them.
Link it into an application like SQLite, or run it as a server. One engine, the same guarantees either way.
Query time relative to PostgreSQL — lower is faster. Every result identical to PostgreSQL's.
PostgreSQL = 1.00×. Method and every query in docs/benchmarks.md.
Until the first release, build it from source — the toolchain installs itself.
$ git clone https://github.com/davidsarosi92/nucleus.git
$ cd nucleus && cargo build --release
$ ./target/release/nucleus --help