Change the data replication mode

更新时间:
复制 MD 格式

You can configure the data replication mode between the primary and secondary instances of ApsaraDB MyBase for MySQL to improve database availability.

Prerequisites

Your instance must meet one of the following requirements:

  • MySQL 8.0 High-availability Edition (local SSD)

  • MySQL 5.7 High-availability Edition (local SSD)

  • MySQL 5.6 High-availability Edition (local SSD or enhanced SSD (ESSD))

Data replication modes

  • Semi-synchronous

    When an application initiates an update, the primary instance executes the update and synchronously sends the log to the secondary instance. The primary instance commits the transaction once the secondary instance receives the log, without waiting for the secondary instance to replay the log.

    Note

    If the secondary instance becomes unavailable or a network issue occurs between the instances, semi-synchronous replication degrades to asynchronous replication.

  • Asynchronous

    When an application sends an update request, such as an insert, delete, or update operation, the primary instance completes the operation and immediately responds to the application. The primary instance asynchronously replicates the data to the secondary instance. In this mode, the secondary instance's unavailability does not affect operations on the primary instance. However, if the primary instance becomes unavailable, data inconsistency may occur between the primary and secondary instances.

Procedure

  1. Log on to the ApsaraDB for MyBase console.

  2. In the upper-left corner of the page, select a region.

  3. In the navigation pane on the left, choose Instances > MySQL.

  4. Find the target instance, and in the Actions column, click Details.

  5. In the navigation pane on the left, click Service Availability.

  6. In the Availability Information section, click Change Data Replication Mode.

  7. In the dialog box that appears, select a data replication mode and click OK.

    You can select Semi-synchronous or Asynchronous.