Re: Proposal: Implement failover on libpq connect level. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal: Implement failover on libpq connect level.
Date
Msg-id 30615.1439991692@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal: Implement failover on libpq connect level.  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Responses Re: Proposal: Implement failover on libpq connect level.  (Andres Freund <andres@anarazel.de>)
Re: Proposal: Implement failover on libpq connect level.  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Albe Laurenz <laurenz.albe@wien.gv.at> writes:
> Victor Wagner wrote:
>> It would just take a bit more time for client and a bit more load for
>> server - to make sure that this connection is read-write by
>> issuing
>> show transaction_read_only
>> statement before considering connection useful.

> That's not very comfortable, and a lot of middleware software won't easily
> learn the trick.

That sort-of ties into what seems to me the main objection to this
proposal, namely that there is already a way to do this sort of thing:
DNS-based load balancing.  All the clients think they connect to
db.mycompany.com, but which server they actually get is determined by
what IP address the DNS server tells them to use.

This is a technology that is very well established, known to every
large-site admin, and usable for every Internet-based service.  Even if
libpq had its own nonstandard way of doing something similar, the site
admins would probably still need to use DNS load balancing for other
services.  In fact, they'd still need to use DNS balancing for Postgres,
because not everything connects with libpq (think JDBC for instance).

So I think we ought to reject this proposal, full stop.  I see no
reason to re-invent this wheel, and there are good reasons not to.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Bug? ExecChooseHashTableSize() got assertion failed with crazy number of rows
Next
From: Andres Freund
Date:
Subject: Re: Proposal: Implement failover on libpq connect level.