For MySQL 5.5/5.6 instance, you can select its data replication mode based on your business characteristics to improve the availability of the RDS instance. This document introduces how to change the data replication mode.

Note
The Finance Edition instance has one master node and multiple slave nodes. This kind of instance only supports the strong synchronous replication mode by default, which cannot be modified.

Background information

MySQL 5.5/5.6 instance supports three replication modes: sync, semi-sync and async. You can select the proper replication mode as your business needs. The differences and features of the two replication modes are shown as follows.

  • Sync mode:

    • When the updates initiated by application are all executed in the master node, the log is synchronously transferred to all the slave nodes. The transaction completes the commit only when most nodes (including the master node) in the cluster receive and store the log.

    • Only the instance that has three or more nodes supports the strong synchronous replication. In the strong synchronous replication, no matter what happens, the replication mode cannot degrade into the asynchronous replication mode.

  • Semi-sync mode: Normally data is replicated in the sync mode. But if an exception occurs when the master node replicates data to the slave node, the data synchronization logic changes to the following:

    • When the slave node is unavailable or any network exception occurs between the master and slave nodes, the master node suspends response to the application until the replication mode times out and degrades to async mode.

    • When data replication between the two nodes resumes normally (the Slave node or network connection is recovered), async mode is changed to sync mode. The length of time to restore to the sync mode depends on the implementation mode of semi-sync mode. ApsaraDB for MySQL 5.5 is different from ApsaraDB for MySQL 5.6 in this regard.

  • Async mode: The application initiates an update (including the Add, Delete, and Modify operations) request. After completing the corresponding operation, the master node immediately responds to the application and then replicates data to the slave node asynchronously.  Therefore, in the async mode, unavailability of the slave node does not affect the operation on the primary database, and unavailability of the master node has a low probability to cause data inconsistency between the two nodes.

Procedure

  1. Log on to the  RDS console.
  2. Select the region where the target instance is located.
  3. Click the ID of the target instance to visit the Basic Information page.
  4. In the left-side navigation pane, select Instance Availability.
  5. Click Modify Data Replication Mode, as shown in the following figure.

  6. On the Modify Data Replication Mode page, select a data replication mode, as shown in the following figure.

  7. Click OK.