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
26pure-language HTTP clients for daemon deployments
C ABIfoundation for native bindings, shipping today
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

Pure-language 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 they do not need native dependencies.

  • 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 for six platform targets ship with every release.

  • Foundation for the nine in-process bindings.
  • 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 mongreldb
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
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, "~> 0.1"} in mix.exs
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.

Installgleam add mongreldb
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 HTTP.jl for analytics and research code that wants MongrelDB features without hosting the engine in-process.

Install] add MongrelDB
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 lua-curl-backed client for scripts, tools, and embedded runtimes that should avoid linking the storage engine directly.

Installluarocks install mongreldb
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.

Installmagic add mongreldb
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 mongreldb
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.

Installcpanm MongrelDB
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 mongreldb
Open client
Tier 2 HTTPR

R

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

Installinstall.packages("mongreldb")
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 install mongreldb
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 with prebuilt libraries for six platform targets.

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.

npm install @visorcraft/mongreldb-kitcd crates/mongreldb-node && npm install && npm run build
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.

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 all six platform natives bundled. Each NativeDB class runs SQL, migrations, and queries in-process; the pure-JVM HTTP client covers the daemon path.

Maven/Gradle/sbt + libmongreldb_jni

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
-- Same data, multiple access paths.
SELECT rowid, title, score
FROM docs
WHERE tenant = 'acme'
  AND created_at BETWEEN TIMESTAMP '2026-01-01' AND TIMESTAMP '2026-12-31'
  AND body LIKE '%needle%'
  AND ann_search(embedding, '[0.12, 0.31, ...]', 50)
ORDER BY score DESC
LIMIT 20;
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.

Client-friendly deployment

Tier 2 packages are pure-language HTTP clients. 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. Storage-layer credential enforcement can make authenticated principals mandatory for opens and operations.

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.

HTTP clients26 daemon-backed languages
SQL + nativeDataFusion queries and typed routes
Auth + limitstokens, users, roles, 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.

Eight index families resolve into a shared RowId space, allowing the engine to combine different access patterns before it decodes rows.

  • 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 cleanup paths.

  • 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
8.0µssingle-row durable write, measured on the 1M-row benchmark profile
7.2µssingle-row durable update in the same benchmark profile
25.7M/styped bulk ingest with bulk_load_columns
208M/sone-column projection pushdown throughput
122M/sbitmap equality pushdown throughput
118M/sPGM range pushdown throughput
0.1-0.3µswarm result-cache hit latency
4.17 Breported storage footprint per row on the 1M-row profile

Benchmark numbers are from the 1M-row dev-sandbox profile. 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)
Maven/Gradle + libmongreldb_jni
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-kit
ClojureTier 2 HTTP client
deps.edn / Leiningen
CrystalTier 2 HTTP client
shards add mongreldb
DTier 2 HTTP client
dub add mongreldb
DartTier 2 HTTP client
dart pub add mongreldb
ElixirTier 2 HTTP client
{:mongreldb, "~> 0.1"} in mix.exs
ErlangTier 2 HTTP client
rebar3
F#Tier 2 HTTP client
dotnet add reference
FortranTier 2 HTTP client
fpm
GleamTier 2 HTTP client
gleam add mongreldb
GoTier 2 HTTP client
go get github.com/visorcraft/mongreldb-go
JuliaTier 2 HTTP client
] add MongrelDB
LuaTier 2 HTTP client
luarocks install mongreldb
MojoTier 2 HTTP client
magic add mongreldb
NimTier 2 HTTP client
nimble install mongreldb
Objective-CTier 2 HTTP client
CMake (links Foundation)
OdinTier 2 HTTP client
odin build
PerlTier 2 HTTP client
cpanm MongrelDB
PHPTier 2 HTTP client
composer require visorcraft/mongreldb-php
PowerShellTier 2 HTTP client
Import-Module mongreldb
RTier 2 HTTP client
install.packages("mongreldb")
RubyTier 2 HTTP client
gem install mongreldb
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.