Re: Connection pooler / LDAP auth / Load Balancing on read-only queries

From: Achilleas Mantzios - cloud <a(dot)mantzios(at)cloud(dot)gatewaynet(dot)com>
To: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Connection pooler / LDAP auth / Load Balancing on read-only queries
Date: 2024-07-04 14:28:29
Message-ID: 1e2678b7-8ab5-c2d4-89e1-bcfe7ea8ddcb@cloud.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


On 7/4/24 15:47, Scott Ribe wrote:
>> Hello
>>
>> pgpool does a great job at that. pgpool does load balancing to the first statement that is considered a write statement, for that point on, the rest of the transaction is routed to the primary.
>>
>> But the question here is how to achieve all of the aforementioned features, of all those great tools combined, or ideally combined in one.
> AFAIK, pgpool still doesn't do what I'd consider true pooling, that is MxN multiplexing of connections. (Every client connection has a connection from pgpool -> server, but the server connections become available for resuse when clients disconnect.)
Yes, unfortunately, pgbouncer shines in this department.
>
> And to me, the mechanism for routing queries in a transaction is highly suspect, as the initial reads vs later writes could potentially be using different snapshots of the data. (There is a safeguard there, involving looking at replication delay, but that's not a transactional guarantee, just "here's how out of date the replica can be to get read queries".)

It seems pgpool supports snapshot_isolation mode, which is similar to
streaming_replication, + it adds visibility consistency, but at the
expense of running with default_transaction_isolation = 'repeatable
read' :
https://www.pgpool.net/docs/latest/en/html/runtime-config-running-mode.html#GUC-SNAPSHOT-ISOLATION-MODE

Read latency is an issue with asynchronous physical replication, but
then again, the problem is there no matter the HA/pooling solution.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Stepan Neretin 2024-07-04 16:45:37 How decode to normal view t_attrs in heap_page_item_attrs?
Previous Message Scott Ribe 2024-07-04 12:47:47 Re: Connection pooler / LDAP auth / Load Balancing on read-only queries