Enterprise Replication evaluates transactions based on a change to a final image of a row.
Enterprise Replication evaluates the initial and final images of a row and any changes that occur between the two row images to determine which rows to replicate. Each row image contains the data in the row as well as the action performed on that row.
A row might change more than once in a particular transaction. For example, a transaction might insert and then update a row prior to committing. Enterprise Replication evaluates the net effect (final state) of a transaction based on the row buffers in the log. Enterprise Replication then determines what should replicate, based on the net effect, the initial state of the row, and whether the replicate definition (in particular, the WHERE clause) applies to the initial and final state.
Table 4 shows the logic that determines which rows are candidates for replication.
Where:
Table 4 illustrates how Enterprise Replication evaluates the row-image type (INSERT, UPDATE, DELETE), the results of evaluating the replicate WHERE clause for both the initial and final image, and whether the primary key changes as a result of the transaction.
After Enterprise Replication identifies transactions that qualify for replication, Enterprise Replication transfers the transaction data to a queue.
Enterprise Replication evaluates rows for primary-key updates, for WHERE-clause column updates, and for multiple updates to the same row. The following list describes an occurrence in a transaction and the Enterprise Replication action:
Enterprise Replication translates an update of a primary key into a delete of the original row and an insert of the row image with the new primary key. If triggers are enabled on the target system, insert triggers are executed.
If a replicate includes a WHERE clause in its data selection, the WHERE clause imposes selection criteria for rows in the replicated table.
Enterprise Replication compresses multiple-row images and only sends the net change to the target. Because of this, triggers might not execute on the target database. For more information, see Triggers.
Enterprise Replication supports the replication of BYTE and TEXT data types (simple large objects) and BLOB and CLOB data types (smart large objects), and opaque user-defined data types, as well as all built-in Informix data types. However, Enterprise Replication implements the replication of these types of data somewhat differently from the replication of other data types. For more information, see Replicating Simple and Smart Large Objects, and Replicating Opaque User-Defined Data Types.
Enterprise Replication uses send and receive queues to receive and deliver replication data to and from database servers that participate in a replicate:
Enterprise Replication stores replication data in memory to be delivered to target database servers that participate in a replicate. If the send queue fills, Enterprise Replication spools the send-queue transaction records to a dbspace and the send-queue row data to an sbspace.
Enterprise Replication stores replication data in memory at the target database server until the target database server acknowledges receipt of the data. If the receive queue fills as a result of a large transaction, Enterprise Replication spools the receive queue transaction header and replicate records to a dbspace and the receive queue row data to an sbspace. For more information, see Large Transactions.
For more information, see Setting Up Send and Receive Queue Spool Areas and Preventing Memory Queues from Overflowing.
The data contains the filtered log records for a single transaction. Enterprise Replication stores the replication data in a stable (recoverable) send queue on the source database server. Target sites acknowledge receipt of data when it is applied to or rejected from the target database.
If a target database server is unreachable, the replication data remains in a stable queue at the source database server. Temporary failures are common, and no immediate action is taken by the source database server; it continues to queue transactions. When the target database server becomes available again, queued transactions are transmitted and applied (see Applying Replicated Data).
If the target database server is unavailable for an extended period, the send queue on the source database server might consume excessive resources. In this situation, you might not want to save all transactions for the target database server. To prevent unlimited transaction accumulation, you can remove the unavailable target database server from the replicate (see Managing Replication Servers). Before the database server that is removed rejoins any replicate, however, you must synchronize (bring tables to consistency) with the other database servers (see Resynchronizing Data Among Replication Servers).
Figure 1, Figure 2, and Figure 3 show three examples of how Enterprise Replication uses logic to evaluate transactions for potential replication.
Figure 1 shows a transaction that takes place at the Dallas office. Enterprise Replication uses the logic in Table 5 to evaluate whether any information is sent to the destination database server at the Phoenix office.
Initial Image | Replicate Evaluates | Final Image | Replicate Evaluates | Primary-Key Changed? | Send to Destination Database Server |
---|---|---|---|---|---|
INSERT | T or F | DELETE | T or F | Yes or no | Nothing |
Enterprise Replication determines that the insert followed by a delete results in no replication operation; therefore, no replication data is sent.
In Figure 2, Enterprise Replication uses the logic in Table 6 to evaluate whether any information is sent to the destination database server.
Initial Image | Replicate Evaluates | Final Image | Replicate Evaluates | Primary-Key Changed? | Send to Destination Database Server |
---|---|---|---|---|---|
INSERT | T or F | UPDATE | T | Yes or no | INSERT with final row image |
The replicate WHERE clause imposes the restriction that only rows are replicated where the exempt column contains a value of "N." Enterprise Replication evaluates the transaction (an insert followed by an update) and converts it to an insert to propagate the updated (final) image.
In Figure 3, Enterprise Replication uses the logic in Table 7 to evaluate whether any information is sent to the destination database server.
Initial Image | Replicate Evaluates | Final Image | Replicate Evaluates | Primary-Key Changed? | Send to Destination Database Server |
---|---|---|---|---|---|
UPDATE | F | UPDATE | T | Yes or no | INSERT with final row image |
The example shows a replicate WHERE clause column update. A row that does not meet the WHERE clause selection criteria is updated to meet the criteria. Enterprise Replication replicates the updated row image and converts the update to an insert.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]