1.1

Table Of Contents
Chapter 35
Using DBSynchronizer to Apply DML to
an RDBMS
DBSynchronizer is a built-in AsyncEventListener implementation that you can use to asynchronously persist data to
a third-party, JDBC 4.0-compliant RDBMS.
VMWare includes sample code for the DBSynchronizer implementation in the
examples/com/vmware/sqlfire/callbacks subdirectory of your SQLFire installation directory. See the
README.txt le in that directory for more information.
How DBSynchronizer Works
You install DBSynchronizer as an AsyncEventListener on multiple data stores, preferably two. The DML
statements executed on SQLFire are passed on to the DBSynchronizer and the congured JDBC RDBMS.
DBSynchronizer can be installed only on data stores (congured with host-data property set to "true").
Each instance of DBSynchronizer maintains an internal queue to batch up the DML statements and is serviced
by its own dedicated thread. This thread picks up DML statements from the queue, and applies them to the
external database using prepared statements.
Ensuring High Availability and Reliable Delivery on page 199
How Failover and Upgrades Affect Synchronization on page 199
Ensuring High Availability and Reliable Delivery
Congure the DBSynchronizer queue for both persistence and redundancy to ensure high availability and reliable
delivery of events.
Installing DBSynchronizer on more than one data store provides high availability. At any given time only one
member has a DBSynchronizer thread active for executing DML on the external database. The threads on other
members are on standby (redundant) to guarantee execution of DML if the member with the active DBSynchronizer
thread fails. Install no more than one standby DBSynchronizer (redundancy of at most one) for performance and
memory reasons.
By default, any pending DML operations residing in the internal queue of the DBSynchronizer are lost if the
active member shuts down. You can avoid losing operations by conguring the internal queue of DBSynchronizer
to be persistent.
How Failover and Upgrades Affect Synchronization
A DML operation may be reapplied to the RDBMS if the member with the active DBSynchronizer thread fails.
If the member with the active DBSynchronizer fails while sending a batch of operations, some DML statements
in the batch may already have been applied to the RDBMS. On failover, the new DBSynchronizer thread resends
199