Skip to content

nedb-engine v0.6.0 — RESP2 + Encryption + Snapshots

Choose a tag to compare

@Eth-Interchained Eth-Interchained released this 14 Jun 20:00
· 37 commits to master since this release

nedb-engine v0.6.0

The headline release. nedbd now speaks the Redis wire protocol natively — redis-cli, redis-benchmark, and every Redis client library connects without modification. Combined with AES-256-GCM at-rest encryption, Redis-style AOF persistence with snapshot checkpoints, and SQL/Redis/Python adapters, NEDB is a time-traveling, verifiable, encrypted Redis replacement.

pip install nedb-engine

# Start the server
NEDB_TMK=$(python3 -c "import os; print(os.urandom(32).hex())") \
NEDBD_RESP2_PORT=6379 nedbd

# Connect with redis-cli
redis-cli -p 6379 PING
redis-cli -p 6379 SELECT mydb
redis-cli -p 6379 HSET user:1 name Ada age 31
redis-cli -p 6379 EVAL "FROM users LIMIT 10" 0

What's new in v0.6.0

RESP2 Wire Protocol (NEDBD_RESP2_PORT)

Nedbd now runs a second TCP server speaking RESP2 (Redis Serialization Protocol v2). Every Redis client in every language connects natively.

  • All major command groups: SET/GET/DEL/EXISTS/INCR, HSET/HGET/HGETALL, SADD/SMEMBERS/SCARD, LPUSH/RPUSH/LRANGE, KEYS/TYPE/DBSIZE/FLUSHDB
  • SELECT <name> — switches to a named NEDB database (maps Redis's integer DBs to NEDB's named databases)
  • EVAL "<NQL>" 0 — NQL pass-through: run any NQL query and get rows back as JSON strings
  • Unsupported commands return clear -ERR with a roadmap note (EXPIRE/TTL, SUBSCRIBE/PUBLISH, MULTI/EXEC)

AES-256-GCM Encryption at Rest (NEDB_TMK)

Double-envelope key architecture: a random per-database DEK is wrapped by an external TMK.

  • Encrypts the AOF, snapshot.json, and BlobStore chunks
  • Auto backfill-encrypt: enabling NEDB_TMK on an existing unencrypted database rewrites the entire AOF encrypted in place (atomic) on first open
  • Key rotation via db.rewrap_key() — re-wraps the DEK without touching data
  • pip install nedb-engine now includes cryptography as a required dependency — encryption just works

Full changelog since v0.4.2

Version Feature
v0.5.0 Snapshot checkpoints (db.checkpoint()), TTL/expiry (ttl_s=, expire(), sweep()), GROUP BY aggregations (COUNT/SUM/AVG/MIN/MAX)
v0.5.1 nedbd auto-checkpoints all databases on SIGTERM/SIGINT — synchronized restart
v0.5.2 BlobStore (Cascade files) persisted in snapshots — get_file(), Merkle proofs survive restart
v0.5.3 AES-256-GCM encryption at rest — AOF, snapshots, blob chunks; NEDB_TMK env
v0.5.4 nedbd Manager wires NEDB_TMK — all databases encrypted when env is set
v0.5.5 cryptography bundled as required dep — encryption just works
v0.5.6 Auto backfill-encrypt existing plaintext AOF on first encrypted open
v0.5.7 Eager-open all databases at startup — backfill visible in boot log
v0.6.0 RESP2 wire protocol — redis-cli, redis-benchmark, any Redis client

Full feature set

  • Hash-chained append-only log — nonce-enforced replay protection, idempotency, MVCC time-travel (AS OF seq), verify() integrity
  • NQL — the NEDB Query Language: FROM t [AS OF n] [WHERE ...] [SEARCH "text"] [ORDER BY f] [TRAVERSE rel] [LIMIT n] [GROUP BY f COUNT|SUM|AVG|MIN|MAX]
  • Relations — first-class graph edges with O(1) traversal, time-travel aware
  • Indexes — eq (hash), ordered (bisect), full-text inverted — maintained incrementally
  • Cascade compression — content-defined chunking + dedup + zlib/LZMA tiers, Merkle proofs per file version
  • SQL adaptersql_exec(db, sql) translates SELECT/INSERT/UPDATE/DELETE to NQL/NEDB
  • Redis adapterRedisCompat(db).execute(cmd, *args) — 30+ commands
  • Auto-indexingAutoIndexDB(db, threshold=5) creates indexes from query patterns
  • nedbd — HTTP/JSON server daemon + RESP2 wire protocol; multi-database, bearer auth, CORS
  • Benchmark suitebench/benchmarks.py with reproducible baseline in bench/RESULTS.md

Install

pip install nedb-engine          # v0.6.0, universal wheel, all platforms
pip install --upgrade nedb-engine  # upgrade from any earlier version

Requirements

  • Python 3.8+
  • cryptography>=41 (bundled — no separate install needed)

License

Apache-2.0 · © INTERCHAINED, LLC — interchained.org · powered by AiAssist