This topic describes how to use the data synchronization feature to synchronize the data of an ApsaraDB RDS for MySQL instance in the ApsaraDB RDS console. The data synchronization feature is provided by Data Transmission Service (DTS).
Prerequisites
An RDS instance is created. For information about how to create an RDS instance, see Create an ApsaraDB RDS for MySQL instance.
If your self-managed MySQL instance is deployed on an on-premises device or a third-party cloud platform, make sure that the CIDR block of the required DTS server is added to an IP address whitelist of the self-managed MySQL instance to allow the DTS server to connect to the self-managed MySQL instance. For more information, see Add the CIDR blocks of DTS servers or What is DTS?
A source or destination database is created based on your business requirements. If your RDS instance is used as the destination instance, the available storage of the RDS instance must be greater than the storage capacity of the source instance. For more information about how to expand the storage capacity of an RDS instance, see Change instance specifications.
NoteWe recommend that you enable the automatic storage expansion feature for your RDS instance. This way, the system automatically expands the storage capacity of the RDS instance when the available storage reaches the specified threshold. For more information, see Use the automatic storage expansion feature.
DTS is authorized to access Alibaba Cloud resources. For more information, see Authorize DTS to access Alibaba Cloud resources.
Billing
| Synchronization type | Task configuration fee |
| Schema synchronization and full data synchronization | Free of charge. |
| Incremental data synchronization | Charged. For more information, see Billing overview. |
Procedure
Go to the Data Migration and Synchronization page.
Go to the Instances page.
In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the instance ID.
In the left-side navigation pane of the page that appears, click Data Migration and Synchronization.
Click the Data Synchronization tab. On the tab that appears, click Create Data Synchronization Task and perform the following operations:
Configure the source and destination databases.
NoteIf you use the current RDS instance as the source or destination instance, the Instance Region and RDS Instance ID parameters are automatically configured and cannot be modified.
The Replicate Data Across Alibaba Cloud Accounts parameter is unavailable for the current RDS instance.
Configure the source database.
Configure the Database Account and Database Password parameters.
Configure the Encryption parameter.
Configure the destination database.
Configure the Database Type and Access Method parameters.
Configure the Instance Region and RDS Instance ID parameters.
Configure the Encryption parameter.
Click Test Connectivity and Proceed.
Configure objects.
Configure the Synchronization Types parameter. Valid values: Schema Synchronization, Full Data Synchronization, and Incremental Data Synchronization. By default, incremental data synchronization is supported. DTS synchronizes incremental data that is generated in the source database to the destination database in real time. If incremental data synchronization is not required, you can use the data migration feature. For more information, see Use the data migration feature of ApsaraDB RDS for MySQL in the ApsaraDB RDS console.
Configure the Synchronization Topology parameter. Valid values: One-way Synchronization and Two-way Synchronization.
Configure the Processing Mode of Conflicting Tables parameter. Valid values: Precheck and Report Errors and Ignore Errors and Proceed.
Configure the Capitalization of Object Names in Destination Instance parameter. You can specify whether to capitalize the database names, table names, and column names for synchronization objects.
NoteBy default, DTS default policy is selected. You can select other options to ensure that the capitalization of object names is consistent with that in the source and destination databases. For more information, see Specify the capitalization of object names in the destination instance.
In the Source Objects section, select the objects that you want to synchronize and move them to the Selected Objects section.
Modify the name of the object that you want to synchronize in the destination instance. If you want to modify the names of multiple objects, click Batch Edit in the upper-right corner of the page.
Click Advanced Settings (Optional) to configure the advanced parameters.
In the Data Verification Settings section, configure the Data Verification Mode parameter. The value varies based on the synchronization type. For more information, see Configure the Synchronization Types parameter.
Configure the required parameters in the Advanced Settings section. Parameter settings in this section are similar to the parameter settings in the DTS console. For more information, see related documentation.
FAQs
If the source RDS instance is upgraded from the High-availibility Edition to Cluster Edition during data synchronization, can DTS automatically recognize the upgraded RDS instance? Does the synchronization automatically continue?
During the edition upgrade of an RDS for MySQL instance, the connection to the instance is temporarily interrupted. For more information, see Impacts. After the edition upgrade is complete, DTS automatically recognizes the upgraded RDS instance and continues synchronizing data.
Is the latency increased when I use DTS to synchronize data in my RDS for MySQL instance?
The synchronization latency indicates the difference between the timestamp of the latest data synchronized to the destination database and the current timestamp of the source database. In general, the synchronization latency is within 1000 milliseconds. If the latency is increased when you use DTS to perform incremental data migration or data synchronization, see What do I do if latency occurs during incremental data migration or synchronization? for troubleshooting.