Data Sync

Last updated: 2019-09-24 16:10:18


Data synchronization can be used for sync disaster recovery instances. This section introduces data synchronization feature with disaster recovery instance as an example.


For application with a strong demand for continued services and reliable data or regulatory requirements, TencentDB provides disaster recovery instances to help users enhance their capability to deliver continued services at a low cost and improve data reliability.


  • With a separate database connection address, disaster recovery instances can offer read access capability for such scenarios as "connection to the nearest node" and data analysis with a lower cost in device redundancy.
  • Highly available Master/Slave architecture can avoid the single point of failure (SPOF) risks of database.
  • Billing on an hourly basis supports instant-on and instant-off. Adoption of tiered prices allows a lower cost for a longer usage.
  • Disaster recovery instance synchronization achieved through private network Direct Connect has a lower synchronization latency and higher stability, with the synchronization linkage being much more superior than the public network.
  • Direct Connect is free of charge during promotion period, and the date of commencement for commercial charges will be subject to the further notice.

How Does It Work

  • In a scenario where a Tencent Cloud database is used as a disaster recovery database, disaster recovery instance is the backup of the master instance database.
  • When any changes take place in the master instance, the log information recording the modification will be copied to the disaster recovery instance, and data synchronization can be achieved through log replay.
  • If any failure occurs with the master instance, the disaster recovery instance can be activated in seconds for restoring the full read and write features.


Before creating a disaster recovery instance, make sure that the master instance is MySQL 5.6 version or above and the GTID feature has been enabled.

Use Limits

  • Disaster recovery instance does not support the following features: transferring project, rollback, SQL operation, parameter settings, changing character set, account management, changing port change, data import, rollback log, read-only instance.


Purchase a disaster recovery instance

Step 1: In the instance list, select the instance for which you want to configure a disaster recovery instance, and click Manage.

Step 2: Make sure the GTID feature has been enabled. Click Add Disaster Recovery Instance to enter the disaster recovery instance purchase page.

Step 3: On the purchase page, select the region of the disaster recovery instance. After confirming the instance information, click Activate and wait for the delivery of disaster recovery instance.

After the delivery of disaster recovery instance, you need to configure a synchronization link for disaster recovery to achieve the remote disaster recovery.

Step 1: In the list of master instances and the "instance details" page, you can view the synchronization status of the disaster recovery instance. If "Unsynchronized" is displayed, click Create Synchronization to create a private network synchronization linkage with the master instance for the disaster recovery instance.

Step 2: Enter the task name, check the source database and destination database information, and then click Next.

Step 3: Select the object to be synced. Synchronization of the entire instance or only part of the database table is supported. Synchronization type cannot be selected for now.

Step 4: Click Save and Verify. After the verification succeeds, you can view the task details on the TencentDB Data Transfer page.

Manage disaster recovery instances

  1. View disaster recovery instances

    Disaster recovery instances can be viewed in the region to which they belongs. You can filter out all the disaster recovery instances of a region in the Instance Type of the instance list. For each disaster recovery instance, you can view the master instance information using the icon under the instance name.
  2. View synchronization latency

    You can view the synchronization latency between the master instance and the disaster recovery instance at the top of the instance details page.
  3. Features of disaster recovery instance

    Disaster recovery instance provides instance details, instance monitoring, backup management, and slow log features that can be viewed in the console.

Upgrade a disaster recovery instance to a master instance

You can quickly upgrade a disaster recovery instance to a master instance in the console. After the switching, the synchronization connection between the disaster recovery instance and the master instance is broken, and the instance database data write capability and the full TencentDB features are restored.
Once the synchronization connection is broken, it cannot be reestablished. Please proceed with caution.

Switch a disaster recovery instance back to a master instance

After the service is resumed in the region where the master instance resides, you can, with the help of TencentDB service personnel, perform reverse data synchronization and data verification, and then switch the disaster recovery instance back to the master instance.


  1. If the cold backup before rollback or disaster recovery does not contain the table, the rollback or disaster recovery will fail.
  2. If the rollback or disaster recovery involves composite operations on other database tables during the trace of binlog, the statement may fail.
  3. If the rollback or disaster recovery involves table's foreign key and other constraints during the trace of binlog, SQL statements may fail.