Database¶
Console stores its data in a single database that you select at startup. Three backends are supported behind identical repository interfaces, so the application behaves the same regardless of which one is in use — switching is a configuration change only, with no code change.
- SQLite — the default. Embedded, on-disk, zero setup.
- Postgres — a configurable client/server SQL backend.
- MongoDB — a configurable NoSQL backend.
Selecting the backend¶
Set DB_PROVIDER (or db.provider in config.yml):
DB_PROVIDER |
Backend | DB_URL |
|---|---|---|
sqlite (default; also when unset) |
Embedded SQLite | ignored — uses a local file |
postgres |
PostgreSQL | required — postgres://user:pass@host:5432/dbname |
mongo |
MongoDB | required — mongodb://user:pass@host:27017/?authSource=admin |
Notes:
DB_URLis required forpostgresandmongo, and ignored forsqlite(which always uses its embedded on-disk file). Withpostgresormongoselected but noDB_URL, Console fails fast at startup rather than silently falling back to SQLite.DB_POOL_MAX(db.pool_max, default2) is honored by the SQL backends only. The MongoDB driver manages its own connection pool viaDB_URLoptions such asmaxPoolSize.- Data does not migrate automatically between backends. Each backend stores its data independently.
See Configuration for the full list of DB_* variables.