Rust

SecantusDB Rust DB

A whole second server, written in Rust from the wire up — dispatch, cursors, change streams, and WiredTiger storage — with no Python in the request path. Same wire protocol, same conformance gauges, a single standalone binary.

Why a second engine in Rust

The pure-Python server is the reference — the broadest feature surface and the easiest to read and extend. The Rust server is the same database with a different runtime underneath, built for speed and standalone deployment.

One standalone binary

The Rust server ships as a single executable with WiredTiger statically linked — secantusd-rs. No interpreter, no virtualenv, no system Mongo. Drop it in a container or a CI image and run.

No Python in the request path

Wire parsing, command dispatch, cursors, the operator engines, and storage are all pure Rust. The GIL never touches a query, and the accept loop runs on a native thread.

Same wire protocol

It answers the same OP_MSG handshake, CRUD, aggregation, and change-stream commands. Every driver that talks to the Python server talks to the Rust server unchanged.

Same conformance bar

The unmodified driver-conformance gauges run against the Rust server too — the same upstream suites the driver maintainers run against a real mongod. It passes 99.5% of pymongo's own test suite, level with the Python server; the feature comparison maps both servers against real MongoDB, feature by feature.

Real WiredTiger storage

The same C storage engine MongoDB ships with, linked into the binary. B-trees, durability, write-ahead logging — identical on-disk semantics to the Python server.

Embeddable from Python too

A thin lifecycle handle (start / stop / address) runs the Rust accept loop in-process on a GIL-released thread; pymongo connects over real TCP. Launch it from a test, get a Rust server.

Measured, not promised

Six workloads, median of five runs, end-to-end through pymongo on on-disk WiredTiger — real mongod as the reference. The Rust server runs at 2.1×–4.5× of mongod per operation, and ~2.7×–5.2× faster than the Python server workload-for-workload.

WorkloadmongodRust server×mongod
insert (10k docs)55.6 ms118.8 ms2.1×
find indexed range4.3 ms10.1 ms2.4×
find full scan7.7 ms34.8 ms4.5×
update_many (half)35.2 ms93.0 ms2.6×
aggregate $group5.8 ms24.6 ms4.3×
delete_many (half)21.6 ms80.5 ms3.7×

Apple Silicon, dataset of 10,000 small docs, every number includes the wire + driver overhead a real client pays. Full benchmark & methodology →

Get it

Two ways to run the Rust server — bundled in the Python package, or as a prebuilt standalone binary.

Bundled in the wheel

The secantus wheel ships the Rust server as the secantusd-rs command, alongside the pure-Python secantusdb.

pip install SecantusDB
secantusd-rs --port 27017 --storage-path ./data

Standalone binary

Prebuilt static-WiredTiger archives are published on GitHub Releases (Linux x86_64 and macOS arm64) — no Python at all. Look for the secantusdb-v<version> tags; each archive ships with a .sha256 checksum.

# download + extract from the releases page,
# then run the secantusd-rs binary:
./secantusd-rs --port 27017 --storage-path ./data

Current binary release →  ·  all binary releases

Python or Rust?

Same database, same wire protocol, same storage. The runtime is the choice.

 Python serverRust server
Request pathPure PythonPure Rust
Best forHackability, the widest feature surface, the referenceSpeed and a standalone, dependency-free binary
How you run itpip install SecantusDBSecantusDBServer(...)secantusd-rs binary (bundled in the wheel or from Releases)
Python required at runtimeYesNo
Storage engineWiredTigerWiredTiger
Wire protocol & driversMongoDB OP_MSG — all driversMongoDB OP_MSG — all drivers
Embeddable in PythonNative (in-process)Yes — in-process on a GIL-released thread

Rust-server documentation: Installation · Running the daemon · Embedded in Python · Backup & PITR · Conformance · Feature comparison