Data Transmission Service (DTS) allows you to synchronize or migrate data from a DRDS instance to the destination database. However, if you directly use a DRDS instance as the source instance of a DTS task and more than two ApsaraDB RDS for MySQL instances are attached to the DRDS instance, performance bottlenecks and stability risks may occur. Your business may be affected. To achieve higher performance and stability, we recommend that you configure a task for each ApsaraDB RDS for MySQL instance that is attached to the DRDS instance.

Prerequisites

You have read the Limits for using DRDS as the source instance and have made sure to follow the relevant conventions and precautions.

Solutions

Solution Configuration method Description
Solution 1 Configure a DTS task for each ApsaraDB RDS for MySQL instance that is attached to the DRDS instance. When you configure DTS tasks, you must map the database and table names of all the ApsaraDB RDS for MySQL instances to the database and table names of the destination instance.

Compared with directly using the DRDS instance as the source instance of a DTS task, this solution ensures higher performance and stability.

Notice If you use this solution, you can select only tables as the objects to be synchronized.
We recommend that you use Solution 1, which provides higher performance and stability than Solution 2. In addition, the number of ApsaraDB RDS for MySQL instances attached to the DRDS instance is unlimited.
Solution 2 Directly use the DRDS instance as the source instance to configure a data synchronization or migration task. If more than two ApsaraDB RDS for MySQL instances are attached to the DRDS instance, the stability and operability of the DTS task may be affected. Your business may also be affected. If you use Solution 2 and more than two ApsaraDB RDS for MySQL instances are attached to the source DRDS instance, the performance and stability of the DTS task may be compromised.

Comparison between Solution 1 and Solution 2

Item Solution 1 Solution 2
Performance Multiple DTS tasks provide higher performance and support large amounts of data writes to the DRDS instance. Only one DTS task is configured to migrate or synchronize data from the DRDS instance. When the business system writes large amounts of data to the source instance, performance bottlenecks occur.
Stability High.

Multiple DTS tasks are configured to migrate or synchronize data from the ApsaraDB RDS for MySQL instances attached to the DRDS instance. If one of the DTS tasks fails, the other DTS tasks are not affected. You only need to recover the failed DTS task.

Medium.

Only one DTS task is configured to migrate or synchronize data from the DRDS instance. If the DTS task fails, you must troubleshoot the entire task to resume data transmission.

Ease of use You must configure multiple DTS tasks. You must configure database and table name mapping for each task. You must map the database and table names of multiple ApsaraDB RDS for MySQL instances in the source instance to the names of the databases and tables in the destination instance. You need to configure only one DTS task for the source DRDS instance.
Resource usage Multiple DTS instances are required. Only one DTS instance is required.

How do the two solutions implement synchronization or incremental migration of DDL operations

DTS does not support synchronization or incremental migration of DDL operations from a DRDS instance. If DDL operations are performed in the source DRDS instance during data synchronization or migration, you can perform the following steps to ensure that data can be written to the destination database:

  1. Release the DTS task.
  2. Clear the destination database.
  3. Reconfigure the task.

In some scenarios where DRDS is the source instance, you can synchronize or migrate DDL operations without releasing the DTS task. The following table describes specific scenarios and corresponding operations.

Scenario Operation
You use Solution 1 and select tables as the objects to be synchronized.
  • You can add tables to the objects that you select for the data synchronization task.
  • You can add or remove columns only when you synchronize data between two DRDS instances. To do this, perform the following steps:
    1. Add columns to or remove columns from the objects that you select for the data synchronization task.
    2. Add or remove columns in the destination database, and then perform the same operations in the source database. When DTS detects that a column already exists in the destination database, DTS ignores the error and does not display a write failure.
You use Solution 2 and select an entire database as the object to be migrated or synchronized.
  • You can only add tables. To do this, you must add tables in the destination database and then perform the same operations in the source database.
  • You cannot add or remove columns.
    Warning If you add a column in the source DRDS instance, some physical tables at the underlying layer may contain the column whereas some physical tables do not contain the column. When DTS assembles the SQL statement, DTS may fail to find the column or lose the data in the column.
You use Solution 2 and do not select an entire database as the object to be migrated or synchronized.
  • You can only add tables. To do this, perform the following steps:
    1. Add tables to the objects that you select for the data synchronization task.
    2. Add tables in the destination database, and then perform the same operations in the source database.
  • You cannot add or remove columns.