MCPcopy Index your code
hub / github.com/NodeDB-Lab/nodedb

github.com/NodeDB-Lab/nodedb @v0.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.0 ↗ · + Follow
27,798 symbols 117,944 edges 3,538 files 9,708 documented · 35%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

NodeDB

The distributed multi-model database for AI and agent workloads.

Eight database engines in a single Rust binary. One SQL dialect. Zero network hops between vector search, graph traversal, document storage, columnar analytics, timeseries, key-value, full-text search, and multi-dimensional arrays.

Quickstart · Docs · Benchmarks · NodeDB-Lite · CLI

Join the NodeDB Discord

CI status Latest release License GitHub stars

NodeDB replaces the combination of PostgreSQL + pgvector + Redis + Neo4j + ClickHouse + Elasticsearch with a single process. Graph queries that feed vector search, full-text ranking, and columnar aggregation execute in one engine with shared storage, shared memory, and one planner.

Why NodeDB

  • One binary, not a polyglot stack. No inter-service networking, no schema drift between systems, no data synchronization pipelines. A graph query that feeds a vector search that filters by full-text relevance executes in one process.
  • PostgreSQL wire protocol. Connect with psql or any PostgreSQL client library. Standard SQL with engine-specific extensions where SQL can't express the operation.
  • Edge to cloud. The same engines run embedded on phones and browsers (NodeDB-Lite, WASM) with CRDT-based offline-first sync to the server.
  • Serious about performance. Thread-per-Core data plane with io_uring, SIMD-accelerated distance functions, zero-copy MessagePack transport, per-column compression (ALP, FastLanes, FSST, Gorilla). See benchmarks below.

Performance

Timeseries ingest + query benchmark — 10M rows, high-cardinality DNS telemetry (50K+ unique domain names). Single node, NVMe storage.

Ingest

Engine Rate Time Memory Disk
NodeDB 93,450/s 107s 120 MB 2,217 MB
TimescaleDB 56,615/s 177s 963 MB 2,802 MB
ClickHouse 53,905/s 186s 1,035 MB 1,647 MB
InfluxDB 22,715/s 88s (2M cap) 1,656 MB 982 MB

Queries (ms, best of 3)

Query NodeDB ClickHouse TimescaleDB InfluxDB (2M)
COUNT(*) <1 1 423 13,110
WHERE qtype=A COUNT 47 6 347 5,297
WHERE rcode=SERVFAIL 41 6 334 1,048
GROUP BY qtype 56 15 597 12,426
GROUP BY rcode 52 16 604 13,183
GROUP BY cached+AVG 120 33 677 13,652
GROUP BY client_ip (10K) 141 157 660 14,301
GROUP BY qname (50K+) 2,665 288 3,644 16,720
time_bucket 1h 101 30 603 --
time_bucket 5m+qtype 138 99 711 --

NodeDB is not a specialized timeseries database, yet it ingests 1.65x faster than TimescaleDB and 1.73x faster than ClickHouse with 8x less memory. Query latency is competitive with ClickHouse on low-cardinality aggregations and within 3-5x on high-cardinality GROUP BY. This is the tradeoff of a general-purpose engine: you get one system instead of five, with performance that stays in the same ballpark as specialized tools.

Engines

Engine What it replaces Key capability
Vector pgvector, Pinecone, Weaviate HNSW with SQ8/PQ quantization, adaptive bitmap pre-filtering
Graph Neo4j, Amazon Neptune CSR adjacency, 13 algorithms, Cypher-subset MATCH, GraphRAG
Document MongoDB, CouchDB Schemaless (MessagePack + CRDT) or Strict (Binary Tuples, O(1) field access). Typeguards for gradual schema enforcement
Columnar ClickHouse, DuckDB Per-column codecs (ALP, FastLanes, FSST), predicate pushdown, HTAP bridge
Timeseries TimescaleDB, InfluxDB ILP ingest, continuous aggregation, PromQL, approximate aggregation
Spatial PostGIS R*-tree, geohash, H3, OGC predicates, hybrid spatial-vector
Key-Value Redis, DynamoDB O(1) lookups, TTL, sorted indexes, rate limiting, SQL-queryable
Full-Text Search Elasticsearch BMW BM25, 27-language support, CJK bigrams, fuzzy, hybrid vector fusion
Array (NDArray) TileDB, Zarr Multi-dimensional tiles, Z-order indexing, bitemporal support, tile-level retention

Install

# Docker
docker run -d \
  -p 6432:6432 -p 6433:6433 -p 6480:6480 \
  -v nodedb-data:/var/lib/nodedb \
  farhansyah/nodedb:latest

# Cargo
cargo install nodedb

Requires Linux kernel >= 5.1 (io_uring). Connect:

ndb                              # native CLI (connects to localhost:6433)
psql -h localhost -p 6432        # or any PostgreSQL client
CREATE COLLECTION users;

-- Standard SQL
INSERT INTO users (name, email, age) VALUES ('Alice', 'alice@example.com', 30);

-- Object literal syntax (same result)
INSERT INTO users { name: 'Bob', email: 'bob@example.com', age: 25 };

-- Batch insert
INSERT INTO users [
    { name: 'Charlie', email: 'charlie@example.com', age: 35 },
    { name: 'Dana', email: 'dana@example.com', age: 28 }
];

SELECT * FROM users WHERE age > 25;

New here? Start with the Quickstart on the official documentation site: nodedb.dev/docs.

Deployment Modes

Mode Use case
Origin (server) Full distributed database. Multi-Raft, io_uring, pgwire. Horizontal scaling.
Origin (local) Same binary, single-node. No cluster overhead.
NodeDB-Lite Embedded library for phones, browsers, desktops. CRDT sync to Origin.

NodeDB-Lite

All eight engines as an embedded library. Linux, macOS, Windows, Android, iOS, and browser (WASM, experimental).

  • Lite only -- local-first apps that don't need a server. Vector search, graph, FTS, documents, arrays, all in-process with sub-ms reads.
  • Lite + Origin -- offline-first with CRDT sync. Writes happen locally, deltas merge to Origin when online. Multiple devices converge regardless of order.
  • Same API -- the NodeDb trait is identical across Lite and Origin. Switch between embedded and server without changing application code.

See NodeDB-Lite for platform details and sync configuration.

Key Features

Write-time validation -- Typeguards enforce types, required fields, CHECK constraints, and DEFAULT/VALUE expressions on schemaless collections. Graduate to strict schema with CONVERT COLLECTION x TO document_strict.

Bitemporal queries -- System time (audit trail) and valid time (temporal semantics) across all engines. Query data as it existed in the past, or as it was valid on a past date. GDPR-compliant tile purge on array engine.

Multi-dimensional arrays -- Scientific computing with Z-order indexed tiles, tile-level compression, and bitemporal support. Combine with vector/graph/text in fused queries via cross-engine identity.

Real-time -- CDC change streams with consumer groups (~1-5ms latency). Streaming materialized views. Durable topics. Cron scheduler. LISTEN/NOTIFY. All powered by the Event Plane.

Programmability -- Stored procedures with IF/FOR/WHILE/LOOP. User-defined functions. Triggers (async, sync, deferred). SECURITY DEFINER.

Security -- RBAC with GRANT/REVOKE. Row-level security with $auth.* context across all engines. Hash-chained audit log. Multi-tenancy with per-tenant encryption. JWKS, mTLS, API keys.

Six wire protocols -- pgwire (PostgreSQL), HTTP/REST, WebSocket, RESP (Redis), ILP (InfluxDB line protocol), native MessagePack.

Tools

  • ndb -- Native CLI with TUI, syntax highlighting, and tab completion. Alternative to psql.
  • NodeDB Studio -- GUI client for managing collections, browsing data, and monitoring. (coming soon)
  • nodedb-bench -- Performance benchmarks against competing databases.

Documentation

The official documentation site is nodedb.dev/docs — start with the Quickstart.

In-repo references:

Contributing

We welcome bug fixes, engine improvements, new codecs and analyzers, test coverage, and documentation. Read CONTRIBUTING.md before opening a PR — NodeDB's Three-Plane execution model has hard rules that reviewers enforce.

Building from Source

For development or contributing:

git clone https://github.com/NodeDB-Lab/nodedb.git
cd nodedb
cargo build --release
cargo install cargo-nextest --locked  # one-time
cargo nextest run --all-features

Release Status

NodeDB Origin is in public beta as of v0.1.0 (2026-05-07). All eight engines are feature-complete and covered by tests. The wire protocols (pgwire, HTTP, native MessagePack, RESP, ILP, WebSocket) are stable — clients written against 0.1.0 will keep working through 1.0.

v0.1.0 — Beta (today). Build new products on it. The public surface (SQL dialect, wire protocols, configuration) is stable; expect internal changes (storage layout, on-disk format, replication internals) between minor releases. Patch and minor bumps will land as needed — if something requires a 0.2, we ship a 0.2. The two months between beta and 1.0 are deliberately for real workloads to surface edge cases we can't manufacture in-house.

v1.0.0 — Production-ready (target: 2026-07-07). What 1.0 guarantees:

  • API & SQL stability — semver from 1.0 onward. No breaking SQL or client-API changes within a major.
  • Wire protocol stability — pgwire, HTTP, native MessagePack, RESP, ILP, WebSocket frozen.
  • On-disk format stability — no breaking migrations within 1.x. Forward-compatible upgrades only.
  • Cluster & Raft stability — rolling upgrades supported within 1.x; no quorum-breaking changes.
  • Performance SLAs — published p50/p99 targets per engine, regression-gated in CI.
  • Security audit — third-party audit completed and findings remediated before 1.0 ships.
  • Storage, backup, and recovery — fully exercised under fault injection, sustained load, and crash-restart cycles.

Pre-1.0 versions may change internals between releases — those changes are critical-path work (storage, backup, security, recovery) that has to be hardened in real production conditions before we put a sta

Extension points exported contracts — how you extend this code

VectorCodec (Interface)
The dual-phase quantization codec trait. `Quantized` is the on-disk / in-memory packed form (one per vector). `Query` i [10 …
nodedb-codec/src/vector_quant/codec.rs
RerankCodec (Interface)
Object-safe trait for asymmetric rerank codecs. Each impl wraps an existing `nodedb-codec::VectorCodec` and exposes a un [7 …
nodedb-vector/src/rerank/codec.rs
TextAnalyzer (Interface)
Text analyzer trait: transforms raw text into searchable tokens. Implementations must produce the same tokens for equiv [8 …
nodedb-fts/src/analyzer/pipeline.rs
SqlCatalog (Interface)
Trait for looking up collection metadata during planning. Both Origin (via CredentialStore) and Lite (via the embedded [8 …
nodedb-sql/src/catalog.rs
RaftRpcHandler (Interface)
Trait for handling incoming Raft RPCs. Implementors receive a request [`RaftRpc`] and return the corresponding response [6 …
nodedb-cluster/src/transport/server.rs
SurrogateHwmPersist (Interface)
Pluggable persistence boundary. Tests substitute an in-memory store; production wires [`SystemCatalogHwm`]. [4 implementers]
nodedb/src/control/surrogate/persist.rs
LogStorage (Interface)
Trait for persistent Raft log storage. Implementors handle durability. The `nodedb-cluster` crate provides a production [2 …
nodedb-raft/src/storage.rs
SchemaOps (Interface)
Shared schema operations (eliminates duplication between Strict and Columnar). [2 implementers]
nodedb-types/src/columnar/schema.rs

Core symbols most depended-on inside this repo

to_string
called by 4172
nodedb-fts/src/codec/doc_id_map.rs
clone
called by 3225
nodedb/src/control/trigger/batch/collector.rs
expect
called by 1907
nodedb/src/control/promql/parser.rs
expect
called by 1553
nodedb-sql/src/parser/array_stmt/parse_impl.rs
sqlstate_error
called by 1515
nodedb/src/control/server/pgwire/ddl/transfer.rs
clone
called by 1266
nodedb-graph/src/csr/dense_array.rs
catalog_err
called by 986
nodedb/src/control/security/catalog/types.rs
iter
called by 968
nodedb/src/control/gateway/version_set.rs

Shape

Function 17,179
Method 7,790
Class 2,158
Enum 614
Interface 57

Languages

Rust100%

Modules by API surface

nodedb-query/src/msgpack_scan/reader.rs64 symbols
nodedb-columnar/src/predicate.rs63 symbols
nodedb/src/control/metrics/system/record.rs58 symbols
nodedb-sql/src/ddl_ast/parse/dispatch.rs51 symbols
nodedb-client/src/traits/core/trait_def.rs47 symbols
nodedb/src/engine/kv/index.rs46 symbols
nodedb-strict/src/decode.rs45 symbols
nodedb-vector/src/hnsw/graph/index.rs44 symbols
nodedb-types/src/value/core.rs44 symbols
nodedb-columnar/src/filter.rs44 symbols
nodedb-mem/src/governor.rs43 symbols
nodedb/src/engine/kv/sorted_index/tree.rs42 symbols

For agents

$ claude mcp add nodedb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact