All work

Embeddable document database · Independent builder

SavannahDB

Embedded and Server Document Database

A lightweight document database with a C++ storage and indexing core, usable in-process from Node.js like SQLite, or as a standalone JSON-over-HTTP server any language can call.

Stack
C++TypeScriptNode.jsCMake
Links
GitHub
savannahdb · embedded:27018animals.find({ height: { $gt: 2.0 } })2.05.01.21.42.73.25.5{ ostrich, 2.7 }{ elephant, 3.2 }{ giraffe, 5.5 }$match$group$sort$projectindex: animals.height

A lightweight document database with a C++ engine core, usable in-process from Node.js like SQLite, or as a standalone JSON-over-HTTP server that any language can call.

01The Problem

Document databases tend to come in one size: a server you run, a wire protocol you need a driver for, and a footprint that is overkill for a local app, a test suite, or a small service. The embedded options, meanwhile, are usually relational. There is a gap for a document store that can be embedded when you want zero network hops and served when you want other languages in.

02The Solution

SavannahDB is built from the ground up rather than mimicking a legacy wire protocol. Its C++ core (the "Jungle" storage and indexing layer) is exposed two ways:

  1. Embedded mode - Runs inside a Node.js process with zero network latency: suited to serverless functions, local apps and fast tests.
  2. Server mode - A standalone micro-server with a clean HTTP/JSON REST API, so Node.js, Python, Go, Rust or anything else can use it.
const db = new SavannahDB({ storage: { backend: 'canopy', root: './data/my_db' } })
const animals = db.collection('zoo', 'animals')

await animals.insertMany([{ name: 'giraffe', height: 5.5 }, { name: 'lion', height: 1.2 }])
const tall = await animals.find({ height: { $gt: 2.0 } }).sort({ height: -1 }).toArray()

03Key Features

  • Durable persistence - A log-structured Canopy/LMDB backend with an append-only write-ahead log and atomic checkpoints.
  • B-tree indexing - On any field, including nested paths, with automatic backfilling of existing documents.
  • Native aggregation - Multi-stage pipelines ($match, $group, $lookup, $unwind and more) executed in C++.
  • A familiar query language - Filters, sorts, cursors and update modifiers in the document-database style.
  • Language-neutral server - Plain HTTP and JSON on port 27018, so a Python script is as much a client as the Node SDK.

04Technical Stack

  • C++ - The storage engine, indexes and aggregation pipeline.
  • Node.js native addon - Built with CMake, for embedded mode.
  • TypeScript - The SDK and the REST server.

Next project

Metafy-SEO

Lean React SEO Toolkit