Open Source · Built for Airline Retailing

Store
JSON.
Query it like
SQL.

An open-source JSON database with SQL queries — fully replicated, sharded, and starting life as a single file so developers can innovate fast. Designed from the ground up with mainframe-inspired direct addressing, for airlines running pure Offer & Order Management.

Version 0.1.0
License MIT
Runtime .NET 9 (cross-platform)
Dependencies Zero
10M+
Verified benchmark on a single laptop
210K
Point lookups / sec, sustained
Billions
Sharded — linear scale, no rewrite
0
External dependencies

Floor numbers from a benchmark you can run yourself in five minutes. Modern laptops comfortably push 20M+ documents per node — sharding extends linearly into the billions and beyond.

Why DocumentForge

Built for the Offer & Order stack.

Modern airline retailing demands JSON-shaped offers and orders, sub-millisecond lookups, and a database the airline actually controls. DocumentForge is engineered for that exact workload — and the codebase is simple enough that an airline's own engineers can read every line.

01 · Performance

Engineered for offer-velocity

Mainframe-inspired direct addressing means every document has a known physical address — the lookup is the read, not a journey through a B-tree on every hop. 210,000 indexed point lookups per second on a single laptop, sustained, while the dataset grows past 20 million documents per node. Pricing engines, shopping carts, and order retrievals stay sub-millisecond at airline scale, and sharding extends the same numbers linearly into the billions.

02 · Modern Airline Retailing

Aligned with IATA OOP

JSON is the native shape of every offer, order, service, and bundle in the IATA Offers & Orders programme. Embed the JSON exactly as the schema defines it, query nested arrays of pax × journey × cabin without an ORM in the middle, and let the data look the way the standard does.

03 · Your data, your control

The airline owns the database

It's a file on a disk you own, in a process you run, in a datacenter you control. No vendor cloud, no egress fees, no opaque licensing audit risk, no hostage data. Open the database file with our binary or any other tool you write — it's yours.

04 · Safety & durability

Crash-safe by design

Write-ahead logging with CRC32 per record. Per-page checksums detect silent corruption on every read. Logical replication with monotonic sequence numbers and auto-failover. Planned handover for zero-data-loss datacenter moves — the kind of safety airline operations require.

05 · Simplicity

~6,500 lines of clean C#

A small team can read the whole codebase in an afternoon. No exotic dependencies, no plug-in zoo, no hidden services. Cross-compiles to a single 47 MB self-contained binary that runs on Windows, Linux, and macOS — no runtime install required.

06 · Scale on demand

From single-file to sharded fleet

Start with one .dfdb file beside your service. Add a follower for read scaling. Add consistent-hash shards for horizontal scale. Online rebalance moves data while clients keep reading and writing — no maintenance windows, no rip-and-replace.

Try it now

Download. Run. Benchmark.

Self-contained binary. No .NET install needed. Drop on a laptop, seed 10,000 orders, and see the numbers yourself in under five minutes.

Walk through the full benchmark →

Embed it · or talk to it over REST

Two ways in. Same database.

DocumentForge is a .NET library at heart, but ships as a self-contained binary that exposes a REST API for any language. Pick the tab that matches your stack.

using DocumentForge.Engine;

// Open or create a database file
using var db = DocumentForgeDb.OpenOrCreate("airline.dfdb");

// Insert an Order document (IATA-shaped JSON)
db.Insert("orders", @"{
    ""orderId"": ""ABC123"",
    ""passenger"": { ""lastName"": ""Smith"" },
    ""flights"": [{ ""flightNumber"": ""AA100"" }]
}");

// Index the fields you query
db.CreateIndex("orders", "orderId", "idx_oid", unique: true);

// SQL over JSON
var r = db.Execute("SELECT * FROM orders WHERE orderId = 'ABC123'");
Console.WriteLine(r.Documents[0].ToJson());
# Start the node (one binary, one command)
./dfdb serve --port 5000 --data-dir ./data

# Insert
curl -X POST http://localhost:5000/collections/orders/documents \
     -H "Content-Type: application/json" \
     -d '{
       "orderId": "ABC123",
       "passenger": { "lastName": "Smith" },
       "flights": [{ "flightNumber": "AA100" }]
     }'

# Query with SQL
curl -X POST http://localhost:5000/query \
     -H "Content-Type: application/json" \
     -d '{"sql": "SELECT * FROM orders WHERE orderId = '\''ABC123'\''"}'
// Any HTTP client works — here HttpClient (JDK 11+)
var http = HttpClient.newHttpClient();
var body = """
    { "sql": "SELECT * FROM orders WHERE orderId = 'ABC123'" }
    """;

var req = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:5000/query"))
    .header("Content-Type", "application/json")
    .POST(BodyPublishers.ofString(body))
    .build();

var resp = http.send(req, BodyHandlers.ofString());
System.out.println(resp.body());
import httpx

# Insert
httpx.post(
    "http://localhost:5000/collections/orders/documents",
    json={
        "orderId": "ABC123",
        "passenger": {"lastName": "Smith"},
        "flights": [{"flightNumber": "AA100"}],
    },
)

# Query
r = httpx.post(
    "http://localhost:5000/query",
    json={"sql": "SELECT * FROM orders WHERE orderId = 'ABC123'"},
)
print(r.json())
// Node 20+ — global fetch, no dependencies
await fetch("http://localhost:5000/collections/orders/documents", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    orderId: "ABC123",
    passenger: { lastName: "Smith" },
    flights: [{ flightNumber: "AA100" }],
  }),
});

const r = await fetch("http://localhost:5000/query", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ sql: "SELECT * FROM orders WHERE orderId = 'ABC123'" }),
});
console.log(await r.json());
Where to next

Pick your path.

01

Use Cases →

Why DocumentForge for airline Offer & Order Management. The IATA MAR alignment, the safety story, the “your-data-your-control” case.

02

Quickstart →

Download the binary, seed 10K orders, run the benchmark. From zero to your first SQL query in under five minutes.

03

Reference →

Tech specs for engineers: query language, data modeling, replication, sharding, deployment, security, CLI.

Status: DocumentForge is an open-source project demonstrating how a modern document database can be built from the ground up in ~6,500 lines of C#. 48 tests, a NuGet package, a single-file dfdb binary, a Next.js admin UI, and full reference documentation. Use it for embedded scenarios, prototypes, small-to-medium production workloads, and understanding how databases actually work.