Multi-master parallel replication v7

For a multi-master replication system, you can replicate transactions from one primary node to another by using either the trigger-based method (see Synchronization replication with the trigger-based method) or the log-based method (see Synchronization replication with the log-based method).

For a single replication event to be considered finished and complete, transactions that occurred on all primary nodes since the previous replication event must be successfully replicated to all other primary nodes by the configured synchronization method.

This replication consists of a series of multiple replication sets, each identified by a primary node acting as the source primary node, which contains the transactions that need to be replicated to all other primary nodes acting as the target primary nodes. So for a multi-master replication system consisting of n number of primary nodes, there are n such replication sets, each with a different primary node acting as the source.

Since the initial support of multi-master replication systems in Replication Server version 5.0, such a series of multiple replication sets always started in a strictly serial manner. That is, the transaction replication from a source primary node to all target primary nodes must be completed before the start of the transaction replication from the next primary node to all other target primary nodes, and so on.

For example, consider a three-primary node system consisting of primary node A, primary node B, and primary node C.

If applications have applied transactions to tables in all three primary nodes and then a synchronization replication event starts either on demand by the Replication Server console, a Replication Server CLI command, or by a scheduled replication, the transactions are replicated in the following manner:

  1. Transactions that were made on primary node A are replicated to primary node B and primary node C.
  2. When Step 1 completes, transactions that were made on primary node B are replicated to primary node A and primary node C.
  3. When Step 2 completes, transactions that were made on primary node C are replicated to primary node A and primary node B.

The time to complete the entire replication event, referred to as the latency time, is basically the sum of the replication times, where each primary node acts as the source (that is, the sum of the times for steps 1, 2, and 3).

For the log-based method, this latency time is reduced by implementing parallel replication. Each replication set from a given primary node acting as the source executes and runs simultaneously with all other replication sets where the other primary nodes act as the source.

Thus, a replication set from a primary node isn't waiting for others to complete before it can start. Steps 1, 2, and 3 all run simultaneously instead of one after the other.

Note

The parallel replication applies only to the log-based method, not to the trigger-based method.

You don't need to enable the use of of parallel replication for the log-based MMR system in the configuration settings.

Note

In addition to parallel replication, optimizing replicating from a given primary node to all other primary nodes (that is, in the context of a single replication set) was implemented with the use of multiple threads. This is referred to as parallel synchronization. Parallel synchronization applies to both the trigger-based and log-based methods. See Parallel synchronization.