Skip to main content
Version: vNext (upcoming release)

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 memory
  • postgres — 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

Config file keysEnvironment variablesTypeDefault
databroker_storage_typeDATABROKER_STORAGE_TYPEstringmemory

Examples

databroker_storage_type: postgres
DATABROKER_STORAGE_TYPE=postgres

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.

Config file keysEnvironment variablesType
databroker_storage_connection_stringDATABROKER_STORAGE_CONNECTION_STRINGstring
databroker_storage_connection_string_fileDATABROKER_STORAGE_CONNECTION_STRING_FILEstring (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
tip

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.