How Replication Works

The DATABridge Client controls the replication process of DMSII databases and flat files. It initiates connections to the Server Accessory on the host and maintains the state information necessary for resuming replication, in case operations are interrupted. At the heart of the host-based DATABridge system is the DATABridge Engine—a system library that retrieves structural information and data from the DMSII database and passes it to the Server Accessory. When you optionally use Enterprise Server with the DATABridge Client, Enterprise Server takes over much of the functionality of the DATABridge Engine and the Server Accessory. From the perspective of the Client and from this guide, Enterprise Server is virtually interchangeable with these two host components.

The DATABridge Support Library, also installed on the host, provides filtering and translation to the Server Accessory. (For more information about filtering, see Client vs. Host Filtering.) After the Server Accessory receives data from the DATABridge Engine, it calls the Support Library to determine if the data should be replicated, and if so, it passes the data to the Support Library for formatting. In addition, the Support Library provides the Client with virtual data sets. Virtual data sets appear as normal data sets to the Server Accessory and the Client, even though they do not actually exist in the DMSII database.

Replication involves three discrete phases, as described below. These three phases are tracked for each data set in the ds_mode column of the DATASETS control table as values 0, 1, and 2.

Data extraction

 

This phase (ds_mode=0) applies only to data sets that have not yet been cloned. During this phase, the DATABridge Engine sequentially reads all of the records from the data sets being cloned and passes them to the DATABridge Client. Using the appropriate bulk loader utility, the Client populates the relational database tables and creates indexes for the tables.

Fixup

 

During this phase (ds_mode=1), the Client processes all of the DMSII updates that occurred while data extraction was taking place. This phase is fully restartable.

Update

 

During this phase (ds_mode=2), the Client processes audit files and then gathers all of the DMSII database updates. To keep the relational database and the DMSII database synchronized, the DATABridge Client continuously applies updates to the relational database. This phase is also referred to as the change tracking phase.

DATABridge uses quiet points to synchronize the replicated database to the DMSII database and ensure accuracy of the data. Quiet points mark the start of a group of updates, which in the relational database is referred to as a transaction. When the DATABridge Engine reaches the end of the last DMSII audit file (or encounters a program that did a rollback), it uses quiet points to roll back updates. The Client stores quiet point information with other state information and uses it to restart the replication process.

If near real-time replication is required, use the DBWAIT API to execute a wait-and-retry loop for a configurable length of time. This causes the Client to run most of the time instead of returning an audit file unavailable status, which normally occurs when no more audit files are available.