webonise / hibernate-multi-host-poc

Proof of Concept demonstrating how Hibernate works with the MySQL driver's multi-host support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proof of Concept: Hibernate with MySQL Multi-Host

The MySQL driver has built-in support for master-slave replication. However, how does this work with Hibernate? The PoC needs to demonstrate the following things, preferably through automated tests.

  1. There are two MySQL servers, one of which is routed to master/read-write by the driver, and one of which is routed to as slave/read-only by the driver.
  2. There can be a single Hibernate session which uses a single DB connection, but which can use the master/read-write or the slave/read-only when configured by some kind of setReadOnly(true) call.
  3. We can persist entities through that Hibernate session, and we can retrieve entities through that Hibernate session.
  4. Caching of entities works within that single Hibernate session.

About

Proof of Concept demonstrating how Hibernate works with the MySQL driver's multi-host support

License:The Unlicense


Languages

Language:Java 100.0%