Data Transmission Service (DTS) lets you synchronize data from a MySQL database to the LindormTable engine of a Lindorm instance. This topic uses an ApsaraDB RDS for MySQL instance as the source.
Prerequisites
Before you begin, make sure that you have:
-
A destination Lindorm instance with the LindormTable engine enabled and storage capacity greater than the used storage of the source RDS for MySQL instance. See Create an instance.
-
The MySQL-compatible endpoint enabled for the destination Lindorm instance. See Enable the MySQL-compatible feature.
-
A database (namespace) and a wide table pre-created in the destination Lindorm instance, pre-partitioned based on the full dataset before synchronization starts. See Connect to and use LindormTable using the MySQL command line, Connect to and use LindormTable using Lindorm-cli, Access LindormTable using Lindorm Shell, CREATE TABLE, and Data type mapping.
-
All objects in the destination Lindorm instance compliant with Lindorm naming conventions and limits.
Billing
| Synchronization type | Fee |
|---|---|
| Full data synchronization | Free of charge |
| Incremental data synchronization | Charged. See Billing overview. |
SQL operations supported by incremental synchronization
| Type | SQL statements |
|---|---|
| DML | INSERT, UPDATE, DELETE |
| DDL | CREATE TABLE, DROP TABLE, ADD COLUMN |
ALTER TABLE test ADD COLUMN col INT DEFAULT 0; on the source results in ALTER TABLE test ADD COLUMN col INT; on the destination, due to LindormTable limits.Permissions required for database accounts
| Database | Required permissions | How to grant |
|---|---|---|
| Source RDS MySQL | Read and write permissions on the objects to be synchronized | Create an account and Modify account permissions |
| Destination Lindorm | Read and write permissions on the destination namespace | User management |
Limitations
Source database limits
-
Tables to be synchronized must have primary keys with unique fields. Without primary keys, duplicate data may appear in the destination.
-
When synchronizing at the table level with name mapping, a single task supports a maximum of 1,000 tables. Exceeding this limit causes an error after task submission. Split the tables across multiple tasks, or configure the task to synchronize the entire database instead.
-
Do not run DDL operations on the source database during the full data synchronization phase — this causes the task to fail. DTS queries add a metadata lock that may also block DDL operations on the source during this phase.
-
Data changes from operations not recorded in binary logs — such as physical backup recovery and cascade operations — are not synchronized to the destination. If this occurs and your business allows it, remove the affected database or table from the sync objects and add it back. See Modify synchronization objects.
-
For MySQL 8.0.23 and later, invisible columns cause data loss because DTS cannot read them. Make invisible columns visible before starting synchronization:
-
Run
ALTER TABLE <table_name> ALTER COLUMN <column_name> SET VISIBLE;for each invisible column. See Invisible Columns. -
Tables without a primary key auto-generate an invisible primary key — make it visible as well. See Generated Invisible Primary Keys.
-
Binary log requirements
ApsaraDB RDS for MySQL source
Binary logging is enabled by default for RDS MySQL instances. Confirm the following parameter is set correctly:
| Parameter | Required value | Note |
|---|---|---|
binlog_row_image |
full |
If not set correctly, the precheck reports an error and the task cannot start. See Set instance parameters. |
Retain local binary logs for at least 3 days (7 days recommended). Shorter retention may cause task failures, and in extreme cases, data loss or inconsistency. Issues caused by insufficient retention are not covered by the DTS Service Level Agreement (SLA). See Automatically delete local logs.
Self-managed MySQL source
Enable binary logging and set the following parameters:
| Parameter | Required value | Note |
|---|---|---|
binlog_format |
row |
Required for DTS to capture row-level changes. |
binlog_row_image |
full |
Required to capture the full row image for each change. |
log_slave_updates |
Enabled | Required only for primary/primary architecture, to ensure DTS can obtain all binary logs. See Create a database account for a self-managed MySQL database and configure binary logging. |
Retain local binary logs for at least 7 days. Shorter retention may cause task failures, and in extreme cases, data loss or inconsistency. Issues caused by insufficient retention are not covered by the DTS SLA.
Other limits
| Limit | Details |
|---|---|
| Schema synchronization | Not supported. |
| Unsupported object types | INDEX, PARTITION, VIEW, PROCEDURE, FUNCTION, TRIGGER, and FK objects. |
| BIT type data | Not supported. |
| Primary key-only sync | Not supported. The data to be synchronized must include at least one non-primary key field. |
| Destination engine | Only the LindormTable engine is supported. |
| Empty VARBINARY strings | Treated as null by both DTS and Lindorm. |
| DECIMAL field precision mismatch | If the DECIMAL field precision in the destination differs from the source, the task fails. |
| Lindorm data request limits | Data written to Lindorm must meet its data request limits. Exceeding them causes the task to fail. |
| Resource usage during full sync | Full data synchronization consumes read and write resources on both the source and destination databases. Run synchronization during off-peak hours when CPU usage is below 30% on both instances. |
| Destination tablespace after full init | Full initialization runs concurrent INSERT operations, causing table fragmentation. After full initialization, the destination tablespace will be larger than the source. |
| Online DDL tools during sync | Do not use tools such as pt-online-schema-change to perform online DDL operations on the synchronized objects during an active DTS task — this causes the task to fail. |
| External writes to destination | Writing data to the destination database from sources other than DTS during synchronization causes data inconsistency. |
| EncDB (always-confidential) feature | If the EncDB feature is enabled on the source RDS for MySQL instance, full data synchronization is not supported. Transparent Data Encryption (TDE) does not have this restriction — instances with TDE enabled support schema synchronization, full data synchronization, and incremental data synchronization. |
| DTS instance recovery | If a DTS instance fails, the DTS helpdesk attempts recovery within 8 hours. During recovery, DTS may restart the instance or adjust DTS instance parameters (not the database parameters). See Modify instance parameters. |
Special cases
Self-managed MySQL source
-
A primary/secondary failover in the source database during synchronization causes the task to fail.
-
Latency is calculated from the timestamp difference between the current time and the last record synchronized to the destination. If no DML operations are performed on the source for an extended period, the displayed latency may be inaccurate. To refresh latency, perform a DML operation on the source. Alternatively, create a heartbeat table — DTS writes to it every second when you synchronize the entire database.
-
DTS periodically runs
CREATE DATABASE IF NOT EXISTS \test\`` on the source to advance the binary log offset. -
For Amazon Aurora MySQL or other cluster-mode MySQL instances, the domain name or IP address configured for the task must always resolve to the read/write (RW) node. Otherwise, the task may not run correctly.
ApsaraDB RDS for MySQL source
-
Read-only instances of ApsaraDB RDS for MySQL 5.6 cannot be used as a source, because they do not record transaction logs.
-
DTS periodically runs
CREATE DATABASE IF NOT EXISTS \test\`` on the source to advance the binary log offset.
Set up the synchronization task
Step 1: Open the Data Synchronization page
Use either the DTS console or the DMS console.
DTS console
-
Log on to the DTS console.DTS console
-
In the left-side navigation pane, click Data Synchronization.
-
In the upper-left corner, select the region where the synchronization task resides.
DMS console
-
Log on to the DMS console.DMS console
-
In the top navigation bar, move the pointer over Data + AI and choose DTS (DTS) > Data Synchronization.
-
From the drop-down list next to Data Synchronization Tasks, select the region where the instance resides.
Step 2: Configure source and destination databases
-
Click Create Task.
-
Configure the source and destination databases using the parameters in the following table.
| Category | Parameter | Description |
|---|---|---|
| N/A | Task Name | A descriptive name for the DTS task. DTS auto-generates a name — replace it with one that makes the task easy to identify. Task names do not need to be unique. |
| Source Database | Select Existing Connection | If you have a database instance already registered with DTS, select it from the drop-down list — DTS auto-populates the remaining parameters. In the DMS console, select from the Select a DMS database instance list. Otherwise, configure the parameters below manually. |
| Database Type | Set to MySQL. | |
| Access Method | Set to Alibaba Cloud Instance. | |
| Instance Region | Select the region of the source RDS MySQL instance. | |
| Replicate Data Across Alibaba Cloud Accounts | Select No if the source database belongs to the current Alibaba Cloud account. | |
| RDS Instance ID | Select the ID of the source RDS MySQL instance. | |
| Database Account | Enter the database account. For required permissions, see Permissions required for database accounts. | |
| Database Password | The password for the database account. | |
| Encryption | Select Non-encrypted or SSL-encrypted based on your requirements. To use SSL encryption, enable it on the RDS for MySQL instance before configuring the DTS task. See Use a cloud certificate to enable SSL encryption. | |
| Destination Database | Select Existing Connection | If you have a database instance already registered with DTS, select it from the drop-down list — DTS auto-populates the remaining parameters. In the DMS console, select from the Select a DMS database instance list. Otherwise, configure the parameters below manually. |
| Database Type | Set to Lindorm. | |
| Access Method | Set to Alibaba Cloud Instance. | |
| Instance Region | Select the region of the destination Lindorm instance. | |
| Instance ID | Select the ID of the destination Lindorm instance. | |
| Database Account | Enter the database account of the destination Lindorm instance. For required permissions, see Permissions required for database accounts. | |
| Database Password | The password for the database account. |
-
Click Test Connectivity and Proceed.
Note DTS server IP addresses must be added to the security settings of both the source and destination databases. This can be done automatically or manually. See Add DTS server IP addresses to a whitelist. If the source or destination is a self-managed database with an access method other than Alibaba Cloud Instance, click Test Connectivity in the CIDR Blocks of DTS Servers dialog box.
Step 3: Configure synchronization objects
In the Configure Objects step, set the following parameters.
| Parameter | Description |
|---|---|
| Synchronization Types | Incremental Data Synchronization is selected by default. Optionally also select Full Data Synchronization. Schema Synchronization is not available. When full data synchronization is enabled, DTS synchronizes historical data from the source to the destination before starting incremental synchronization. |
| Processing Mode of Conflicting Tables | Keep the default value. |
| Capitalization of Object Names in Destination Instance | Controls the case of database names, table names, and column names in the destination. The default is DTS default policy. Select a different option if you need the capitalization to match the source or destination. See Specify the capitalization of object names in the destination instance. |
| Source Objects | Select the databases or tables to synchronize, then click the |
| Selected Objects | If the names of databases, tables, or columns in the destination Lindorm instance differ from those in the source RDS MySQL instance, use object name mapping. See Map table and column names. Note
Renaming an object with name mapping may cause dependent objects to fail synchronization. To filter rows, right-click a table in Selected Objects and specify WHERE conditions. See Specify filter conditions. To select specific SQL operations for incremental synchronization, right-click an object and choose the operations to include. |
Step 4: Configure advanced settings
Click Next: Advanced Settings and configure the following parameters.
| Parameter | Description |
|---|---|
| Dedicated Cluster for Task Scheduling | DTS schedules the task to a shared cluster by default. For higher stability, purchase a dedicated cluster. See What is a DTS dedicated cluster. |
| Retry Time for Failed Connections | How long DTS retries after a connection failure. Valid values: 10–1440 minutes. Default: 720 minutes. Set this to at least 30 minutes. If DTS reconnects within this period, the task resumes automatically; otherwise, it fails. Note
When multiple tasks share the same source or destination, the shortest retry period takes precedence. DTS charges for the instance during retry periods — set this value based on your business needs. |
| Retry Time for Other Issues | How long DTS retries after DDL or DML operation failures. Valid values: 1–1440 minutes. Default: 10 minutes. Set this to a value greater than 10 minutes. This value must be smaller than Retry Time for Failed Connections. |
| Enable Throttling for Full Data Synchronization | Throttles full data synchronization to reduce load on the destination. Configure Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s). Available only when Full Data Synchronization is selected. |
| Enable Throttling for Incremental Data Synchronization | Throttles incremental data synchronization. Configure RPS of Incremental Data Synchronization and Data synchronization speed for incremental synchronization (MB/s). |
| Environment Tag | An optional tag to identify the instance environment. |
| Whether to delete SQL operations on heartbeat tables of forward and reverse tasks | Controls whether DTS writes heartbeat SQL operations to the source database. Select Yesalert notification settings to skip writing (a latency value may be displayed for the instance). Select No to write heartbeat operations (this may affect physical backups and cloning of the source database). |
| Configure ETL | Select Yes to enable the extract, transform, and load (ETL) feature and enter data processing statements. See What is ETL? and Configure ETL in a data migration or data synchronization task. Select No to skip. |
| Monitoring and Alerting | Select Yes to receive notifications when the task fails or latency exceeds a threshold. Configure the alert threshold and notification settings. See Configure monitoring and alerting when you create a DTS task. Select No to disable alerting. |
Step 5: Run the precheck
Click Next: Save Task Settings and Precheck.
DTS runs a precheck before starting the task. If any items fail:
-
Click View Details next to the failed item, analyze the cause, fix the issue, and click Precheck Again.
-
If an alert item cannot be ignored, click View Details next to the failed item, troubleshoot the issue, and run a precheck again.
-
If an alert item can be ignored, click Confirm Alert Details, then click Ignore in the details dialog, click OK, and then click Precheck Again. Ignoring alert items may result in data inconsistency.
Step 6: Purchase the instance
-
Wait for the Success Rate to reach 100%, then click Next: Purchase Instance.
-
On the purchase page, configure the following parameters.
| Parameter | Description |
|---|---|
| Billing Method | Subscription: Pay upfront for a fixed term. More cost-effective for long-term use. Pay-as-you-go: Billed hourly. Suitable for short-term use — release the instance when no longer needed to stop charges. |
| Resource Group Settings | The resource group for the instance. Default: default resource group. See What is Resource Management? |
| Instance Class | The synchronization speed varies by instance class. Select one based on your requirements. See Instance classes of data synchronization instances. |
| Subscription Duration | Available for the Subscription billing method only. Options: 1–9 months, 1 year, 2 years, 3 years, or 5 years. |
-
Read and select Data Transmission Service (Pay-as-you-go) Service Terms.
-
Click Buy and Start, then click OK in the confirmation dialog.
The task appears in the task list. Monitor its progress from there.