Connection-fail-over

From: Mikko Tiihonen <mikko(dot)tiihonen(at)nitorcreations(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Connection-fail-over
Date: 2012-05-17 17:00:43
Message-ID: 4FB52EBB.4060309@nitorcreations.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

I have been thinking of adding connection fail-over support to the jdbc driver. What this means is that there would be a way to specify more than host:port pair
to connect to. This will become handy with high-availability installations.

Currently the limitation of hostname means that there has to be a virtual ip address that is moved with the active backend, which is a complex solution that can
break.

If we have list of hostname:port pairs we just have to make sure that only the master database allows connections from the jdbc clients.

Before I implement this I would like to first ask opinions on how the connection url should look like.

Current syntax is:

jdbc:postgresql://hostname:port/database?options

Which of these should we support:

A) jdbc:postgresql://hostname1:port1,hostname2:port2/database?options
B) jdbc:postgresql://hostname1,hostname2:port/database?options
C) jdbc:postgresql://hostname1:port1/database?&failoverhost=hostname2:port2&options
D) some other?

-Mikko

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Heikki Linnakangas 2012-05-17 17:23:39 Re: Connection-fail-over
Previous Message Jesper Pedersen 2012-05-17 16:43:53 Pull request: Use .valueOf()