PostgreSQL Clustering: HA-JDBC

A little while ago I posted about PostgreSQL clustering and I said that I was going to evaluate HA-JDBC as an option.

The reason I wanted to use HA-JDBC is that I was looking for a no-coding required solution for seamless fail over. (Similar to Oracle RAC) for PostgreSQL.

I’ll be using a Shared Disk / Heartbeat cluster on the server side, however when the node fails the application will register an error, which is undesirable.

After doing more research it’s been determined that HA-JDBC won’t work.

It seems that HA-JDBC is, at best, a SQL replicator, where you have 2 active nodes and HA-JDBC will perform inserts and updates across both databases to keep them in sync. This is fine if you’re not using the “serial” data type in PostgreSQL, Triggers, Functions, time based default values, etc. Using any sort of trigger, the code fires independently on insert and you end up getting out of sync databases.

Another reason why HA-JDBC won’t work is that if a node is un-reachable HA-JDBC removes it from consideration. So your 2nd “standby” when it becomes active won’t be considered by HA-JDBC without some manual intervention.

And finally, I’d advise steering away from HA-JDBC at this point even if the above works for you. I posted a few clarifying questions regarding the above to both the HA-JDBC forums and their mailing list and received no response. If your business is looking into true high availability for their servers you need to choose all of your components with care. A non-responsive community either means the project is dead, or un-caring, both of which are unacceptable when you’re looking into HA solutions.

Finally got a response from Paul Ferraro, Nice guy, very helpful posted below:

Sorry for the slow response...

HA-JDBC is not the right tool for this job.  HA-JDBC is an
*alternative* to shared disk failover - it was not designed
to be used in concert with it.  Instead, you want something
like JBoss HA DataSource or Weblogic multi-pools.  These are
DataSource proxies whose getConnection() method returns a
raw connection from the first available data source.
DataSource-level.  Connections returned by HA-JDBC's DataSource,
on the other hand, are proxies to connections to each active
database in your cluster.

I can go into more detail if you'd like, such as the advantages/
disadvantages of HA-JDBC over shared-disk failover, if you're
interested.

Paul
Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]