Features

One engine.
From a single file
to a sharded cluster.

DocumentForge gives you JSON documents, SQL queries, and persistent indexes in a single dependency-free package — then scales the same engine out to replication and consistent-hash sharding, with a visual control plane to drive the whole thing.

Engine ~6,000 lines of C#
Dependencies Zero
Runtime .NET 9 · cross-platform
License MIT
210K
Indexed point lookups / sec
10M+
Documents on a single laptop
1
Self-contained binary — zero deps
0
Rebuilds — indexes persist
JSON · SQL

Store JSON, query like SQL

Schema-free documents stored as compact BSON, with nested paths, arrays, joins, aggregations and composite indexes — all through a familiar SQL surface.

Speed

Sub-millisecond lookups

A mainframe-inspired direct-address location map turns an indexed point lookup into a single seek — 210K queries per second, sustained, on a laptop.

Durability

Crash-safe by design

A write-ahead log with a CRC32 per record, page checksums verified on every read, and automatic replay of uncommitted writes on startup.

Scale

Replicate and shard

Logical replication with auto-failover and zero-loss planned handover; consistent-hash sharding that adds a node without re-routing everything.

Footprint

Embed or serve

One NuGet package in-process, or one self-contained binary behind an HTTP API. Nothing to install on the target machine.

Control

A visual control plane

Studio: browse data, run SQL, watch node health, and design an entire cluster on a drag-and-drop canvas that exports a router config.

Developer experience

Familiar from the first line

Embed it, serve it, or query it with LINQ — the storage engine and query language are identical.

Embedded in .NET

using DocumentForge.Engine;

using var db = DocumentForgeDb.OpenOrCreate("app.dfdb");

db.Insert("orders", """{ "pnr": "ABC123", "total": 420.50 }""");
db.CreateIndex("orders", "pnr", "idx_pnr", unique: true);

var result = db.Execute("SELECT * FROM orders WHERE pnr = 'ABC123'");

SQL over nested JSON

SELECT passenger.lastName, fare.total
FROM orders
WHERE status = 'TICKETED' AND fare.total > 1000
ORDER BY fare.total DESC LIMIT 50;

Or the same engine behind HTTP

# one binary — run a node and query it over HTTP
dfdb serve --port 5000 --data-dir ./data

curl -X POST localhost:5000/query \
  -d '{"sql": "SELECT COUNT(*) FROM orders"}'
Prefer types? db.Collection<Order>("orders").Where(o => o.Pnr == "ABC123") runs against the very same data. See the .NET SDK reference.
Visual control plane

Design a cluster by dragging boxes

Studio turns operating DocumentForge into something you can see. Wire replication between databases, claim them into shard rings, and the canvas writes the router cluster.json for you.

Cluster router routes per cluster.json Shard A hash(pnr) leader :5101 follower :5102 Shard B hash(pnr) leader :5201 follower :5202

Drag → wire → export. Red links claim a database into a shard ring; blue links wire leader→follower replication. The canvas exports the exact cluster.json the router runs.

Explore the management UI How sharding works
Under the hood

The full capability set

01

Persistent B-tree indexes

Unique, composite and nested-path indexes that survive restart — no rebuild on startup, and they self-heal if the catalog is damaged.

02

Nested paths & arrays

Index and query deep structure like passenger.lastName or flights[0].from directly.

03

Joins & aggregations

Query across collections, with COUNT/SUM/AVG/MIN/MAX and GROUP BY.

04

Typed LINQ

Strongly-typed queries — Where(o => o.Pnr == "ABC") — over the same documents, with consistent camelCase JSON.

05

Overflow pages

Documents larger than a page are transparently chained — no hard size cliff.

06

Write-ahead recovery

Every change is logged with a CRC32 before pages are touched; uncommitted writes replay on startup.

07

Page checksums

Silent corruption is caught on every read, not months later.

08

Logical replication

Monotonic sequence numbers, catchup on reconnect, heartbeats, and automatic follower promotion.

09

Consistent-hash sharding

Add a shard without re-routing all data; replicated reference collections keep joins local.

10

Multi-database hosting

One process hosts many attached databases, LocalDB-style, each with its own cache, WAL and indexes.

11

One-binary CLI

dfdb does it all: serve, repl, query, seed, router, cluster, health, rebalance.

12

Visual cluster builder

Design a cluster on a canvas, export cluster.json, and spawn the router — without hand-editing config.

Ready to build?

Go from "found the site" to your first query in under five minutes.

Start the Quickstart Read the Docs GitHub