PyCon Ireland 2026

SecantusDB

Open Source MongoDB compatible database in Rust
(with a little Postgres on the side)

Joe Drumgoole · secantusdb.com

Background

What is MongoDB

Why

Why Build a MongoDB Clone

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

What it looks like

Start a database in one line — or run it as a server

# embedded, from Python
from secantusdb import MongoServer
import pymongo

with 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

What already exists

One protocol every driver already speaks

Python

→

Node.js

→

Rust

→

Go

→

C#

→

Others

→

MongoDB wire protocol

OP_MSG over TCP

→

secantus-wire

commands

→

secantus-core

query, update, aggregate

→

secantus-storage

WiredTiger

Act one · The plan

How to Approach The Problem

  1. Build a complete server in Python, focus on correctness
  2. Rewrite the server in Rust to improve performance
  3. Make the Rust Server canonical, drop the Python version

Act two · Conformance gauges

Borrow other people’s test suites — unmodified

13MongoDB driver test suites
0edits to them

Python

pymongo

Python

pymongo (async)

Node.js

mongo-node-driver

Java

mongo-java-driver

Kotlin

mongo-kotlin-driver

Go

mongo-go-driver

Rust

mongo-rust-driver

C

mongo-c-driver

C++

mongo-cxx-driver

C#

mongo-csharp-driver

Ruby

mongo-ruby-driver

PHP

mongo-php-library
mongo-php-driver

A hang is a failure, never a skip.

Conformance gauges · Rust MongoDB server

8,833 upstream driver tests pass, unmodified

95%96%97%98%99%100%mongo-cxx-drivermongo-cxx-driver: 100.0% pass rate, 892 tests passed100.0% · 892mongo-java-drivermongo-java-driver: 100.0% pass rate, 496 tests passed100.0% · 496mongo-kotlin-drivermongo-kotlin-driver: 100.0% pass rate, 340 tests passed100.0% · 340mongo-php-drivermongo-php-driver: 100.0% pass rate, 254 tests passed100.0% · 254mongo-csharp-drivermongo-csharp-driver: 100.0% pass rate, 228 tests passed100.0% · 228mongo-rust-drivermongo-rust-driver: 100.0% pass rate, 105 tests passed100.0% · 105mongo-php-librarymongo-php-library: 99.9% pass rate, 2,197 tests passed99.9% · 2,197mongo-c-drivermongo-c-driver: 99.7% pass rate, 791 tests passed99.7% · 791mongo-node-drivermongo-node-driver: 99.7% pass rate, 357 tests passed99.7% · 357mongo-ruby-drivermongo-ruby-driver: 99.6% pass rate, 258 tests passed99.6% · 258pymongopymongo: 99.5% pass rate, 1,206 tests passed99.5% · 1,206pymongo (async)pymongo (async): 99.4% pass rate, 1,111 tests passed99.4% · 1,111mongo-go-drivermongo-go-driver: 98.0% pass rate, 598 tests passed98.0% · 598

Pass rate per suite, axis from 95% · number = tests passed · 17 November 2026

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

Checked against mongod 8.2.11 and secantusd-mdb 0.5.3-beta.198 · 19 November 2026

Act two · How fast? Against mongod 8.0.38

1.2–3.6× mongod’s latency per operation

Rust server
2x3x4xmongod = 1xinsert (10k docs)Rust server — 1.5x mongod1.5xfind indexed rangeRust server — 1.3x mongod1.3xfind full scanRust server — 1.2x mongod1.2xfind filtered scanRust server — 1.4x mongod1.4xupdate_many (half)Rust server — 1.2x mongod1.2xaggregate $groupRust server — 2.8x mongod2.8xaggregate multi-stageRust server — 2.6x mongod2.6xdelete_many (half)Rust server — 3.6x mongod3.6xchange-stream drainRust server — 1.4x mongod1.4x

Latency as a multiple of mongod’s, lower is better · both durable · 18 November 2026

Under load

Scaling with concurrent writers

mongodRust serverRust server — async stack
1x2x3x1248concurrent writersmongod — 1 writer: 1.00x its single-writer ratemongod — 2 writers: 1.66x its single-writer ratemongod — 4 writers: 2.62x its single-writer ratemongod — 8 writers: 3.35x its single-writer rateRust server — 1 writer: 1.00x its single-writer rateRust server — 2 writers: 1.54x its single-writer rateRust server — 4 writers: 2.11x its single-writer rateRust server — 8 writers: 2.57x its single-writer rateRust server (async + non-logged oplog) — 1 writer: 1.00x its single-writer rateRust server (async + non-logged oplog) — 2 writers: 1.63x its single-writer rateRust server (async + non-logged oplog) — 4 writers: 2.11x its single-writer rateRust server (async + non-logged oplog) — 8 writers: 2.34x its single-writer ratemongod 3.4xRust 2.6xasync 2.3x

Each line relative to its own one-writer rate: mongod starts 1.5× ahead, 1.9× at 8 writers.
Dashed: the opt-in async stack, whose oplog tail is durable to the last checkpoint.

Act three · The second protocol

Then we did it again for PostgreSQL

psycopg’s own test suite: 5,670 pass, 1 fail · 16 November 2026

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

Rust PostgreSQL server 0.1.0-beta.17 · weekly gauge run, 16 November 2026

Act three · Architecture

Two protocols, one storage engine

Python

Node.js

Rust

Go

C#

Others

→

MongoDB wire protocol

OP_MSG over TCP

→

secantus-wire

commands

→

secantus-core

query, update,
aggregate

→

psycopg

pgjdbc

pgx

Others

→

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

Act four · Working with Claude Code

From prompts to plans to goals

Manual

prompt by prompt

→

Plans

agree the plan, then build

→

Goals

everything is a goal now

Goals run for days

on end

Free → Ultra

in a couple of weeks

CLAUDE.md → skills

one big file, broken up

Act four · Skills

The general skills

start-session

Opens a session: checks the repo and machine are current, refreshes the code graph, clears leftovers

close-session

Lands outstanding work, records what is left, tears down branches and worktrees

secantusdb-release

Releases both Rust servers: tags, binaries, the PyPI wheel, through to the live site

secantusdb-website

The secantusdb.com site: edit on a branch, PR, deploy, a blog post per release

conformance-gauges

Runs the 13 MongoDB driver test suites, unmodified, against the server

ci-check

Checks CI after every push; a failure is a bug, with a catalogue of known patterns

Act four · Models

Using Models

Then

Always picked the biggest model available

… until Fable

What changed

Anthropic reduced its freebies

Fable is super expensive

Now

Two sessions running all week on Opus, low effort

Fable and Opus High reserved for planning

Thank you

Questions?

secantusdb.com · github.com/jdrumgoole/SecantusDB