百度智能云

All Product Document

          Relational Database Service

          Modify Data Replication Method

          Overview

          You can set the data replication method between the master and slave RDS MySQL instances according to your business needs to improve the availability of the cloud databases.

          Introduction for Replication Methods

          The MySQL instance supports two data replication methods, i.e., Asynchronous and Semi-synchronous replication. The Raft financial version of the Baidu AI Cloud database RDS adopts the Raft Strongsync replication method. The principles of the three replication methods are as follows:

          • Asynchronous Replication:
            When the application initiates an updating request, that is, when you add, delete, or modify the data, the master instance responds to the application immediately after completing the operation. Meanwhile, the master instance replicates the data to the slave instance asynchronously.
            However, the probability of data inconsistency between the master database and slave database, in general, is low due to the unavailability of the master database.
          • Semi-synchronous Replication:
            After the application-initiated update is complete on the master instance, the log is synchronously transmitted to the slave instance. After the slave instance receives the log, the transaction submission is complete. Therefore, you do not need to wait for the slave instance to execute the log content.

            In the semi-synchronous replication mode, the submitted transactions on the master instance can be retrieved on at least one slave instance, thus solving the data loss resulted from the asynchronous replication. However, you need to wait until at least one slave instance is attached to the disk and sends a confirmation message. Then, the delay in the transaction submission on the master instance increases, and TPS decreases.

            When the slave instance is unavailable, or the network becomes exceptional between the master instance and slave instances, the semi-synchronous replication degrades to asynchronous replication. Therefore, the unavailability of the master database may still cause data inconsistency with a small probability.

          • Raft Strongsync

            • The Raft Strongsync mode has the characteristic of Strong Data Consistency, which ensures that every data writing is synchronized to most nodes in the cluster. Also, after the abnormal switch-over, it is possible to ensure zero data loss in the data submitted by the master database. It eliminates the split-brain problem in multiple master databases surviving simultaneously that may be due to the use of traditional methods in the event of a network failure.
            • It supports the strongsync mode only when the number of nodes in the instance is ≥3. Therefore, only the three-node Raft financial version instance supports the strongsyn mode. You cannot modify the data replication method for the three-node Raft financial version instance.

          Description: By default, the dual-computer high-availability version of Baidu AI Cloud database RDS for MySQL instance adopts the asynchronous replication mode.

          Prerequisites

          The instance includes the following versions:

          • MySQL dual-computer high-availability version
          • MySQL 5.6 dual-computer high-availability versions and Raft financial version
          • MySQL dual-computer high-availability version

          Modify Data Replication Method

          1. Log in to RDS Management Console.
          2. In the upper left corner of the console page, select the Region where the instance resides.
          3. Find the target instance and click “Instance Name” to enter the Instance Details page.
          4. In the "Basic Information" module, you can modify the data synchronization mode. Click Enable Semi-synchronous Mode to change it from the asynchronous mode to the Semi-synchronous mode.

            image.png

          Descriptions: You can only view the data synchronization mode on the "Basic Information" page of the read-only instance. If you need to modify it, go to the "Basic Information" page of the master instance.

          Relevant API

          Previous
          Migration to Another Availability Zone
          Next
          Modify Instance Domain Name