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.
|A Finance Edition instance has one master node and multiple slave nodes. This type of instance only supports the strong synchronous replication mode by default, which cannot be modified.|
MySQL 5.5/5.6 instances support three replication modes: sync, semi-sync and async. You can select an appropriate replication mode as your business needs. The differences and features of the replication modes are described as follows.
- Sync mode:
- When the updates initiated by applications are all executed at the master node, logs are synchronously transferred to all the slave nodes. The transaction completes the commit only when most nodes (including the master node) in the cluster have received and stored the logs.
- Only instances that have three or more nodes support strong synchronous replication. No matter what happens, the strong synchronous replication mode cannot be degraded to 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 applications until the replication mode times out and degrades to the 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 time period required for restoration to the sync mode depends on the implementation mode of the semi-sync mode. ApsaraDB for MySQL 5.5 differs from ApsaraDB for MySQL 5.6 in this regard.
- Async mode: An application initiates an update (including addition, deletion, and modification 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 slave database, and unavailability of the master node has a low probability to cause data inconsistency between the two nodes.
- Log on to the RDS console.
- Select the region where the target instance is located.
- Click the ID of the target instance to visit the Basic Information page.
- In the left-side navigation pane, select Instance Availability.
- Click Modify Data Replication Mode, as shown in the following figure.
- In the Modify Data Replication Mode dialog box, select a data replication mode, as shown in the following figure.
- Click OK.