Exposing replica nodes in Percona Operator for PostgreSQL

This is a micro blog post about a feature that I failed to praise in Percona Operator for PostgreSQL – ability to expose replicas separately.

The problem is that when you connect to the PostgreSQL cluster through pgBouncer, it routes all you reads an…


This content originally appeared on DEV Community and was authored by Sergey Pronin

This is a micro blog post about a feature that I failed to praise in Percona Operator for PostgreSQL - ability to expose replicas separately.

The problem is that when you connect to the PostgreSQL cluster through pgBouncer, it routes all you reads and writes to the primary.

Percona Operator for PostgreSQL - pgbouncer connection

So in that case the role pgBouncer plays here:

  1. Pool connections
  2. Provide single entry point to connect to
  3. In case of primary failure reroute quesries to the new primary

But we heard it a few times, that it is not good enough. Sometimes you want to have your application to scale reads and not hammer your primary.

Starting version 2.4.0 we allow users to expose replica nodes separately. It is happening by default for all clusters already. You can see -replicas service:

NAME                TYPE           CLUSTER-IP      EXTERNAL-IP    PORT(S)          AGE
cluster1-replicas   ClusterIP      10.118.234.58   <none> 
5432:31812/TCP   11h

To change the service type, user should alter spec.expose section:

  expose:
...
  exposeReplicas:
    type: LoadBalancer

With this exposure your application connection is going to look like this:

Percona Operator for PostgreSQL - exposing replicas

Percona offers various software options to run PostgreSQL:

And of course if you are looking for help, support, professional support - let our team know: https://www.percona.com/about/contact


This content originally appeared on DEV Community and was authored by Sergey Pronin


Print Share Comment Cite Upload Translate Updates
APA

Sergey Pronin | Sciencx (2024-10-24T20:53:33+00:00) Exposing replica nodes in Percona Operator for PostgreSQL. Retrieved from https://www.scien.cx/2024/10/24/exposing-replica-nodes-in-percona-operator-for-postgresql/

MLA
" » Exposing replica nodes in Percona Operator for PostgreSQL." Sergey Pronin | Sciencx - Thursday October 24, 2024, https://www.scien.cx/2024/10/24/exposing-replica-nodes-in-percona-operator-for-postgresql/
HARVARD
Sergey Pronin | Sciencx Thursday October 24, 2024 » Exposing replica nodes in Percona Operator for PostgreSQL., viewed ,<https://www.scien.cx/2024/10/24/exposing-replica-nodes-in-percona-operator-for-postgresql/>
VANCOUVER
Sergey Pronin | Sciencx - » Exposing replica nodes in Percona Operator for PostgreSQL. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/24/exposing-replica-nodes-in-percona-operator-for-postgresql/
CHICAGO
" » Exposing replica nodes in Percona Operator for PostgreSQL." Sergey Pronin | Sciencx - Accessed . https://www.scien.cx/2024/10/24/exposing-replica-nodes-in-percona-operator-for-postgresql/
IEEE
" » Exposing replica nodes in Percona Operator for PostgreSQL." Sergey Pronin | Sciencx [Online]. Available: https://www.scien.cx/2024/10/24/exposing-replica-nodes-in-percona-operator-for-postgresql/. [Accessed: ]
rf:citation
» Exposing replica nodes in Percona Operator for PostgreSQL | Sergey Pronin | Sciencx | https://www.scien.cx/2024/10/24/exposing-replica-nodes-in-percona-operator-for-postgresql/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.