This topic describes how to change the mode of data replication between a primary ApsaraDB RDS for MySQL instance and its secondary instances. The data replication increases the availability of your database service.

Prerequisites

The primary instance runs one of the following MySQL versions and RDS editions:

  • MySQL 8.0 on RDS High-availability Edition (with local SSDs)
  • MySQL 5.7 on RDS High-availability Edition (with local SSDs)
  • MySQL 5.6 on RDS High-availability Edition
  • MySQL 5.5

Data replication modes

  • Synchronous
    • After an update that is initiated by your application is completed on the primary instance, the log is synchronized to all of the secondary instances. The transaction that is used to perform the update is considered committed after at least one of the secondary instances receives and stores the log.
    • In synchronous mode, data replication is always synchronous and will never be demoted to the asynchronous mode.
    • Synchronous replication is supported only when the number of instances in your database system is greater than or equal to 3. This means that only the RDS Enterprise Edition supports synchronous replication. In addition, if the primary instance runs the RDS Enterprise Edition, you cannot change its data replication mode.
  • Semi-synchronous

    After an update that is initiated by your application is completed on the primary instance, the log is synchronized to all of the secondary instances. The transaction that is used to perform the update is considered committed after the secondary instances receive the log. Your database system does not need to wait for the log to be replayed.

    If the secondary instances are unavailable or communication between the primary and secondary instances is abnormal, the semi-synchronous mode is demoted to the asynchronous mode.

  • Asynchronous

    When your application initiates a request to add, delete, or modify data, the primary instance responds to your application immediately after it completes the operation. At the same time, the primary instance starts to asynchronously replicate data to its secondary instances. In asynchronous mode, you can perform operations on the primary instance even if the secondary instances are unavailable. In addition, the unavailability of the primary instance rarely produces data inconsistencies between the primary and secondary instances.

Procedure

  1. Log on to the ApsaraDB for RDS console.
  2. In the left-side navigation pane, click Instances. In the top navigation bar, select the region where the target RDS instance resides.
    Select a region
  3. Find the target instance and click the instance ID.
  4. In the left-side navigation pane, click Service Availability.
  5. Click Change Data Replication Mode.
  6. In the dialog box that appears, select a data replication mode and click OK.

FAQ

  • Which data replication mode is the recommended?

    You can select a data replication mode based on your business requirements. If you want to ensure strong data consistency and financial-grade reliability, we recommend that you select the synchronous mode. The synchronous mode is supported only for the RDS Enterprise Edition. If you require quick responses, we recommend that you select the asynchronous mode. In other scenarios, you can select the semi-synchronous mode.

  • Why am I unable to change the data replication mode of my RDS instance?

    The data replication modes supported vary based on the database engine version, RDS edition, and storage type. For more information, see the "Prerequisites" section in this topic.

References

Operation Description
Modify high availability mode Changes the data replication mode and high availability mode of an ApsaraDB for RDS instance.