Skip to content

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. This means that 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
# Configure the default data source
dt.datasource.url=jdbc:postgresql://localhost:5432/dtrack
dt.datasource.username=dtrack
dt.datasource.password=dtrack
dt.datasource.pool.enabled=true
dt.datasource.pool.max-size=20

# Configure the secret management data source
dt.datasource.secretmgt.url=jdbc:postgresql://localhost:5432/dtrack
dt.datasource.secretmgt.username=secrets
dt.datasource.secretmgt.password=secrets
dt.datasource.secretmgt.pool.enabled=true
dt.datasource.secretmgt.pool.max-size=5

# Configure secret management to use separate data source
dt.secret-management.provider=database
dt.secret-management.database.datasource.name=secretmgt

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.

Connection Pool Properties

The following properties control local connection pooling per data source:

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.