pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Adams <bruce.adams@acm.org>
To: pgsql-jdbc@postgresql.org
Subject: Re: Failover Datasource?
Date: Thu, 16 Jun 2011 16:27:11 -0400
Message-ID: <4DFA671F.2050005@acm.org> (raw)
In-Reply-To: <itdn5g$eu7$1@dough.gmane.org>
References: <4DFA5A86.9030301@acm.org>
	<itdn5g$eu7$1@dough.gmane.org>

Both pgBouncer and pgPool add another process between the client and the 
server.

Their primary goal appears to be connection pooling. My Java application 
server (Apache Tomcat) is already pooling database connections.

Adding another chunk of middle-ware adds another thing I have to worry 
about failing and is likely to slow things down.

If I write code to add failover support into the JDBC driver, what are 
my chances of getting that patch into the next release?

- Bruce

On 06/16/2011 03:56 PM, Thomas Kellerer wrote:
> Bruce Adams wrote on 16.06.2011 21:33:
>> I, too, would like to be able to specify multiple Postgres servers in 
>> a JDBC connection URL. I want the client application to prefer 
>> connecting to a master database, but automatically failover to a 
>> replica when the master is unavailable.
>>
>> Many other databases have this feature in their JDBC drivers. For 
>> example a MySQL JDBC URL can have a comma separated list of host:port 
>> in the URL, like this:
>> jdbc:mysql://master:3306,slave:3306/databasename
>>
>> Is there some other way to setup client failover?
>>
>> Writings I've found for Postgres always talk about a proxy, or even 
>> multiple proxies (!), between the Java client and the real database 
>> servers. I'm trying to build a robust system; any additional layer is
>> yet another thing that can break. I don't mind having the application 
>> see errors in a failover, I just want some measure of recovery to be 
>> automatic, even if the automatic recovery is to a read-only replica.
>>
>> I plan to use streaming replication in PostgreSQL 9.0 for the hot 
>> backup(s).
>
> pgBouncer or pgPool can both do that as far as I know
>
> http://wiki.postgresql.org/wiki/PgBouncer
> http://pgpool.projects.postgresql.org/
>
> Thomas



view thread (13+ messages)  latest in thread

Message-ID: <4DFA671F.2050005@acm.org>
Permalink:  ../4DFA671F.2050005@acm.org/
Also on:    postgresql.org/message-id/4DFA671F.2050005@acm.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: bruce.adams@acm.org
  Subject: Re: Failover Datasource?
  In-Reply-To: <4DFA671F.2050005@acm.org>
  References: <4DFA5A86.9030301@acm.org> <itdn5g$eu7$1@dough.gmane.org> <4DFA671F.2050005@acm.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox