Skip to main content

Crate nedb_engine

Crate nedb_engine 

Source
Expand description

NEDB v2 — Content-addressed DAG storage engine.

Architecture:

objects/ — content-addressed, encrypted, BLAKE2b-verified nodes (immutable) indexes/ — id index (file-per-doc) + sorted indexes (BTreeMap, in-memory) graph/ — typed DAG edges (filesystem entries) MANIFEST — BLAKE2b Merkle root of all collection HEADs

Properties:

  • Uncorruptable: atomic writes (tmp→rename), hash verification on read
  • Parallel: no global lock on writes; each doc has its own index file
  • Instant cold start: no AOF replay; rebuild sorted indexes in parallel
  • Self-healing: migrate.rs handles v1→v2 on first startup
  • Tamper-evident: BLAKE2b chain from MANIFEST → collection heads → nodes

Re-exports§

pub use store::Dek;
pub use store::Node;
pub use store::ObjectStore;
pub use index::IdIndex;
pub use index::OrderedValue;
pub use index::SortedIndexes;
pub use graph::GraphStore;
pub use db::Db;

Modules§

branch
Branching — a line of history that forked from a known sequence.
cause
Qualified cause references — naming a causal ancestor that lives in ANOTHER object store.
conflict
Merge conflicts, as data.
constitution
The Constitution — what this engine guarantees, in a form a client can check.
db
Main DAG database — coordinates ObjectStore, IdIndex, SortedIndexes, GraphStore.
diff
Logical difference between two points in history.
exit
Durable-mode auto-flush-on-exit.
graph
DAG edge store — typed directed edges between node hashes.
index
Index store for NEDB v2.
merge
Merge — replaying a branch into a destination as NEW history.
migrate
Automatic v1 → v2 DAG migration.
namespace
Collection identity — what it means for a collection to EXIST.
nql
NQL (NEDB Query Language) parser and executor for v2 DAG storage.
pgcatalog
pg_catalog and information_schema as REAL QUERYABLE TABLES.
pgwire
A PostgreSQL wire-protocol endpoint for NEDB — reads and writes.
refs
Named pointers into history: mutable refs and immutable tags.
root
state_root_v1 — one hash that commits to what the database currently says.
segment
segment.rs — NEDB v3 packed object substrate.
server
nedbd v2 HTTP server — same /v1/databases/* API surface as v1. Drop-in replacement: Vision, itsl_mirror, all existing clients work unchanged.
sqljoin
Join strategy: nested loop (the reference) and hash (the fast path).
sqlplan
The execution plan — what the evaluator actually did, and how to render it.
sqlpush
Predicate pushdown — conservative, and narrower than the phrase sounds.
sqlselect
A real SQL SELECT engine — expressions, aliases, CASE, functions, joins.
store
Content-addressed object store — the foundation of NEDB v2.