Rustegon
Quick start

R1 preview · single node · Apache-2.0

The PostgreSQL of NoSQL.

Rustegon is a document database written in Rust that puts correctness first: every transaction is ACID and SERIALIZABLE by default, every acknowledged commit is on disk, and backup and restore is one command.

  • SERIALIZABLE by default
  • fsync before every acknowledgement
  • Backup, PITR and dump built in

Why Rustegon

Correctness you do not have to configure.

The guarantees are the defaults. You opt out of safety on purpose, never into it by accident.

SERIALIZABLE by default

Committed transactions behave as if they ran one after another, so anomalies such as write skew cannot happen. Multi-document, multi-collection and multi-database transactions are supported, and every statement outside a transaction runs as an implicit transaction with the same guarantees. SNAPSHOT and READ COMMITTED are available per transaction when you choose them.

Durable when acknowledged

On a single node, a commit is acknowledged only after it is synced to disk, so it survives a process crash, an operating-system crash and a power cut, as long as the drive honours fsync. It does not survive the loss of the disk itself: that is what backups are for today, and what replication adds in R2.

Crash-tested at every step

The storage engine is tested by crashing it at every single I/O operation and checking what survives. Its 24-hour crash campaign ran 171,700 workloads with zero failures. Formats carry checksums, and a corrupted file is reported, never silently read.

Deterministic simulation testing

Every disk, network and clock access goes through one set of interfaces, so the whole database also runs inside a seeded simulator that injects crashes, I/O errors, power cuts and pauses, then checks the histories for isolation anomalies. Each failure prints its seed and replays exactly. The simulator has already caught a real durability bug before any release.

Features

Everything a single node needs, in one binary.

The R1 preview is a complete single-node database. Each card names the release that brings it.

Available · R1 Implemented · not yet published Coming in R2 Coming in R3
Available · R1

RGQL, a query language built for documents

Readable statements for reads, writes and DDL, with parameters that are never spliced into the text, an equivalent structured form for drivers, syntax errors with line and column, EXPLAIN and EXPLAIN ANALYZE, server-side cursors with continuation tokens, deadlines and cancellation.

FROM shop.orders AS o
WHERE o.status IN ['paid', 'shipped'] AND o.total >= $min
SELECT o._id, o.total, o.customer.name AS customer
ORDER BY o.total DESC
LIMIT 50;

UPDATE shop.orders SET status = 'paid' WHERE _id = 42 RETURNING NEW;

CREATE INDEX idx_status_total ON shop.orders (status ASC, total DESC);
EXPLAIN FROM shop.orders WHERE status = 'paid';
Available · R1

Documents, with a schema only if you want one

Ordered fields with exact types: int64, decimal128, ObjectId, dates, binary and more, stored in the RDoc binary format and exchanged losslessly as extended JSON. Immutable _id, server-maintained revisions and timestamps, rich update operators. Optional JSON Schema validators report the failing JSON pointer.

Available · R1

Indexes and a cost-based planner

Single-field, compound, multikey, unique, sparse, partial and wildcard indexes, updated in the same transaction as the data. Builds run online and resume after a restart. The planner chooses access paths from collected statistics, and index usage is reported.

Available · R1

Transactions that drivers retry for you

MVCC with hybrid logical clocks. Interactive transactions span requests; every driver offers a withTransaction helper that retries on conflicts. An ambiguous commit is resolved by asking the server for the transaction's status, never by running it twice.

Available · R1

Backup and restore, one command each

Online, consistent backups while writes continue; verification; local hard-link snapshots; point-in-time recovery from the archived log; logical dump and restore in extended JSON. Destinations: local or NFS paths and S3-compatible storage. Encrypted data stays encrypted in the backup.

Available · R1

Secure without default passwords

No default credentials: the first administrator is created at initialisation (the installers' admin / admin must be changed at the first sign-in and works only from the local machine until then). SCRAM-SHA-256, API keys and X.509 client certificates; role-based access control with built-in and custom roles down to a single collection; a hash-chained audit log; rate limiting and account lockout; AES-256-GCM encryption at rest.

Available · R1

TLS when you need it, mandatory in a cluster

A single node starts in plain text for local use and warns about it. rustegon init --tls creates a CA and node certificates and turns on TLS 1.3; certificates reload without a restart. Clusters will always require TLS and mutual TLS between nodes.

Available · R1

Its own storage engine, in Rust

A purpose-built LSM engine: leveled compaction, LZ4 or Zstd block compression, checksums on every block and record, encryption hooks, checkpoints. No embedded third-party storage engine.

Available · R1

Observable from day one

An OpenMetrics endpoint for Prometheus, liveness and readiness probes, and structured JSON logs with rotation in which secrets are always redacted.

Available · R1

gRPC and REST

Versioned protobuf contracts (rustegon.v1) for drivers, and a REST/JSON API described by OpenAPI 3.1 for tools and the web console.

Available · R1

Docker image and archives

A non-root Docker image with a read-only root file system for amd64 and arm64, and archives for Windows x86_64, Linux x86_64 and Linux aarch64 with checksums. The image is on Docker Hub as pegostar/rustegon; images and archives are unsigned development builds.

Compare

Relational-grade guarantees, document-shaped data.

How the defaults of Rustegon R1 line up with a relational database, then feature by feature with MongoDB, RavenDB and Apache Cassandra. Features and guarantees only: there is no speed comparison here.

Comparison of guarantees and features: Rustegon R1 and PostgreSQL
Property Rustegon R1 PostgreSQL
Guarantees
Default isolation level SERIALIZABLE READ COMMITTED; SERIALIZABLE on request
Transactions across documents or rows Yes, across collections and databases Yes, across rows and tables
Commit durable when acknowledged, by default Yes, synced to disk first Yes (synchronous_commit = on)
Online backup and point-in-time recovery built in Yes, plus logical dump (single node) Yes (base backup, WAL archiving, pg_dump)
Data and operations
Data model Documents; optional JSON Schema validators Tables with a schema; JSON in jsonb columns
Query language RGQL and a structured form for drivers SQL
Replication with automatic failover Coming in R2 (Raft) Streaming replication built in; failover through external tools
Automatic sharding Coming in R3 Not in the core server (extensions exist)
Licence Apache-2.0 PostgreSQL Licence (open source)
  • Yes
  • Partly or on request
  • Planned for Rustegon
  • Not in the core product

As of 2026-11. PostgreSQL column from the PostgreSQL documentation. Rustegon items marked R2 or R3 are not available yet.

Rustegon, MongoDB, RavenDB and Cassandra

Each product is described from its own official documentation, for the version in the column header. Rustegon cells name the release that brings each item: only R1 is available today.

Features and guarantees of Rustegon, MongoDB 9.0, RavenDB 7.2 and Apache Cassandra 5.0
Property Rustegon MongoDB 9.0 RavenDB 7.2 Apache Cassandra 5.0
Data and transactions
Data model R1 Documents with exact types (int64, decimal128, dates…); optional JSON Schema validators Documents with a flexible schema; optional schema validation Schemaless documents, plus counters, attachments, time series and revisions Partitioned tables with a schema defined in CQL
Transactions R1 ACID across documents, collections and databases on a nodeR3 Distributed transactions across shards Single-document operations are atomic; multi-document ACID transactions across collections, databases and shards ACID transactions within one request; optional cluster-wide transactions (Raft) Atomic and isolated within one partition; lightweight transactions (Paxos compare-and-set); no multi-partition transactions in 5.0
Isolation R1 SERIALIZABLE by default; SNAPSHOT or READ COMMITTED per transaction Snapshot isolation for transactions that use read concern "snapshot"; the default read concern is "local" Serializable for writes, snapshot for reads; indexes are eventually consistent (BASE) Isolation only within a single partition
Consistency R1 One node: every read sees all committed writesR2 Raft majority writes, linearizable reads by defaultPlanned Follower and bounded-staleness reads Read and write concerns per operation, write concern "majority" by default; causally consistent sessions Asynchronous replication between nodes, so conflicts are possible; cluster-wide transactions favour consistency Tunable per operation (ONE, QUORUM, ALL…); replicas converge eventually
Query language R1 RGQL and a structured form for driversR2 Aggregation pipeline MongoDB Query API and aggregation pipeline RQL, a SQL-like query language CQL
Secondary indexes R1 Single-field, compound, multikey, unique, sparse, partial and wildcard, updated in the same transaction as the data Single-field, compound, multikey, text, geospatial, wildcard and hashed User-defined static indexes and automatic indexes created by the query optimizer, updated asynchronously Storage-Attached Indexing (SAI) and legacy secondary indexes, consistent with their local replica
Scale and operations
Replication and high availability R2 Three-node Raft replication with automatic failover Replica sets with automatic failover by election Database group: every member holds a full copy, multi-master replication Masterless replication with a configurable replication factor; no single point of failure
Sharding and scale-out R3 Automatic sharding Native sharding Sharding since 6.0; shards on several nodes need the Enterprise licence Partitioning on a consistent-hashing token ring with virtual nodes
Multiple data centres Planned Multi-region placement (extension tier, scope open) Replica set members across data centres; zone sharding External replication and Hub/Sink replication to other sites Replication factor per data centre (NetworkTopologyStrategy)
Backup and point-in-time recovery R1 Online backup, point-in-time recovery and logical dump, built in (single node)R3 Cluster-wide and incremental backups Community: mongodump and file-system snapshots; point-in-time recovery with Cloud Manager or Ops Manager (Enterprise Advanced) Scheduled full and incremental backups to local, S3, Azure, Google Cloud or FTP targets; snapshot backups need Enterprise Snapshots and incremental backups with nodetool (incremental off by default); point-in-time restore through commit log archiving
Security
Authentication R1 SCRAM-SHA-256, API keys, X.509 client certificatesR3 OIDC sign-in Community: SCRAM and X.509; Enterprise adds Kerberos, LDAP and OIDC X.509 client certificates Password authentication available, off by default
TLS R1 TLS 1.3 with rustegon init --tls; a single node starts in plain text and warnsR2 Mandatory in a cluster, mutual TLS between nodes Supported, set with net.tls.mode HTTPS; a secure server is required for encryption at rest and the audit log Client and node-to-node TLS, off by default
Encryption at rest R1 AES-256-GCMR3 Key management services Enterprise and Atlas; Queryable Encryption and client-side field-level encryption (explicit mode in Community) Supported with a licence that includes it, on a secure server Not covered by the 5.0 security documentation
Access control R1 Built-in and custom roles, down to a single collection Role-based access control, off until enabled Cluster clearances and per-database access levels (Admin, Read/Write, Read Only) Roles and permissions, off by default
Audit log R1 Hash-chained audit log Enterprise and Atlas (M10 and larger) On a secure server Built-in audit logging, configurable
Ecosystem
Licence R1 Apache-2.0 Community: SSPL; commercial Enterprise edition Source under AGPLv3; Community licence with limits, Professional and Enterprise licences Apache-2.0
Drivers R1 .NET and JavaImplemented · not yet published Node.js, Python, Go and Rust Official drivers for 13 languages, including C, C++, C#, Go, Java, Kotlin, Node.js, PHP, Python, Ruby, Rust and Scala Official clients for .NET, Java, Node.js, Python, Go, PHP, C++ and Ruby Client drivers for many languages listed in the documentation
Graphical console R1 Web console built into the server at /ui MongoDB Compass, a free desktop application RavenDB Studio, a web UI built into the server cqlsh shell; graphical tools from third parties
Deployment R1 Docker image and archives for Windows and Linux, unsigned development builds; no managed service Packages for Linux, Windows and macOS, Docker image, Kubernetes operator; MongoDB Atlas managed service Linux, macOS, Windows, containers, Raspberry Pi; RavenDB Cloud managed service Tarball, Debian and RPM packages, Docker image

What each release adds

Capabilities of Rustegon releases R1, R2 and R3
Capability R1 single node R2 high availability R3 scale-out
ACID transactions, SERIALIZABLE by defaultYesYesYes
RGQL, secondary indexes, validatorsYesYesYes
TLS, SCRAM, API keys, X.509, RBAC, audit, encryption at restYesYesYes
Backup, PITR and dump of a single nodeYesYesYes
Web console, .NET and Java drivers, Docker image and archivesYesYesYes
Three-node replication with automatic failoverNoYesYes
Aggregation pipeline and bulk writesNoYesYes
TTL, change data capture, revisions, document countersNoYesYes
Sharding and distributed transactionsNoNoYes
Cluster-wide and incremental backupsNoNoYes
Key management services and OIDC sign-inNoNoYes

Measured

The storage engine, measured.

Only numbers recorded in bench/results/. They describe the storage engine layer on a development laptop: not an end-to-end database benchmark, and not a comparison with any other product.

Point reads, one thread: latency percentiles

BM-STO-01: random point gets on 1 Mi keys of 1 KiB with the engine block cache disabled. Microseconds, lower is better.

Point reads, 16 threads: latency percentiles

BM-STO-01 with 16 reader threads. Microseconds, lower is better.

Point reads per second

BM-STO-01 with 1 and 16 reader threads. Higher is better.

Write batches: user data per second

BM-STO-02: batches of 16 values of 1 KiB, flush and compaction included. Sequential keys, and a steady-state run with 8 Mi random keys. Bar = median, line = range of three runs.

Range scan

BM-STO-03: a full scan of 1 Mi keys of 1 KiB, one thread.

Drivers

One connection string, every language.

Six official drivers. Each connects with host, port, user, password and database, passes the same conformance suite with results identical to the others, and maps the same error codes. The same task in each language: insert an order, read the paid ones, mark it as shipped in a transaction.

rustegon://admin:<password>@localhost:7700/<database>Plain text on a default single node; add ?tls=true&tlsCaFile=ca.crt for a node with TLS.
Available · R1Rustegon.Drivernet10.0READMESpecificationnuget.org
dotnet add package Rustegon.Driver --version 0.1.0
using Rustegon.Driver;

// A single node started with its defaults speaks plain text (ADR-034).
await using var client = new RustegonClient(
    $"rustegon://admin:{Uri.EscapeDataString(password)}@localhost:7700/shop");
IRustegonCollection<RDocument> orders = client.GetDatabase().GetCollection<RDocument>("orders");

await orders.InsertOneAsync(new RDocument { { "_id", 42 }, { "status", "paid" }, { "total", 120 } });

await foreach (RDocument o in orders.Find(Filter.Eq("status", "paid")).Limit(50))
    Console.WriteLine(o);

// The callback may run several times on retryable conflicts.
await client.WithTransactionAsync(async (txn, ct) =>
{
    IRustegonCollection<RDocument> t = txn.Collection<RDocument>("shop.orders");
    await t.UpdateOneAsync(Filter.Id(42), Update.Set("status", "shipped"), cancellationToken: ct);
});

Web console

A console that ships inside the server.

Open /ui on any node: browse and edit documents, write RGQL with highlighting, read query plans, manage indexes, users, roles and API keys, take backups and snapshots, and change settings. Light and dark themes, English and Italian, and accessibility checked against WCAG 2.2 AA.

Architecture

From the driver to the disk.

One process, rustegond, serves gRPC on port 7700 and HTTP on port 7780. Every request is authenticated and authorised before it reaches the query engine, and every write goes through one transaction layer into the storage engine.

Rustegon single-node architecture Six drivers.NET · Java · Node.js · Python · Go · Rust rustegon CLIinit · shell · backup · users Browserweb console · tools rustegond gRPC :7700 HTTP :7780 · REST · /ui · /metrics SecurityTLS 1.3 · SCRAM-SHA-256 · API keys · X.509 · RBAC · audit · rate limits Query engineRGQL parser → cost-based planner → executor · cursors Indexes · validatorssame transaction as the data TransactionsMVCC · hybrid logical clock · SERIALIZABLE · SNAPSHOT · READ COMMITTED Storage engine (LSM)memtable · SST · leveled compaction · LZ4 / Zstdchecksums · AES-256-GCM · checkpoints Log storegroup commit · fsyncreplay after a crash Data directorylocal disk · optional encryption at rest Backupslocal / NFS · S3 · PITR archive · dump Raftreplicas · R2 Rustegon single-node architecture Six drivers · CLI · browser.NET · Java · Node.js · Python · Go · Rust rustegond gRPC :7700 HTTP :7780 SecurityTLS · SCRAM · API keys · X.509RBAC · audit Query engineRGQL → planner → executorIndexes · validators TransactionsMVCC · HLCSERIALIZABLE Storage engine (LSM)SST · compaction · LZ4 / ZstdAES-256-GCM · checkpoints Log storegroup commit · fsyncreplay after a crash Data directorylocal disk BackupsNFS · S3 · PITR
Single-node view of R1. Raft replication arrives with R2, sharding and distributed transactions with R3. Details in system-overview.md.

Roadmap

Correct on one node first. Then highly available. Then everywhere.

Releases follow DEC-019: depth before breadth. Only R1 is available today, as a preview.

  1. Now · preview

    R1 — single node

    A complete single-node database. All its milestones are complete; the 24-hour soak test that closes the release is still to run.

    • M0–M3 foundation, storage engine, MVCC transactions, query engine and indexesdone
    • M4 server, gRPC and REST APIs, securitydone
    • M13a backup, restore, PITR and dumpdone
    • M11 .NET and Java driversdone
    • M12 web console, core screensdone
    • M14a Docker image, archives, MSI and DEB/RPM packages (unsigned dev builds)done
    • 24-hour soak test on one nodepending
  2. Coming in R2

    R2 — high availability

    Three-node clusters that survive the loss of a node.

    • M5 Raft replication, automatic failoverplanned
    • M7a aggregation pipeline, bulk writesplanned
    • M8a TTL, change data capture, revisions, document countersplanned
  3. Coming in R3

    R3 — scale-out

    Data spread across many nodes, with the same transactions.

    • M6 sharding, distributed transactions with parallel commitplanned
    • M13b cluster and incremental backups, KMS, OIDCplanned
  4. Planned

    Extensions and 1.0

    An extension tier is specified; which parts enter 1.0 is still open (PD-035).

    • M7b–M10 joins, full-text, geospatial and vector search, automatic indexing, wide-column tables, time series, multi-regionplanned
    • M14–M15 signed packages and repositories, Windows service, hardening, published benchmarksplanned
  • Done
  • Pending
  • Planned

Drivers: .NET and Java are part of R1 and are published on nuget.org and Maven Central; the Node.js driver is published on npm and the Python driver on PyPI. The Go and Rust drivers are implemented and pass the shared conformance suite with results identical to .NET and Java (107 of 107 tests), but are not yet published to package registries.

Download

Install Rustegon on your machine.

Installers for Windows, packages for Ubuntu and Fedora, and archives for every platform, each with its SHA-256 checksum.

Packages are not published yet

No packages have been built for this page. Build them from the repository with cargo xtask dist --site, or start right away with Docker or an archive in the Quick start.

Quick start

A running node and its console in a few minutes.

Pick Docker or a release archive. Passwords never go on the command line, and there is no default password.

  1. Pull the image from Docker Hub (amd64 and arm64).

    docker pull pegostar/rustegon:0.1.0
  2. Create a secret file with the administrator password (or write your own, at least 12 characters).

    openssl rand -base64 24 > admin_password.txt
  3. Save this as docker-compose.yml (it ships as packaging/docker/compose.yaml):

    services:
      rustegon:
        image: pegostar/rustegon:0.1.0
        ports: ["7700:7700", "7780:7780"]
        volumes: ["rustegon-data:/var/lib/rustegon"]
        environment:
          RUSTEGON_MODE: single-node
          RUSTEGON_INITIAL_ADMIN_PASSWORD_FILE: /run/secrets/admin_password
        secrets: [admin_password]
        stop_grace_period: 90s
        read_only: true
        tmpfs: ["/tmp"]
    secrets:
      admin_password: { file: ./admin_password.txt }
    volumes:
      rustegon-data: {}
  4. Start it and wait until it is healthy:

    docker compose up -d
    docker compose ps

Open the console

Browse to http://localhost:7780/ui/ and sign in as admin with the password from the file. Then change the password and delete the file.

Connect a driver

Use rustegon://admin:<password>@localhost:7700/<database>.

Turn on TLS

Plain text is fine on your own machine. Elsewhere, set RUSTEGON__SECURITY__TLS: "true" in Docker or run rustegon init --tls; drivers then add ?tls=true&tlsCaFile=ca.crt.

Open source

Free to use, free to download.

Rustegon is released under the Apache License 2.0. Use it for any purpose, commercial or not, and do whatever you like with it.

The source code is on GitHub: github.com/pegostar/rustegon

Only if you feel like it, buy me a coffee.

Contact

Write to the author.

For information or questions, write to info@rustegon.com

Sponsors

Thanks to those who support the project.