PyCon Ireland 2026
SecantusDB
Open Source MongoDB compatible database in Rust (with a little Postgres on the side)
Joe Drumgoole · secantusdb.com
Hi, I'm Joe. This is the story of building a database: seven months, two languages, two wire protocols.
SecantusDB is two Rust servers: one speaks the MongoDB wire protocol, one speaks PostgreSQL's. Both store data in WiredTiger, the storage engine MongoDB itself ships. It started as a Python prototype, which is why this is a PyCon talk.
Timing plan for the 30-minute slot: about 24 minutes of talk and the rest for questions.
Time: ~1 min
Try it
One line to install
pip install SecantusDB
The MongoDB server, prebuilt for Linux x86_64 and macOS arm64.
crates.io cargo install secantus-mdb --version 0.5.3-beta.198
GitHub Releases Standalone secantusd-mdb binaries for Linux, macOS and Windows
Say the pip line and move on; the rest is for the photo.
PyPI: nothing compiles on pip install; the wheel carries the prebuilt server. crates.io: cargo install builds WiredTiger, so it needs a C toolchain and CMake, and the crate is a pre-release, so cargo needs the exact --version. GitHub Releases: download, untar, run.
Check for a newer release the day before and update the version here.
Time: ~1 min
What it looks like
Start a database in one line — or run it as a server
# embedded, from Python from secantusdb import MongoServerimport pymongowith MongoServer() as server: db = pymongo.MongoClient(server.uri).app db.users.insert_one({"name": "Ada"})
# standalone, like mongod $ secantusd-mdb --port 27017 \ --storage-path ./data $ mongosh mongodb://127.0.0.1:27017
Show this early so the room knows what we're talking about.
Left: embedded. After the pip install, MongoServer() starts the MongoDB server on a free port and hands you a URI. Any pymongo code works against it unchanged.
Right: the same binary runs standalone, wherever you'd run mongod, and mongosh connects with no flags or plugins.
Time: ~1½ min
What already exists
One protocol every driver already speaks
MongoDB wire protocol
OP_MSG over TCP
→
→
secantus-core
query, update, aggregate
→
secantus-storage
WiredTiger
The drivers exist: every official MongoDB driver speaks the same wire protocol. We run the official drivers' own test suites unmodified: Python, Node.js, Rust, Go and C# on the slide, plus Java, Kotlin, C, C++, Ruby and PHP. Their authors have already written thousands of tests describing what a server must do.
The engine exists: WiredTiger gives us checkpoints, transactions and durability. The gap is the server in between, and all the hard work is in being faithful.
Walk the stack, left to right: OP_MSG arrives over TCP; secantus-wire turns it into commands; secantus-core runs the query, update and aggregation engines; secantus-storage talks to WiredTiger.
Time: ~2½ min
Act two · Conformance gauges
Borrow other people’s test suites — unmodified
13 MongoDB driver test suites
0 edits to them
Kotlin
mongo-kotlin-driver
PHP
mongo-php-library mongo-php-driver
A hang is a failure, never a skip.
Driver authors have already written thousands of tests describing what a server must do. We run the official MongoDB drivers' own test suites, thirteen of them across eleven languages, each a git submodule with zero edits, run weekly against the Rust server.
A hang is a failure, never a skip. The Go gauge reported 100% for months, because a hung test killed the run at 476 of 481 tests before the failures were counted. Now we count tests started against tests that reported.
Time: ~1½ min
Conformance gauges · Rust MongoDB server
8,833 upstream driver tests pass, unmodified
95% 96% 97% 98% 99% 100% mongo-cxx-driver mongo-cxx-driver: 100.0% pass rate, 892 tests passed 100.0% · 892 mongo-java-driver mongo-java-driver: 100.0% pass rate, 496 tests passed 100.0% · 496 mongo-kotlin-driver mongo-kotlin-driver: 100.0% pass rate, 340 tests passed 100.0% · 340 mongo-php-driver mongo-php-driver: 100.0% pass rate, 254 tests passed 100.0% · 254 mongo-csharp-driver mongo-csharp-driver: 100.0% pass rate, 228 tests passed 100.0% · 228 mongo-rust-driver mongo-rust-driver: 100.0% pass rate, 105 tests passed 100.0% · 105 mongo-php-library mongo-php-library: 99.9% pass rate, 2,197 tests passed 99.9% · 2,197 mongo-c-driver mongo-c-driver: 99.7% pass rate, 791 tests passed 99.7% · 791 mongo-node-driver mongo-node-driver: 99.7% pass rate, 357 tests passed 99.7% · 357 mongo-ruby-driver mongo-ruby-driver: 99.6% pass rate, 258 tests passed 99.6% · 258 pymongo pymongo: 99.5% pass rate, 1,206 tests passed 99.5% · 1,206 pymongo (async) pymongo (async): 99.4% pass rate, 1,111 tests passed 99.4% · 1,111 mongo-go-driver mongo-go-driver: 98.0% pass rate, 598 tests passed 98.0% · 598
The MongoDB driver gauges against the Rust server: 8,833 upstream tests pass. The number after each rate is tests passed.
Six suites are at 100%: C++, Java, Kotlin, the PHP extension, C# and Rust. The lowest is Go at 98.0%: 598 pass, 12 fail. pymongo runs the broadest in-scope set, 1,206 passing at 99.5%.
The failures are known divergences or sit outside single-node scope: text and hashed indexes, server-side JavaScript, tests that assume a multi-node cluster.
Time: ~1 min
Act two · The gaps
What secantusd-mdb doesn’t do
Not supported Server-side JavaScript: $where, $function, $accumulator, mapReduce Text search: text indexes and $text Hashed indexes Queryable Encryption collections Auth beyond SCRAM and X.509: no LDAP, Kerberos, AWS IAM, OIDC
Out of scope: one node, by design Replica sets with real members: no secondaries, no elections Sharding: no mongos, no config servers Atlas Search and Vector Search: Atlas-only, as on mongod
Be explicit about the gaps; every one is a clean, named error, never a silent wrong answer.
Not supported: anything that runs JavaScript on the server, since we ship no JS runtime (MongoDB itself deprecated $where and mapReduce); full-text search and text indexes; hashed indexes; Queryable Encryption; and authentication beyond SCRAM and X.509.
Out of scope by design: it is a single-node server. It reports itself as a one-member replica set so change streams work, but there are no secondaries and no elections, and no sharding. Atlas Search and Vector Search are Atlas-only; a plain mongod refuses them the same way.
If asked what does work: wildcard indexes, $median and $percentile, time-series, capped and clustered collections, geo with $geoNear, $merge, views, transactions, change streams and the 8.0 bulkWrite command.
Time: ~1 min
Act two · How fast? Against mongod 8.0.38
1.2–3.6× mongod’s latency per operation
Rust server
2x 3x 4x mongod = 1x insert (10k docs) Rust server — 1.5x mongod 1.5x find indexed range Rust server — 1.3x mongod 1.3x find full scan Rust server — 1.2x mongod 1.2x find filtered scan Rust server — 1.4x mongod 1.4x update_many (half) Rust server — 1.2x mongod 1.2x aggregate $group Rust server — 2.8x mongod 2.8x aggregate multi-stage Rust server — 2.6x mongod 2.6x delete_many (half) Rust server — 3.6x mongod 3.6x change-stream drain Rust server — 1.4x mongod 1.4x
Per-operation latency as a multiple of mongod 8.0.38's: the median of 15 interleaved repetitions on a DigitalOcean droplet, 18 November 2026. Both run as a single-node replica set, so a default write waits for the journal on both.
The same WiredTiger library sits under both, so every gap is in the layers above storage. Reads, update_many and the change-stream drain are within 1.2–1.4×; delete_many (3.6×) and aggregation (2.6–2.8×) are where the work is.
If asked: the benchmark ran against 8.0.38; correctness is measured against 8.2.
Time: ~1½ min
Under load
Scaling with concurrent writers
mongod Rust server Rust server — async stack
1x 2x 3x 1 2 4 8 concurrent writers mongod — 1 writer: 1.00x its single-writer rate mongod — 2 writers: 1.66x its single-writer rate mongod — 4 writers: 2.62x its single-writer rate mongod — 8 writers: 3.35x its single-writer rate Rust server — 1 writer: 1.00x its single-writer rate Rust server — 2 writers: 1.54x its single-writer rate Rust server — 4 writers: 2.11x its single-writer rate Rust server — 8 writers: 2.57x its single-writer rate Rust server (async + non-logged oplog) — 1 writer: 1.00x its single-writer rate Rust server (async + non-logged oplog) — 2 writers: 1.63x its single-writer rate Rust server (async + non-logged oplog) — 4 writers: 2.11x its single-writer rate Rust server (async + non-logged oplog) — 8 writers: 2.34x its single-writer rate mongod 3.4x Rust 2.6x async 2.3x
Throughput as writers are added, relative to each server's own single-writer rate. mongod reaches 3.4× at eight writers, our default to 2.6× (10.2k docs/s); in absolute terms mongod is 1.5× ahead at one writer and 1.9× at eight. The solid lines are both fully durable.
The dashed line is the opt-in async stack: it starts 1.9× higher than our default, but a hard crash can lose the oplog tail since the last checkpoint; the data itself stays durable.
The benchmarking lesson: over a real network, one server droplet and two client droplets, we reach 0.51× of mongod's throughput. The same build first scored 0.14×, which looked like a huge regression. It wasn't: our server, as a replica-set primary, waits for the journal on every default write, and the benchmark had compared it against a standalone mongod that never waits. Put mongod in the same mode and it loses about half its throughput. Compare like with like.
Time: ~1½ min
Act three · The second protocol
Then we did it again for PostgreSQL
Extended query protocol, binary formats
Transactions, COPY, LISTEN / NOTIFY
The catalogs psql and SQLAlchemy read
Always the most faithful model
Then we did it all again for PostgreSQL: the extended query protocol, prepared statements and portals, binary formats; transactions, savepoints, two-phase commit, COPY, LISTEN and NOTIFY; and the catalog tables psql and SQLAlchemy introspect.
The scope is set by what psycopg's own test suite reaches for. On 16 November, 5,670 psycopg tests passed and one failed; psycopg itself skips 117.
The rule: always the most faithful PostgreSQL model. Serializable isolation is ported from PostgreSQL's own predicate.c.
Time: ~1½ min
Act three · PostgreSQL conformance
13,954 upstream client tests pass
psycopg Python 99.9%
5,670 pass · 1 fail
SQLAlchemy Python dialect tests 100%
978 pass · 0 fail
pgx Go 99.7%
377 pass · 1 fail
pgjdbc Java 96.6%
6,929 pass · 242 fail
sqllogictest SQL corpus 42 / 60
files pass · 0 unexpected failures
pgtest CockroachDB wire tests 24 / 57
files pass · 17 to fix
The same idea as the MongoDB gauges: real clients' own test suites, unmodified, against the Rust PostgreSQL server. 13,954 tests pass across psycopg, SQLAlchemy, pgx and pgjdbc.
psycopg 99.9%, one failing async concurrency test. SQLAlchemy 100%. pgx , the Go driver, 99.7%. pgjdbc 96.6%: 240 of its 242 failures are one test class, AutoRollbackTest.
sqllogictest: 42 of 60 files pass end to end, with no unexpected failures; the other 18 are files where the corpus expects SQLite's behaviour and PostgreSQL differs too.
pgtest , CockroachDB's wire-protocol tests, is the weak spot: 24 of 57 files pass, 17 fail. That's the clearest list of PostgreSQL behaviour still to build.
Time: ~1 min
Act three · Architecture
Two protocols, one storage engine
→
MongoDB wire protocol
OP_MSG over TCP
→
→
secantus-core
query, update, aggregate
→
→
PostgreSQL wire protocol
extended query, COPY
→
secantus-pgplan
libpg_query parser, planner
→
secantus-pg
SQL executor: joins, aggregates, functions
→
secantus-storage
WiredTiger same tables, same files
The same picture as slide 6, with the PostgreSQL stream added underneath.
MongoDB: the drivers speak OP_MSG; secantus-wire turns it into commands; secantus-core runs the query, update and aggregation engines.
PostgreSQL: psycopg, pgjdbc, pgx and the rest speak the PostgreSQL wire protocol. libpg_query, PostgreSQL's own parser, parses the SQL; secantus-pgplan plans it; secantus-pg executes it: expressions, joins, aggregates, functions. It borrows only secantus-core's filter matcher and BSON ordering.
What is shared is the storage: secantus-storage over WiredTiger. A table created through SQL reads back as a collection in the MongoDB server. That is a hand-off, not concurrent serving: WiredTiger's file lock lets one server open a directory at a time.
Time: ~1½ min
Act four · Working with Claude Code
From prompts to plans to goals
→
Plans
agree the plan, then build
→
Goals
everything is a goal now
Free → Ultra in a couple of weeks
CLAUDE.md → skills one big file, broken up
How the way of working changed. It started manually, prompt by prompt. Then it moved to plans: agree a plan, then let Claude Code build it. Now everything is done as a goal, and a goal can run for days on end.
The bill followed: from the free plan to the Ultra plan over a couple of weeks.
The instructions grew up too. It started as one big CLAUDE.md. That is now broken into skills, each loaded only when the work needs it: releases, the backlog, probing against mongod, the website.
About three quarters of the commits carry a Claude co-author line (3,866 of 5,115 on 19 November).
Time: ~1½ min