I am currently working on a PostgreSQL cluster setup that spans across multiple data centers. We use a setup with HAProxy load balancers in each data center to manage local and cross-data center traffic. Our goal is to optimize traffic within local data centers while maintaining failover capabilities between them.
To better support our multi-data center setup, we are looking into enhancing our automation to provide more granular control over database endpoint configurations and load balancing. Specifically, we are interested in:
Endpoint Configuration in Patroni REST API: We need the automation to support custom configurations for Patroni REST API endpoints. This is crucial for defining different behaviors based on the data center context, such as directing read traffic primarily within the same data center.
Custom Tag Support for Load Balancing: We would like to introduce the capability to add custom tags in the endpoint configurations. For example, by adding datacenter=<name> or region=<name> to the endpoint configuration, we could ensure that load balancing is only considering replicas within the same local data center, thereby excluding servers from a remote data center or region.
This feature would address scenarios where a multi-data center setup starts from one location and expands, allowing for a more flexible and efficient database management strategy across different geographical locations.
The desired outcome is to allow for configuration like the following in the automation setup:
GET /replica?datacenter=dc1 or /replica?datacenter=dc2 for directing read traffic based on the data center.
Support for defining custom tags at the host or host group level in the automation scripts, which would then be used to filter eligible nodes for load balancing.
This enhancement would significantly improve our database management's efficiency and flexibility across multiple data centers, ensuring better performance and failover support.
Consider sponsoring the project via GitHub or Patreon
I am currently working on a PostgreSQL cluster setup that spans across multiple data centers. We use a setup with HAProxy load balancers in each data center to manage local and cross-data center traffic. Our goal is to optimize traffic within local data centers while maintaining failover capabilities between them.
To better support our multi-data center setup, we are looking into enhancing our automation to provide more granular control over database endpoint configurations and load balancing. Specifically, we are interested in:
Endpoint Configuration in Patroni REST API: We need the automation to support custom configurations for Patroni REST API endpoints. This is crucial for defining different behaviors based on the data center context, such as directing read traffic primarily within the same data center.
Custom Tag Support for Load Balancing: We would like to introduce the capability to add custom tags in the endpoint configurations. For example, by adding
datacenter=<name>
orregion=<name>
to the endpoint configuration, we could ensure that load balancing is only considering replicas within the same local data center, thereby excluding servers from a remote data center or region.This feature would address scenarios where a multi-data center setup starts from one location and expands, allowing for a more flexible and efficient database management strategy across different geographical locations.
The desired outcome is to allow for configuration like the following in the automation setup:
/replica?datacenter=dc1
or/replica?datacenter=dc2
for directing read traffic based on the data center.Documentation: https://patroni.readthedocs.io/en/latest/rest_api.html#health-check-endpoints
This enhancement would significantly improve our database management's efficiency and flexibility across multiple data centers, ensuring better performance and failover support.
Consider sponsoring the project via GitHub or Patreon