I understand that HA-JDBC performs mirroring so that all databases in the
cluster is the same. I would like to know more about how this is achieved and
how reliable this mirroring is. I understand that some replication mechanism
involves a delay between the master and the slave. Failure of the master could
result in some data loss. Will there be similar data loss in HA-JDBC?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The "replication mechanism" is really simple, actually - it's just a smart
client-side proxy. Failure of one database won't result in data loss, since
any given write request is destined to all databases. The advantage of HA-JDBC
over master/slave replication, is that a database can fail in the middle of a
user transaction and the user's transaction can still complete normally.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
By combination of local and weight properties in HA-JDBC XML configuration, I had tried to achieve the "mirroring" of my two oracle servers. But my HA-JDBC client always wrote (insert/update/delete) to only one database, not to both of them. What did I missed? I used HA-JDBC 2.0.16-rc-1. Here is my HA-JDBC configuration:
I understand that HA-JDBC performs mirroring so that all databases in the
cluster is the same. I would like to know more about how this is achieved and
how reliable this mirroring is. I understand that some replication mechanism
involves a delay between the master and the slave. Failure of the master could
result in some data loss. Will there be similar data loss in HA-JDBC?
The "replication mechanism" is really simple, actually - it's just a smart
client-side proxy. Failure of one database won't result in data loss, since
any given write request is destined to all databases. The advantage of HA-JDBC
over master/slave replication, is that a database can fail in the middle of a
user transaction and the user's transaction can still complete normally.
By combination of local and weight properties in HA-JDBC XML configuration, I had tried to achieve the "mirroring" of my two oracle servers. But my HA-JDBC client always wrote (insert/update/delete) to only one database, not to both of them. What did I missed? I used HA-JDBC 2.0.16-rc-1. Here is my HA-JDBC configuration:
<ha-jdbc>
<sync id="passive" class="net.sf.hajdbc.sync.PassiveSynchronizationStrategy"/>
<cluster balancer="simple" default-sync="passive" dialect="oracle" meta-data-cache="lazy" transaction-mode="serial">
<database id="db1" local="true" weight="1">
<driveroracle.jdbc.OracleDriver</driver>
<url>jdbc:oracle:thin:@x.x.x.x:1521:SID</url>
</database>
<database id="db2" local="false" weight="0">
<driver>oracle.jdbc.OracleDriver</driver>
<url>jdbc:oracle:thin:@x.x.x.x:1521:SID</url>
</database>
</cluster>
</ha-jdbc>