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

Data replication modes

  • Synchronous
    • After a primary instance completes the updates initiated from your application, the instance synchronously replicates update logs to its secondary instances. The system considers the update transactions submitted only after at least one secondary instance receives and stores the logs.
    • In synchronous mode, data keeps being replicated synchronously no matter what the circumstances are.
    • The synchronous mode is only available when the database system consists of three or more instances. This requires your database system to be in the Enterprise Edition. Additionally, the Enterprise Edition only supports the synchronous mode.
  • Semi-synchronous

    After a primary instance completes the updates initiated from your application, the instance synchronously replicates update logs to its secondary instance. After the secondary instance receives the logs, the database system considers the update transactions submitted, no matter whether the secondary instance finishes executing the updates specified in the logs.

    If the secondary instance becomes unavailable or the primary and secondary instances cannot communicate properly, the data replication mode is downgraded from semi-synchronous to asynchronous.

  • Asynchronous

    After a primary instance completes the updates initiated from your application, the instance responds to your application immediately while starting to asynchronously replicate update logs to its secondary instance. Such updates include add, delete, and modify operations. In asynchronous mode, you can still perform operations on the primary instance even when the secondary instance is unavailable. Additionally, unavailability of the primary instance rarely results in data inconsistencies between the primary and secondary instances.

Prerequisites

Your database system runs one of the following MySQL versions and RDS editions:

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

Procedure

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the page, select the region where the target RDS instance resides.Select a region
  3. Find the target RDS instance and click its 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.

Related operations

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