This topic describes how to change the data replication mode of an ApsaraDB RDS for MySQL instance. The data replication mode specifies how data is replicated from the RDS instance to its secondary RDS instances. A suitable data replication mode increases the availability of your database service.

Prerequisites

Your RDS 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 complete on the primary RDS instance, the related log is synchronized to all the secondary RDS instances. The transaction that is used to perform the update is considered committed only after at least one of the secondary RDS instances receives and stores the log.
    • In synchronous mode, data replication remains synchronous and cannot be demoted to the asynchronous mode.
    • Synchronous replication is supported only when your database system consists of three or more RDS instances. This means that only the RDS Enterprise Edition supports synchronous replication. In addition, if the primary RDS instance runs the RDS Enterprise Edition, you cannot change the data replication mode.
  • Semi-synchronous

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

    If the secondary RDS instances are unavailable or a network interruption occurs between the primary and secondary RDS instances, 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 RDS instance responds to your application immediately after it completes the requested operation. At the same time, the primary RDS instance asynchronously replicates data to the secondary RDS instances. In asynchronous mode, the unavailability of the secondary RDS instances does not interrupt the workloads on the primary RDS instance. However, the unavailability of the primary RDS instance may cause data inconsistencies between the primary and secondary RDS instances.

Note In extreme circumstances, the High-availability Edition may not be able to prevent data losses. If you require a data security level of 100% and a recovery point objective (RPO) of 0, we recommend that you use the Enterprise Edition. For more information, see Enterprise Edition.

Data replication modes supported by various MySQL versions and RDS editions

MySQL version RDS edition Replication mode
MySQL 8.0 Enterprise Edition Synchronous
High-availability Edition
  • Semi-synchronous
  • Asynchronous
MySQL 5.7 Enterprise Edition Synchronous
High-availability Edition
  • Semi-synchronous
  • Asynchronous
MySQL 5.6 Enterprise Edition Synchronous
High-availability Edition
  • Semi-synchronous
  • Asynchronous
MySQL 5.5 High-availability Edition
  • Semi-synchronous
  • Asynchronous
Note The RDS Basic Edition allows you to have only a single RDS instance in your database system and therefore does not require data replication.

Procedure

  1. In the left-side navigation pane, click Service Availability.
  2. Click Change Data Replication Mode.
  3. In the dialog box that appears, select a data replication mode and click OK.

FAQ

  • Which data replication mode is recommended?

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

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

    Different RDS instances support different data replication modes. For more information, see the "Data replication modes supported by various MySQL versions and RDS editions" section of this topic.

Related operations

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