• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do you implement a clustered database?

 
Jane Jukowsky
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My database server (h2) does not reliably support clustering yet; but I need to insure data redundancy. Can I mess up with Hibernate connections in such a way that every database connection would in fact be two connections to two different databases on two computers, seamlessly for the rest of the application? I only care about writes; reads can go to one database as far as I am concerned.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you could use Hibernate Shards project possibly.

But with Hibernate a Connection factory is one to one to a SessionFactory. So to point to two different databases you need two different SessionFactories.

Mark
 
Jane Jukowsky
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if I supply my own ConnectionFactory, is that very convoluted?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jane Dodo wrote:What if I supply my own ConnectionFactory, is that very convoluted?


a single Hibernate SessionFactory can only communicate with a single database.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic