Repository navigation
v0.21.0 - Multiple databases in one daemon
·
4 commits
to 3e7c89d24df86a1d0760b9265062def1543f2079
since this release
v0.21.0 - Multiple databases in one daemon
NonoDB can now host multiple independent databases inside one daemon, on one
socket or TCP port. Each database is a separate LMDB environment under
NONODB_DATA/<database>/ with its own writer, read cache, automatic indexes,
maintenance loop, TTL/history/event settings, and persistent subscriptions.
There are no cross-database queries, joins, or transactions; isolation is the
point.
Highlights
- Database routing.
POST /{database}/v1/execand
POST /{database}/v1/watchselect a database. The existing/v1/execand
/v1/watchpaths remain aliases fordefault, so single-database clients
keep working. - Database management API.
list_databases,create_database, and
drop_database.defaultcannot be dropped, and a database cannot be dropped
while an active request is using it. - CLI support.
--db <name>/NONODB_DB,databases list|create|drop,
backup-all,restore-all,sync, and database selection for every
daemon-facing command. - GUI support. A database selector in the sidebar and a
Databasefield in
Advanced connection settings. The embedded GUI manages all databases through
one process and port. - Database-qualified authorization. Scopes such as
read:app1/orders,
write:app1/*, andadmin:app1/ordersrestrict access to one database.
Unqualified scopes still apply to every database;admin:dbremains
instance-wide. - Lifecycle controls. Databases open lazily, idle environments can be
evicted, andNONODB_MAX_OPEN_DATABASES(default64) bounds open writers.
Unknown databases return404 not_found; exhausting all open slots returns
503 database_limit. - Per-database state. Writers, read caches, auto-index state, maintenance,
snapshots, TTL, history, events, subscriptions, and map settings are all
scoped to one database. - Backup and restore.
backup/restoretarget one database;
backup-all/restore-allcopy a whole instance with an instance manifest.
Snapshot directories are created per database. - Official clients. Python, Rust, Node.js, and Go accept an explicit
database and fall back toNONODB_DB, thendefault. - Automatic migration. A legacy root-level
data.mdbis moved to
default/data.mdbon startup. If both layouts exist, the daemon refuses to
guess and exits with a clear error.
Also in this release
- Per-request write durability:
full(default),relaxed, and opt-in
unsafe, plus thesyncoperation andnonodb-cli sync. Durability changes
fsync behavior only; writes remain atomic. Group commit uses the strictest
mode in the batch, and background maintenance always usesfull. - Database-aware cursors, live subscriptions, metrics, and auth checks.
- Updated README, GUI screenshots, video, architecture, API, auth, CLI,
operations, backup, client, and multi-database documentation.
Upgrade notes
- Stop the daemon and take a backup before upgrading.
- The first
0.21.0start migrates a legacydata.mdb,lock.mdb, and
auto-index.jsonintodefault/. Ifdefault/data.mdbalso exists, startup
aborts instead of overwriting either copy. - Existing
/v1/execand/v1/watchclients continue to use thedefault
database. No URL change is required for single-database deployments. - Unqualified scopes such as
read:ordersstill apply to every database. Add a
database prefix to restrict a principal in a multi-database deployment. - For backups of all databases, use
nonodb-cli backup-all;backupnow
targets one selected database. Restore withrestore-allor with--db. - There are no cross-database transactions. If an application requires a
consistent recovery point across databases, quiesce writes during
backup-all.
Configuration
| Variable | Default | Purpose |
|---|---|---|
NONODB_MAX_OPEN_DATABASES |
64 |
Maximum simultaneously open LMDB environments/writers |
NONODB_DB |
default |
Database selected by CLI and official clients |
NONODB_ALLOW_UNSAFE_WRITES |
unset | Enables opt-in durability:"unsafe" |
Reserved database names: v1, healthz, metrics, gui, db, api.
Validation
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace --lockedpython3 scripts/multi_database_test.pypython3 scripts/multi_database_features_test.pypython3 scripts/durability_test.py
Assets
Release workflow builds Linux x86_64, macOS x86_64, macOS arm64, and Windows
x86_64 archives. Each archive has a SHA-256 checksum file. Docker images are
published as ghcr.io/essmos/nonodb:0.21.0, :0.21, and :latest.
Full changelog: v0.20.0...v0.21.0