One of our Java project needs a redundant data store system which is highly reliable in such way that if one of the database engines fail the application can still read and write data to other storages. Upon restoring of the failing node new data is automatically synchronized back.
We thought about a mixed environment, like a PostgreSQL database as a primary node, an another PostgreSQL database on a different server as a secondary node, and eg. a HSQL file database near the server application as a third node.
We like to use a JPA layer (probably Hibernate) on the top of this system. Because of the persistence i thought about a transparent JDBC driver which hides all of the replication details. I’ve found these projects on the web so far:
- HA-JDBC (no updates since 2009-06-22)
- C-JDBC (now Tungsten Replicator)
Non of these solutions looks promising. HA-JDBC is outdated, and it’s seems like that Tungsten is primarily for MySQL. I haven’t even found examples about using these with JPA.
Are there any other solutions for us? Maybe we should approach the problem in a different way?
Why do you want to do this, if the problem you are trying to solve is failover or 100% uptime or redundancy in case of failure, then there’s other ways to go about it.
Two postgresql databases, one master and secondary should be ok. You can also run these on cloud servers with virtual machines, in theory the cloud servers never go down because if a machine dies, your VM runs then on a different machine.
Lots of ways to think about.