Pgx Pool + Pgbouncer with multiple read dbs #1899
-
We have a Pgbouncer that provides connection pooling to a master db as well as several read replicas We currently have a python application, that implements pooling logic to route certain requests to either the read replicas or the primary. We want to move this logic to a golang application, using pgx From glancing at various forums (like here #970) - it looks like we can (and should) use pgx pool + pgbouncer, but is there a recommended way for how we can ensure that certain requests go to the read replicas vs others going to the primary? Do we have to create a pool per db, then have some application logic to round robin across the read pools for example to select one? Or is there something more "built in" to use? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There is no builtin mechanism to direct queries to specific servers. |
Beta Was this translation helpful? Give feedback.
There is no builtin mechanism to direct queries to specific servers.