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 memoryfile
— data is stored in a local directorypostgres
— 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 which directory to use for the file
storage type or how to connect to an external PostgreSQL database for the postgres
storage type. 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 file
or postgres
.
How to Configure the File Storage Type
The connection string should use the file://
schema followed by a path to indicate the directory to store files:
- Core
- Enterprise
- Kubernetes
databroker_storage_connection_string: file:///var/pomerium/databroker
DATABROKER_STORAGE_CONNECTION_STRING=file:///var/pomerium/databroker
databroker_storage_connection_string
is a bootstrap configuration setting and is not configurable in the Console.
See Kubernetes Storage reference for more information.
How to Configure the Postgres Storage Type
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.
Clustered Databroker
As of v0.31, Pomerium supports an experimental clustered databroker. The clustered databroker consists of multiple databroker instances. One of those instances is the cluster leader and all the other instances are cluster followers. Databroker commands sent to a follower are forwarded to the leader where they are handled. In addition the clustered databroker supports automatic failure recovery via Raft leader election.
The primary goal of clustering is to provide resilience and high availability, especially for production deployments. By running multiple databroker instances in a cluster, Pomerium can automatically recover from a single node failure in seconds, minimizing downtime and preventing data loss.
This creates a self-healing system that doesn't require manual intervention to recover. It's particularly useful when using the file
storage backend, as it replicates data across nodes to prevent data loss if a single node goes down.
Consider enabling clustering if you are:
- Running a high-availability production environment where minimizing downtime is critical.
- Using the
file
storage backend and need a fault-tolerant setup that can survive a single node failure. - Deploying across multiple regions or availability zones to reduce latency.
- Seeking an infrastructure-agnostic recovery solution that works consistently across Kubernetes, VMs, and bare metal deployments.
Each databroker instance should have the same shared secret, but its own node ID and its own storage backend. Though not recommended, if the postgres
storage backend is used, the instances should not share the same Postgres database.
The following settings are supported by the clustered databroker:
Databroker Cluster Node ID
The Databroker Cluster Node ID sets the databroker's node ID. It should correspond to an entry in the Databroker Cluster Nodes option, and it should be unique for each instance of the databroker.
- Core
- Enterprise
- Kubernetes
Config file keys | Environment variables | Type |
---|---|---|
databroker_cluster_node_id | DATABROKER_CLUSTER_NODE_ID | string |
databroker_cluster_node_id: node-1
DATABROKER_CLUSTER_NODE_ID=node-1
databroker_cluster_node_id
is a bootstrap configuration setting and is not configurable in the Console.
databroker_cluster_node_id
is not supported in Kubernetes.
Databroker Cluster Leader ID
The Databroker Cluster Leader ID explicitly sets the leader to one of the databroker instances in the Databroker Cluster Nodes option. When this option is used, the Raft leader elector will not be used and a failure of the leader will not result in automatic failure recovery.
This is for advanced use cases where manual control over leadership is required. Setting a static leader disables the automatic "self-healing" capability of the cluster.
- Core
- Enterprise
- Kubernetes
Config file keys | Environment variables | Type |
---|---|---|
databroker_cluster_leader_id | DATABROKER_CLUSTER_LEADER_ID | string |
databroker_cluster_leader_id: node-2
DATABROKER_CLUSTER_LEADER_ID=node-2
databroker_cluster_leader_id
is a bootstrap configuration setting and is not configurable in the Console.
databroker_cluster_leader_id
is not supported in Kubernetes.
Databroker Cluster Nodes
The Databroker Cluster Nodes option defines the cluster topology of a clustered databroker. It consists of a list of node definitions, each of which has an id
, grpc_address
and raft_address
. Each instance of the databroker that is part of the cluster should have the same cluster nodes definition. To ensure quorum and prevent split-brain scenarios, a cluster using the Raft leader elector requires an odd number of nodes (a minimum of 3 is recommended).
- Core
- Enterprise
- Kubernetes
Config file keys | Environment variables | Type |
---|---|---|
databroker_cluster_nodes | DATABROKER_CLUSTER_NODES | string |
databroker_cluster_nodes:
- id: node-1
grpc_address: http://node-1:5443
raft_address: node-1:5999
- id: node-2
grpc_address: http://node-2:5443
raft_address: node-2:5999
- id: node-3
grpc_address: http://node-3:5443
raft_address: node-2:5999
databroker_cluster_nodes
is a bootstrap configuration setting and is not configurable in the Console.
databroker_cluster_nodes
is not supported in Kubernetes.
Databroker Raft Bind Address
To use the Raft leader elector, each node needs to set a raft bind address which will be used for TCP connections between each instance. This communication is automatically encrypted using TLS with certificates derived from the shared secret. The raft_address
in the databroker_cluster_nodes
option for this node should correspond to this address.
- Core
- Enterprise
- Kubernetes
Config file keys | Environment variables | Type |
---|---|---|
databroker_raft_bind_address | DATABROKER_RAFT_BIND_ADDRESS | string |
databroker_raft_bind_address: :5999
DATABROKER_RAFT_BIND_ADDRESS=:5999
databroker_raft_bind_address
is a bootstrap configuration setting and is not configurable in the Console.
databroker_raft_bind_address
is not supported in Kubernetes.