Chapter 5. More real-time enterprise enablers 225
committed source changes are staged in relational tables before being replicated
to target systems. In Q replication, committed source changes are written in
messages that are transported through WebSphere MQ message queues to the
target systems.
There is also a solution called event publishing for converting committed source
changes into messages in an XML format and publishing those messages to
applications such as message brokers.
5.1.1 SQL replication
SQL replication captures changes to sources and uses staging tables to store
the committed transactional data. The changes are then read from the staging
tables and replicated to corresponding target tables. With staging tables, data
can be captured and staged once for delivery to multiple targets, in different
formats, and at different delivery intervals.
Replication can be continuous, at intervals, or for one time only. Replicating
continuously can be useful if your enterprise applications need data in near
real-time. Replicating at intervals can be useful for replicating large batches of
data during off-peak hours. You can also trigger replication through database
events.
There is considerable flexibility with the data that you want to replicate. For
example, you can choose to have all rows and columns replicated or you can
choose just a subset. By subsetting rows and columns, you transport across the
network only the data that you want. You can also clean, aggregate, or otherwise
manipulate the data. If you manipulate data, you can do so at the source and
then distribute the manipulated data. Or you can manipulate the data when you
replicate it so that some targets get manipulated data and others do not.
The SQL replication process is depicted in Figure 5-1. The capture program
reads the committed transaction data from the source DB2 log tables. That data
is then available to the apply program, that writes the data updates to the target
tables. Control tables are used to synchronize the activities of both the capture
and apply programs to ensure data integrity.
Get Moving Forward with the On Demand Real-time Enterprise now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.