In active developmentv0.1 · MIT

One core.
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.

KV CORESQLDOCUMENTDISTRIBUTED
shippedon the roadmap
~/mydb
# 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) …
Architecture

Built in layers, around a single core.

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.

  1. 00shipped

    Key-value core

    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.

  2. 01shipped

    SQL

    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.

  3. 02planned

    Documents

    A document model on the same core, sharing the same transactions — no second engine, no second set of guarantees.

  4. 03planned

    Distributed

    The local core swapped for a partitioned, Raft-replicated one. The layers above keep the same contract, so they do not change.

What is inside today

A serious database, not a sketch.

The core and the SQL layer are here, along with the things a real deployment needs around them.

Transactions first

MVCC with snapshot and serializable isolation, a write-ahead log and a crash-safe copy-on-write B+tree underneath every model.

Speaks PostgreSQL

Its own protocol and the ncsql shell — and with --pg-compat, psql and PostgreSQL drivers connect as they are.

Columnar analytics

Tables stored as compressed column segments; scans, filters and aggregates run in batches through SIMD kernels — AVX2, AVX-512, NEON — on every core.

Ready for AI

A built-in Model Context Protocol server. Comments explain the schema, errors come with a hint, and the dialect is documented for models.

Identity & access

Users, roles, privileges and row-level security. SCRAM-SHA-256, TLS and client certificates, OpenID Connect, LDAP and a hash-chained audit log.

Straight into dataframes

Results stream a batch at a time or arrive as columns — directly into numpy, Arrow, pandas and polars. COPY and load bring data in.

Modular by design

Every list is a registry. Types, operators, orderings and casts are modules; PostgreSQL compatibility is one of them.

Embedded or server

Link it into an application like SQLite, or run it as a server. One engine, the same guarantees either way.

Drivers
  • Rust
  • C
  • C++
  • Python
  • JavaScript / TypeScript
  • Java
Benchmarks

Measured against PostgreSQL.

Query time relative to PostgreSQL — lower is faster. Every result identical to PostgreSQL's.

0.24×
ClickBench
one million rows · column tables
0.47×
TPC-H, scale factor 1
geometric mean · column tables
1.11×
TPC-H, scale factor 1
geometric mean · row tables

PostgreSQL = 1.00×. Method and every query in docs/benchmarks.md.

Get nucleus

Binaries are on their way.

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