Skip to main content

Module databases

Module databases 

Source
Expand description

Named per-tenant databases. Named databases: one MenteDB per tenant (a person, a team, an organization), each in its own directory with its own lock, indexes and files, so nothing is shared between them but the process.

The legacy default database lives at the data directory root and backs the unprefixed /v1/... routes. Named databases live under <data>/dbs/<name> and back /v1/db/{name}/.... They open on first use, and the least recently used idle handle is flushed and closed once more than max_open are open.

Structs§

Databases
Registry of the default database and the named ones.
DatabasesConfig
Limits for named databases.
Db
The database a request targets: {db} in /v1/db/{db}/..., otherwise the default. Checks the caller’s token scope and opens the database.

Constants§

DEFAULT_DB
Name of the database at the data directory root.

Functions§

validate_name
Database names are path segments: letters, digits, -, _ and ., not starting with ., at most 128 characters.