Databroker Storage Settings
The databroker service manages all persistent state within Pomerium. These settings control how the databroker service will store this state.
For more information on the databroker service see Persistence & Data storage.
Databroker Storage Type
Databroker Storage Type sets the backend storage type:
memory
— data is stored in main memorypostgres
— data is stored in an external PostgreSQL database
The in-memory option is sufficient for single-replica Pomerium deployments. A PostgreSQL database is required when running multiple replicas of Pomerium, in order to ensure that all replicas share a consistent view of the application state.
For more information see Persistence & Data storage: Backends.
How to configure
- Core
- Enterprise
- Kubernetes
Config file keys | Environment variables | Type | Default |
---|---|---|---|
databroker_storage_type | DATABROKER_STORAGE_TYPE | string | memory |
Examples
databroker_storage_type: postgres
DATABROKER_STORAGE_TYPE=postgres
databroker_storage_type
is a bootstrap configuration setting and is not configurable in the Console.
See Kubernetes Storage reference for more information.
Databroker Storage Connection String
Databroker Storage Connection String tells Pomerium how to connect to an external PostgreSQL database. This connection string may be provided directly in the configuration or read from a file.
This setting is required when the storage type is set to postgres
.
How to configure
The connection string may be provided in either keyword/value format or URI format:
host=localhost port=5432 dbname=mydb user=mydbuser
postgresql://[username:password@]host:port/[dbname][?paramspec]
See the PostgreSQL documentation for more information on the available options.
- Core
- Enterprise
- Kubernetes
Config file keys | Environment variables | Type |
---|---|---|
databroker_storage_connection_string | DATABROKER_STORAGE_CONNECTION_STRING | string |
databroker_storage_connection_string_file | DATABROKER_STORAGE_CONNECTION_STRING_FILE | string (file path) |
Examples
databroker_storage_connection_string: postgresql://postgres:postgres@database/postgres?sslmode=disable
databroker_storage_connection_string_file: /run/secrets/db_connection_string
DATABROKER_STORAGE_CONNECTION_STRING=postgresql://postgres:postgres@database/postgres?sslmode=disable
DATABROKER_STORAGE_CONNECTION_STRING_FILE=/run/secrets/db_connection_string
databroker_storage_connection_string
is a bootstrap configuration setting and is not configurable in the Console.
See Kubernetes Storage reference for more information.
When using multiple hosts make sure to specify target_session_attrs=read-write
so that the Databroker does not attempt to write to a read-only replica.