Build with MongrelDB

Supported Languages

Embedded when latency matters. HTTP when portability wins.

MongrelDB supports 35 languages without changing the engine underneath it. Nine run the engine in-process through native bindings - Rust, TypeScript, Python, C, C++, C#/.NET, Java, Kotlin, and Scala - and 26 more connect through daemon-backed HTTP clients, from Clojure and Crystal to V and Zig.

35supported languages across embedded and HTTP tiers
9embedded native bindings for in-process use
26language-native HTTP clients for daemon deployments
C ABIfoundation for the C, C++, and .NET bindings
Integration tiers

Pick the boundary that matches your application.

The client strategy is deliberately simple: keep the engine in-process for the languages where native bindings exist, and use the daemon when you want broad language coverage with no native extension requirement.

Tier 1 embedded

Native bindings, no daemon.

Rust, TypeScript, Python, C, C++, C#/.NET, Java, Kotlin, and Scala run the engine in-process. That preserves MongrelDB’s low-latency write path and avoids paying a network round trip just to query local data.

  • Best for local-first apps, Node services, Python tools, native products, and JVM services.
  • No serialization boundary between your process and the storage engine.
Tier 2 HTTP

Language-native HTTP clients.

Twenty-six languages - from Clojure, Crystal, D, Dart, Elixir, and Erlang through Go, Julia, Kotlin/Native, Lua, Nim, Perl, PHP, R, Ruby, Swift, Tcl, V, and Zig - connect to a running mongreldb-server. The clients stay easy to install because none of them needs the native engine - each talks HTTP over its own language stack.

  • Best for web apps, workers, multi-process deployments, and polyglot stacks.
  • The daemon keeps a multi-table database warm behind SQL, native, and Kit routes.
C ABI + JNI

Three shipping native shims.

The mongreldb-ffi crate exposes a C interface over the engine core (SQL, typed queries, transactions, migrations), mongreldb-kit-ffi wraps the Kit layer, and mongreldb-jni is a JNI shim for Java, Kotlin, and Scala. Prebuilt libraries ship with every release - six platform targets for the C-ABI archives, five in the JNI fat JAR.

  • Underpins the C, C++, and .NET bindings; Node, Python, and the JVM bind the Rust engine through NAPI, PyO3, and JNI shims.
  • Keeps language growth aligned with the same core engine.
Language coverage

Thirty-five languages, one engine contract.

Every client should make the same strengths approachable: durable local writes, columnar reads, hybrid indexes, DataFusion SQL, Arrow-friendly data movement, encryption, and daemon-backed multi-process access when needed.

Embedded clients

Use these when you want the engine inside your application process and care about avoiding an extra service boundary.

HTTP clients

Use these when you want a language-native package that talks to mongreldb-server without compiling native bindings.

Tier 2 HTTPCL

Clojure

Clojure apps reach the daemon through a small clj-http-backed client, keeping the database process separate from JVM application code.

Installdeps.edn / Leiningen
Open client
Tier 2 HTTPCR

Crystal

Crystal gets a pure-language HTTP::Client path to the daemon for services and tools that want MongrelDB without embedding the Rust engine.

Installshards add mongreldb
Open client
Tier 2 HTTPD

D

D applications can use the HTTP client to reach a warm MongrelDB daemon while avoiding native storage linkage in the application runtime.

Installdub add-local (GitHub checkout)
Open client
Tier 2 HTTPDT

Dart

Dart tools and services can use the HTTP client to keep MongrelDB behind a stable daemon process.

Installdart pub add mongreldb --git-url https://github.com/visorcraft/mongreldb-dart
Open client
Tier 2 HTTPEX

Elixir

Elixir applications can keep BEAM processes focused on application work while MongrelDB runs behind HTTP as the local database service.

Install{:mongreldb, github: "visorcraft/mongreldb-elixir"}
Open client
Tier 2 HTTPER

Erlang

Erlang gets an httpc-backed client for BEAM releases that want MongrelDB behind a daemon boundary, keeping the storage engine out of the OTP runtime.

Installrebar3
Open client
Tier 2 HTTPF#

F#

F# reaches the daemon through an HttpClient-backed client, pairing cleanly with functional .NET services and scripts.

Installdotnet add reference
Open client
Tier 2 HTTPFN

Fortran

Fortran talks to the daemon over a curl-backed client, fitting scientific and HPC workflows that want a real database without embedding native storage.

Installfpm
Open client
Tier 2 HTTPGL

Gleam

Gleam gets a gleam_http client for the BEAM-native crowd that wants a typed, pure-language path to a warm daemon.

Installbuild from source (GitHub)
Open client
Tier 2 HTTPGO

Go

Use Go for services, CLIs, and worker fleets while talking to the daemon over a pure-language net/http client. Good for deployment targets where native database bindings add friction.

Installgo get github.com/visorcraft/mongreldb-go
Open client
Tier 2 HTTPJL

Julia

Julia gets daemon-backed access through a standard-library sockets client for analytics and research code that wants MongrelDB features without hosting the engine in-process.

Install] add https://github.com/visorcraft/mongreldb-julia
Open client
Tier 2 HTTPKN

Kotlin/Native

Kotlin/Native compiles to native machine code with no JVM, talking to the daemon through a ktor-client-curl HTTP client for cross-platform tools and services.

InstallGradle (compiles to native, no JVM)
Open client
Tier 2 HTTPLU

Lua

Lua gets a small LuaSocket-backed client for scripts, tools, and embedded runtimes that should avoid linking the storage engine directly.

Installluarocks make (rockspec in GitHub repo)
Open client
Tier 2 HTTPMJ

Mojo

Mojo reaches the daemon through an http-backed client, fitting AI and systems code that wants MongrelDB access without native storage linkage.

Installmojo run -I src (from source)
Open client
Tier 2 HTTPNM

Nim

Nim gets a pure-language path to the daemon, useful for command-line tools, services, and experiments that need MongrelDB access without embedding the Rust engine.

Installnimble install https://github.com/visorcraft/mongreldb-nim
Open client
Tier 2 HTTPOB

Objective-C

Objective-C apps reach the daemon through an NSURLSession-backed client for macOS and iOS tools that want a separately managed database service.

InstallCMake (links Foundation)
Open client
Tier 2 HTTPOD

Odin

Odin talks to the daemon over a pure-language net/http client, fitting data-oriented tools that want MongrelDB without native bindings.

Installodin build
Open client
Tier 2 HTTPPL

Perl

Perl scripts and services use an HTTP::Tiny-backed client for SQL, query routes, and operational access without native storage linkage.

Installcopy lib/MongrelDB.pm (from GitHub)
Open client
Tier 2 HTTPPHP

PHP

Bring MongrelDB to PHP web applications and workers through a cURL-backed client. The package stays simple to install while the server keeps the database process warm.

Installcomposer require visorcraft/mongreldb-php
Open client
Tier 2 HTTPPS

PowerShell

PowerShell reaches the daemon through Invoke-RestMethod, fitting automation, gluing, and ops tooling that wants a real database behind a module.

InstallImport-Module ./src/MongrelDB.psd1
Open client
Tier 2 HTTPR

R

R users reach MongrelDB through a libcurl-backed client for local analytics, retrieval workflows, and repeatable data tooling.

InstallR CMD INSTALL . (GitHub checkout)
Open client
Tier 2 HTTPRB

Ruby

Give Ruby apps access to MongrelDB’s SQL, native query routes, and daemon-managed warm state through a net/http client without requiring native database bindings inside the application process.

Installgem 'mongreldb', git: 'https://github.com/visorcraft/mongreldb-ruby'
Open client
Tier 2 HTTPSW

Swift

Use Swift Package Manager to connect Swift tools and applications to a MongrelDB daemon over URLSession, keeping the database engine as a separately managed local service.

InstallSwift Package Manager
Open client
Tier 2 HTTPTC

Tcl

Tcl scripts reach the daemon through the built-in http package, fitting automation, tooling, and legacy glue that wants a real database behind a warm process.

Installpackage require mongreldb
Open client
Tier 2 HTTPV

V

V talks to the daemon over a pure-language net.http client, fitting fast-compiling tools and services that want MongrelDB without native bindings.

Installv install
Open client
Tier 2 HTTPZG

Zig

For Zig projects, a std.http-backed client keeps integration straightforward while still exposing the same daemon-backed database surface.

Installzig fetch
Open client
Embedded path

For hot local data, keep the engine in-process.

The nine embedded clients are for applications that should feel like they are using a local library, not a remote service. That matters when your strengths are sub-millisecond writes, RowId-level set intersections, and Arrow batches returned directly to the caller. Rust, TypeScript, and Python bind through their own native toolchains; C, C++, C#/.NET, Java, Kotlin, and Scala bind through three shipping native shims (the C-ABI archives cover six platform targets, the JNI fat JAR five).

Rust direct

Closest to the core.

Rust gets direct access to mongreldb-core, the storage engine crates, examples, and testable internals. Use it for embedded products, local-first backends, and storage-aware application code.

cargo add mongreldb-core
TypeScript NAPI

The Node path avoids the HTTP hop.

The NAPI addon exposes typed object/method APIs, SQL execution, Arrow IPC bytes, BigInt row identifiers, promise variants, and RemoteDatabase for daemon-backed multi-process use. Prebuilt binaries ship for Linux x64/arm64; other platforms build from source or use RemoteDatabase over HTTP.

npm install @visorcraft/mongreldbnpm install @visorcraft/mongreldb-kit
Python PyO3

Native engine for scripts and retrieval work.

Python can use MongrelDB without operating a separate database server, which fits agent memory, ETL, local analytics, embedding experiments, and fast test fixtures. Wheels are published for CPython 3.10/3.11; other versions use the daemon over HTTP.

pip install mongreldb-kit
C / C++ via C ABI

Prebuilt libmongreldb + libmongreldb_kit.

The mongreldb-ffi and mongreldb-kit-ffi crates ship as libmongreldb and libmongreldb_kit for six platform targets, with C headers for SQL execution, typed queries, transactions, and the full migration runner. The C and C++ clients bundle both headers for direct native embedding.

CMake + prebuilt libmongreldb, libmongreldb_kit
.NET via P/Invoke

Visorcraft.MongrelDB.Native.

The native package embeds the engine through P/Invoke over the prebuilt libraries, bundling runtimes/<rid>/native/ and resolving them via NativeLibrary.SetDllImportResolver. The pure-managed Visorcraft.MongrelDB package stays HTTP-only.

dotnet add package Visorcraft.MongrelDB.Native
Java / Kotlin / Scala via JNI

libmongreldb_jni fat JAR.

The mongreldb-jni shim powers all three JVM languages, distributed as a fat JAR with five platform natives bundled (Linux x64/arm64, macOS x64/arm64, Windows x64). Each NativeDB class runs SQL, migrations, and queries in-process; the pure-JVM HTTP client covers the daemon path.

com.visorcraft:mongreldb-jni (Maven Central)

One query shape, several client surfaces.

The useful part is not just language coverage. It is that dense vector ANN, substring matching, bitmap equality, range filters, null checks, and byte-prefix conditions can compose into one RowId-space intersection before rows and columns are decoded.

Native callsDataFusion SQLHybrid query APIArrow IPCBigInt RowIdsResult cache
-- Scored hybrid retrieval - runnable over the daemon.
SELECT id, title, fused_score
FROM hybrid_search_scored(
  'docs',
  '{"must":[
      {"bitmap_eq":{"column":"tenant","value":"acme"}},
      {"range":{"column":"created_at","lo":1767225600,"hi":1798761600}},
      {"fm_contains":{"column":"body","pattern":"needle"}}],
    "retrievers":[
      {"name":"dense","ann":{"column":"embedding","query":[0.12,0.31],"k":50}}],
    "limit":20}',
  'id,title')
ORDER BY fused_score DESC;
Daemon path

For polyglot apps, run the warm database once.

The HTTP tier is not a weaker engine. It is a deployment boundary. Run mongreldb-server when multiple processes or languages need the same database directory, cache, auth boundary, replication stream, and change notifications.

Multi-process access

The daemon keeps a multi-table Database warm and exposes SQL, native query routes, and typed Kit endpoints such as schema, transaction, query, and create-table routes.

Multi-table ACID transactions

Transactions are ACID across tables, with ReadCommitted, RepeatableRead, and Serializable isolation - the serializable level adds SSI-style certification at commit - plus savepoints and idempotent commits that make retries safe after a crash.

Native gRPC and MySQL wire protocols

Beyond HTTP/JSON, a native gRPC protocol carries Protobuf control messages and Arrow IPC batches over multiplexed HTTP/2 - TLS 1.3 only, with optional mTLS, SCRAM-SHA-256, and OIDC/JWKS auth - served by a pooled Rust NativeClient with streaming, cancellation, and prepared statements. A MySQL wire listener (TLS 1.3, caching_sha2_password) lets existing MySQL clients run queries, transactions, and prepared statements, and an online migration tool moves MySQL databases in with a consistent snapshot, binlog catch-up, resumable checkpoints, and count/checksum validation before a locked cutover.

Client-friendly deployment

Tier 2 packages are language-native HTTP clients with no native engine dependency. That means the application can stay idiomatic in Clojure, Crystal, D, Dart, Elixir, Erlang, F#, Fortran, Gleam, Go, Julia, Kotlin/Native, Lua, Mojo, Nim, Objective-C, Odin, Perl, PHP, PowerShell, R, Ruby, Swift, Tcl, V, or Zig while the daemon owns the engine process.

Security controls

The daemon supports bearer token auth, HTTP Basic auth users, connection limits, and page-level encryption passphrases. Users and roles are managed with GRANT/REVOKE SQL DDL, the native listener adds SCRAM-SHA-256 and OIDC/JWKS, Vault Transit can act as the key-management service, and a bounded audit log records security events. Storage-layer credential enforcement can make authenticated principals mandatory for opens and operations.

Optional HA and sharded-cluster modes

Single-node is the default, but two optional modes scale beyond it: Raft-replicated HA (openraft consensus, RPO-0 quorum writes, five read-consistency levels from linearizable to eventual) and a tablet-sharded cluster (Hash/Range/Tenant/TimeRange partitioning, tablet split/merge, distributed two-phase-commit transactions, mTLS cluster transport).

Streaming and change events

Replication streams committed WAL records to followers, while change data capture uses SQL NOTIFY/LISTEN and an SSE events endpoint for real-time notifications.

Tested like infrastructure

The engine is exercised with deterministic simulation and fault-injection harnesses, and every official language client must pass a 14-operation live wire-compatibility conformance matrix against a running daemon in CI.

HTTP clients26 daemon-backed languages
Three wire protocolsHTTP/JSON, native gRPC, MySQL wire
Auth + limitstokens, users, roles, OIDC, connections
EventsWAL replication and CDC SSE
mongreldb-serverwarm database boundary
Core strengths

Every client exposes the same core strengths.

The integration model changes by runtime, but the underlying capabilities stay consistent: hybrid access paths, durable writes, columnar scans, DataFusion SQL, Arrow results, encryption, and operational tooling.

Hybrid access

Search, vector, equality, and range together.

Six secondary index kinds - bitmap, PGM learned range, FM-index, HNSW ANN, learned-sparse, and MinHash - resolve into a shared RowId space, allowing the engine to combine different access patterns before it decodes rows. The primary-key point-lookup path (in-memory HOT, on-disk learned PGM) is implicit on top of that.

  • HNSW for dense vectors
  • FM-index for substring containment
  • Bitmap and PGM for equality and range
  • Sparse and MinHash for retrieval and dedup
Storage design

Writes first, scans still fast.

A WAL with group commit feeds a Bε-tree memtable, then flushes to immutable .sr PAX-columnar sorted runs with MVCC snapshots.

  • Predicate pushdown
  • Projection pushdown
  • Page min/max pruning
  • Memory-mapped sorted runs
SQL + Arrow

Useful relational surface.

DataFusion SQL gives applications joins, recursive CTEs, windows, materialized views, multi-statement execution, and FTS ranking without leaving the engine.

  • Cross-table SQL
  • Arrow IPC output
  • Zero-copy shadow cache
  • Typed query APIs
Security

Encryption without giving up pruning.

AES-256-GCM protects pages, WAL frames, result cache entries, and index checkpoints. Encrypted stats envelopes let encrypted columns prune like plaintext ones.

  • Argon2id + HKDF key derivation
  • Run metadata MACs
  • Queryable equality/range tokens
  • User and role auth
Operations

Local engine, production-shaped tools.

MongrelDB includes daemon mode, connection pooling, auth, replication, change data capture, schema evolution, compaction, check, doctor, and version GC. Time-travel queries (AS OF EPOCH), timestamp-column TTL policies, and backup with point-in-time recovery round out the operational surface.

  • RemoteDatabase for Node daemon access
  • WAL stream followers
  • NOTIFY/LISTEN and SSE events
  • Credential enforcement
Open source

Inspectable by design.

MongrelDB is dual-licensed under MIT or Apache-2.0, built in Rust, and organized into focused crates for storage, SQL, server, client, the C ABI, the Kit C ABI, the JNI shim, Node bindings, and benchmarks.

  • Core engine crate
  • SQL/query frontend
  • NAPI addon
  • Server, client, FFI, Kit-FFI, JNI, and benchmark crates
4.48µsaccepted put without fsync; 0.78µs p50 on the REM-J reused-table steady state
4.67 msdurable single-row commit with fsync
4.28 msdurable update on a flushed table (10.36µs without fsync)
17.1M/styped bulk ingest with bulk_load_columns, 1M-row scale
153M/sone-column bitmap projection pushdown (6.53 ms per 1M rows)
124M/sbitmap equality pushdown (8.04 ms per 1M rows)
113M/sPGM range pushdown (8.82 ms per 1M rows)
1.04µswarm embedded point query p50 (p95 1.43µs, 10,000 queries)

Benchmark numbers are from the current BENCHMARKS.md (v0.64-era release builds on one Linux x86-64 machine; 1M-row and write-path measurements collected 2026-07-14/15, exact-SHA REM-J measurements 2026-07-27). The same file records 1,000 concurrent HTTP sessions against the daemon with 0 failed requests and 259 MB peak RSS. These are engineering measurements from one machine, not cross-machine guarantees - keep them paired with the benchmark methodology and update them when the benchmark suite changes.

Install reference

Start with the client that matches your runtime.

Start with the package for your runtime, then choose embedded or daemon-backed deployment based on how close the engine should sit to your application.

CTier 1 embedded (C ABI)
CMake or prebuilt libmongreldb
C++Tier 1 embedded (C ABI)
CMake or prebuilt libmongreldb
C# / .NETTier 1 embedded (P/Invoke)
dotnet add package Visorcraft.MongrelDB.Native
JavaTier 1 embedded (JNI)
com.visorcraft:mongreldb-jni (Maven Central)
KotlinTier 1 embedded (JNI)
Gradle + libmongreldb_jni
PythonTier 1 embedded (PyO3)
pip install mongreldb-kit
RustTier 1 embedded (direct)
cargo add mongreldb-core
ScalaTier 1 embedded (JNI)
sbt + libmongreldb_jni
TypeScriptTier 1 embedded (NAPI)
npm install @visorcraft/mongreldb
ClojureTier 2 HTTP client
deps.edn / Leiningen
CrystalTier 2 HTTP client
shards add mongreldb
DTier 2 HTTP client
dub add-local (GitHub checkout)
DartTier 2 HTTP client
dart pub add mongreldb --git-url https://github.com/visorcraft/mongreldb-dart
ElixirTier 2 HTTP client
{:mongreldb, github: "visorcraft/mongreldb-elixir"}
ErlangTier 2 HTTP client
rebar3
F#Tier 2 HTTP client
dotnet add reference
FortranTier 2 HTTP client
fpm
GleamTier 2 HTTP client
build from source (GitHub)
GoTier 2 HTTP client
go get github.com/visorcraft/mongreldb-go
JuliaTier 2 HTTP client
] add https://github.com/visorcraft/mongreldb-julia
LuaTier 2 HTTP client
luarocks make (rockspec in GitHub repo)
MojoTier 2 HTTP client
mojo run -I src (from source)
NimTier 2 HTTP client
nimble install https://github.com/visorcraft/mongreldb-nim
Objective-CTier 2 HTTP client
CMake (links Foundation)
OdinTier 2 HTTP client
odin build
PerlTier 2 HTTP client
copy lib/MongrelDB.pm (from GitHub)
PHPTier 2 HTTP client
composer require visorcraft/mongreldb-php
PowerShellTier 2 HTTP client
Import-Module ./src/MongrelDB.psd1
RTier 2 HTTP client
R CMD INSTALL . (GitHub checkout)
RubyTier 2 HTTP client
gem 'mongreldb', git: 'https://github.com/visorcraft/mongreldb-ruby'
SwiftTier 2 HTTP client
Swift Package Manager
TclTier 2 HTTP client
package require mongreldb
VTier 2 HTTP client
v install
ZigTier 2 HTTP client
zig fetch
MongrelDB mark

One engine.
Any language.

Embed MongrelDB where latency matters, run the daemon where language reach and multi-process access matter, and keep the same storage model underneath both.