Data sources¶
Data sources are logical objects through which database connections can be acquired.
Property Format¶
Data sources are configured using properties in the following format:
dt.datasource.<name>.<property>=<value>
For available properties, and their environment variable equivalents, refer to the configuration reference.
Tip
When <name> is omitted, default is assumed, so
dt.datasource.url and dt.datasource.default.url are treated equally.
The default data source is required. It serves the REST API
and the vast majority of background processing.
Certain features accept a data source name instead of database connection details,
allowing them to use a dedicated connection pool. For example, the
database secret management provider
via dt.secret-management.database.datasource.name.
Multiple data sources
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Note
Data sources are instantiated on first use. You can configure as many data sources as you like, but unless they're being used by a feature, they will not be created.
Privileges¶
The user configured for the default data source must hold privileges to perform
DDL against the Dependency-Track schema. The API server issues DDL during normal
operation:
- On startup, by running init tasks when configured to use the
defaultdata source (schema migrations, extension creation, partition setup, seeding). - At runtime, by creating and dropping table partitions to manage time series metrics retention.
Warning
Configuring an unprivileged user for the default data source is not supported.
A user restricted to SELECT, INSERT, UPDATE, and DELETE will cause runtime
failures even after a successful startup.
Grant the user ownership of the database, or of the Dependency-Track schema within it.
Connection Pool Properties¶
The following properties control local connection pooling per data source:
dt.datasource.<name>.pool.enableddt.datasource.<name>.urldt.datasource.<name>.usernamedt.datasource.<name>.passworddt.datasource.<name>.password-filedt.datasource.<name>.pool.max-sizedt.datasource.<name>.pool.min-idledt.datasource.<name>.pool.max-lifetime-msdt.datasource.<name>.pool.idle-timeout-ms
When deploying multiple instances, the total number of connections across all pools
must not exceed the PostgreSQL max_connections limit
(default: 100).
For centralised connection pooling with PgBouncer, see the database configuration guide.