Positioning and architecture · Engineering
Multiple databases in one daemon
How NonoDB isolates databases without separate processes or ports, and where the isolation stops.
A small deployment often has more than one application, or one application with clearly separated tenants. Running a separate database server for each one defeats the point of a small database. NonoDB lets one daemon host multiple independent databases under a single data root.
The important word is independent. Each database is its own LMDB environment with its own files, writer thread, cache, indexes, TTL/history/event settings, and subscriptions. There are no cross-database transactions.
Layout
NONODB_DATA is the instance root:
/var/lib/nonodb/├── default/│ ├── data.mdb│ ├── lock.mdb│ └── auto-index.json└── app1/ ├── data.mdb ├── lock.mdb └── auto-index.jsonThe reserved default database always exists. A legacy single-database layout is migrated on startup, but only when the target does not already exist. If both the old and new files are present, the daemon refuses to guess.
Routing
The database name is a path prefix:
POST /{database}/v1/execPOST /{database}/v1/watch/v1/exec is an alias for /default/v1/exec. Clients can also select a database at construction time, and the official Python, Node.js, Go, and Rust clients read NONODB_DB.
Database names are case-sensitive, 1–64 characters, start with an ASCII letter or digit, and may contain letters, digits, _, and -. Names such as v1, healthz, metrics, gui, db, and api are reserved.
Management
The API has list_databases, create_database, and drop_database. Listing is filtered by the caller’s scopes: a per-database administrator sees only its own database, while admin:db and *:* see the instance.
Dropping a database stops its writer and maintenance thread, then removes the files. It fails while another active request has the database selected. The default database cannot be dropped.
The CLI mirrors the API:
nonodb-cli databases listnonodb-cli databases create app1nonodb-cli --db app1 find orders '{}'The embedded GUI has a database selector and sends requests to the matching path prefix. Backups can be taken per database or for the whole instance with backup-all / restore-all.
Isolation, not distributed transactions
Each database has its own writer and cache, so a slow write in app1 does not block default. Reads and writes in different databases are independent. That is useful for multi-tenant applications, separate environments on one host, or a small shared service.
It is not a distributed database. There are no cross-database transactions, no cross-database joins, and no atomic PITR across all databases. If a business operation must update two databases atomically, it belongs in one database or needs application-level coordination.
Branching and backups
A database is a normal LMDB directory, so operations stay understandable. nonodb-cli --db app1 backup copies one database; backup-all copies the whole instance with a manifest. branch creates an independent writable copy for CI or a migration rehearsal without changing the source.
The branch is not a view. It gets its own writer, lock file, indexes, history, TTL metadata, and copied sidecars. On a filesystem with reflink or clonefile support, the copy is cheap; otherwise the CLI falls back to a full copy. Use --from-snapshot when the daemon should stay online.
This is the practical reason to keep databases separate instead of using collection prefixes for tenants. A tenant database can be backed up, branched, restored, or dropped as a unit. The application still needs to map tenants to databases, but the operational boundary is real.
Resource limits
The daemon keeps a bounded number of LMDB environments open. NONODB_MAX_OPEN_DATABASES defaults to 64; idle databases can be evicted. Each open database has a writer thread and cache, so “many small databases” is not free, but it is much cheaper than many server processes.
The multiple databases guide covers routing, scopes, branching, backup, and restore in detail. If you are designing a multi-tenant deployment, read the auth guide next: database-qualified scopes are what make isolation enforceable, not just a naming convention.