Data Transmission Service (DTS) lets you sync data from a PolarDB-X 2.0 instance to the LindormTable of a Lindorm instance, with support for both full and incremental synchronization.
In this tutorial, you'll learn how to:
-
Set up the source and destination database connections in DTS
-
Select the objects to synchronize and configure advanced settings
-
Run a precheck and purchase a DTS instance
-
Monitor task progress after the sync starts
Prerequisites
Before you begin, make sure you have:
-
A Lindorm instance that uses LindormTable with enough storage for the data to be synchronized. See Create an instance.
-
The MySQL-compatible connection endpoint enabled for the Lindorm instance. See Enable the MySQL protocol compatibility feature.
-
A database (namespace) and a wide table created in the Lindorm instance to receive the synchronized data. The wide table must be pre-partitioned based on the full data. For setup options, 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.
The objects you create must meet the requirements in Quotas and limits.
Limitations
Review these limitations before you configure the sync task.
Source database
-
The source server must have at least 100 Mb/s outbound bandwidth. Lower bandwidth reduces synchronization speed.
-
The source cannot be a read-only PolarDB-X 2.0 Enterprise Edition instance.
-
Schema synchronization is not supported.
-
Tables with uppercase letters in their names cannot be synchronized.
-
Tables whose names are SQL reserved words (such as
select) cannot be synchronized. -
The
TABLEGROUPattribute and any database or schema that contains theLocalityattribute cannot be synchronized. -
BIT type data cannot be synchronized.
-
You cannot synchronize only primary key fields — tables must contain at least one non-primary key field.
-
Tables must have a
PRIMARY KEYorUNIQUEconstraint with all fields unique. Otherwise, duplicate records may appear in the destination database. -
If you select individual tables and need to rename tables or columns in the destination, a single sync task supports at most 5,000 tables. For more than 5,000 tables, configure multiple tasks in batches or sync at the database level.
-
Binary logging (binlog) is enabled by default for PolarDB-X 2.0 instances. The
binlog_row_imageparameter on the source must be set tofull. A different value causes a precheck failure and prevents the task from starting. See Parameter settings. -
Do not run DDL operations that change table or database schemas during the full data synchronization phase. DTS queries the source during this phase, which creates metadata locks that can block DDL operations.
-
If the network configuration of the PolarDB-X 2.0 instance changes, the sync task may experience latency for a period of time.
Destination database and general
-
DTS can only write data to LindormTable. Other Lindorm engines are not supported.
-
VARBINARY empty strings are processed as null values in DTS and Lindorm.
-
If the DECIMAL field precision in the destination Lindorm instance differs from the source, the task fails. Make sure the precision matches.
-
The data written to Lindorm must meet Limits on data requests.
-
DTS periodically runs
CREATE DATABASE IF NOT EXISTS \`test\`on the source to write heartbeat data and advance the binlog offset. If you set Whether to delete SQL operations on heartbeat tables of forward and reverse tasks to Yes, or if the source database account lacks permission to create databases, synchronization latency information may become inaccurate when no DML operations occur for a long time.If the task shows a long latency, run a DML operation on the source database to refresh the latency display.
-
During full data synchronization, DTS consumes read and write resources on both the source and destination databases, increasing the load. Run the sync during off-peak hours — ideally when CPU usage on both sides is below 30%.
-
Full data synchronization uses concurrent INSERT operations, which can cause table fragmentation. The destination database may use more storage than the source after full sync completes.
-
If data is written to the destination from sources other than DTS during synchronization, data inconsistency may occur and the sync task may fail.
-
If a DTS instance fails, the DTS team attempts to recover it within 8 hours. Recovery operations may include restarting the instance and adjusting DTS instance parameters (not database parameters). For a list of parameters that may be modified, see Modify instance parameters.
Billing
| Synchronization type | Link configuration fee |
|---|---|
| Full data synchronization | Free |
| Incremental data synchronization | Charged. See Billing overview. |
Supported SQL operations for incremental synchronization
| Operation type | SQL operations |
|---|---|
| DML | INSERT, UPDATE, DELETE |
| DDL | CREATE TABLE, DROP TABLE, ADD COLUMN |
DDL notes:
-
If the source is a PolarDB-X 2.0 Enterprise Edition instance, CREATE TABLE is not supported for incremental synchronization.
-
Due to LindormTable limitations, additional column attributes in ADD COLUMN statements are not synchronized. For example, if the source runs
ALTER TABLE test ADD COLUMN col INT DEFAULT 0;, DTS executesALTER TABLE test ADD COLUMN col INT;on the destination.
Required permissions
| Database | Required permissions | How to grant |
|---|---|---|
| Source PolarDB-X 2.0 instance | REPLICATION SLAVE, REPLICATION CLIENT, and SELECT on the objects to be synchronized | Manage database accounts and Account permission issues during data synchronization |
| Destination Lindorm instance | Read and write permissions on the destination namespace | User management |
Create a sync task
Step 1: Go to the Data Synchronization page
Use one of the following consoles to open the Data Synchronization page.
DTS console
-
Log on to the .
-
In the left navigation pane, click Data Synchronization.
-
In the upper-left corner, select the region where the sync task will run.
DMS console
The DMS console layout varies by mode. See Simple mode and Customize the layout and style of the DMS console.
-
Log on to the .
-
In the top navigation bar, hover over Data + AI and choose DTS (DTS) > Data Synchronization.
-
From the drop-down list to the right of Data Synchronization Tasks, select the region where the sync instance resides.
Step 2: Configure source and destination databases
-
Click Create Task.
-
Configure the following parameters.
| Category | Parameter | Description |
|---|---|---|
| — | Task Name | A name for the DTS task. DTS generates a default name — specify a descriptive one to identify the task easily. The name does not need to be unique. |
| Source Database | Select Existing Connection | Select a database instance registered with DTS from the drop-down list. DTS populates the connection parameters automatically. See Manage database connections. If the instance is not registered, configure the parameters below manually. Note
In the DMS console, select the instance from the Select a DMS database instance drop-down list. |
| Database Type | Under Relational Database, select PolarDB-X 2.0. | |
| Access Method | Select Alibaba Cloud Instance. | |
| Instance Region | Select the region where the source PolarDB-X 2.0 instance resides. | |
| Replicate Data Across Alibaba Cloud Accounts | Select No if the source and destination instances are in the same Alibaba Cloud account. | |
| Instance ID | Select the ID of the source PolarDB-X 2.0 instance. | |
| Database Account | Enter the database account for the source instance. See Required permissions. | |
| Database Password | Enter the password for the database account. | |
| Destination Database | Select Existing Connection | Select a database instance registered with DTS from the drop-down list. DTS populates the connection parameters automatically. See Manage database connections. If the instance is not registered, configure the parameters below manually. Note
In the DMS console, select the instance from the Select a DMS database instance drop-down list. |
| Database Type | Under NoSQL Database, select Lindorm. | |
| Access Method | Select Alibaba Cloud Instance. | |
| Instance Region | Select the region where the destination Lindorm instance resides. | |
| Instance ID | Select the ID of the destination Lindorm instance. | |
| Database Account | Enter the database account for the destination instance. See Required permissions. | |
| Database Password | Enter the password for the database account. |
-
Click Test Connectivity and Proceed.
DTS server CIDR blocks must be allowed in the security settings of both the source and destination databases. See Add DTS server IP addresses to a whitelist.
Step 3: Select sync objects
-
In the Configure Objects step, configure the parameters below.
| Parameter | Description |
|---|---|
| Synchronization Types | Incremental Data Synchronization is selected by default. You can also select Full Data Synchronization. Schema synchronization is not supported and cannot be selected. After the precheck, DTS syncs the historical data of the selected objects as the baseline for subsequent incremental sync. |
| Processing Mode of Conflicting Tables | Keep the default value. |
| Capitalization of Object Names in Destination Instance | Keep the default value. |
| Source Objects | Select one or more objects and click the right-arrow icon to move them to Selected Objects. You can select at the database or table level. |
| Selected Objects | If the namespace, table, or column names in the destination Lindorm instance differ from those in the PolarDB-X 2.0 source, use the object name mapping feature to align them. See Map table and column names. Note
Renaming an object may cause dependent objects to fail synchronization. To filter rows by condition, right-click a table and specify a WHERE clause. See Specify filter conditions. To select specific SQL operations for incremental sync, right-click an object in Selected Objects and choose the operations. |
-
Click Next: Advanced Settings.
Step 4: Configure advanced settings
| Parameter | Description |
|---|---|
| Dedicated Cluster for Task Scheduling | By default, DTS schedules the task to a shared cluster. For higher stability, purchase a dedicated cluster. See What is a DTS dedicated cluster. |
| Retry Time for Failed Connections | How long DTS retries if the source or destination database becomes unreachable after the task starts. Valid values: 10–1440 minutes. Default: 720 minutes. We recommend that you set this parameter to a value greater than 30 minutes. If DTS reconnects within this window, the task resumes; otherwise, the task fails. Note
If multiple tasks share the same source or destination database and have different retry windows, the shortest window takes effect. You are charged for the DTS instance during retries. |
| Retry Time for Other Issues | How long DTS retries if DDL or DML operations fail after the task starts. Valid values: 1–1440 minutes. Default: 10 minutes. We recommend that you set this parameter to a value greater than 10 minutes. This value must be less than Retry Time for Failed Connections. |
| Enable Throttling for Full Data Synchronization | Throttles full sync 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 sync to reduce load on the destination. Configure RPS of Incremental Data Synchronization and Data synchronization speed for incremental synchronization (MB/s). |
| Whether to delete SQL operations on heartbeat tables of forward and reverse tasks | Controls whether DTS writes heartbeat SQL operations to the source database. Yes: DTS does not write heartbeat operations — synchronization latency may appear inaccurate. No: DTS writes heartbeat operations — physical backup and cloning of the source database may be affected. |
| Environment Tag | An optional tag to identify the instance environment. |
| Configure ETL | Whether to enable the extract, transform, and load (ETL) feature. Yes: enables ETL and opens a code editor for data processing statements. See Configure ETL in a data migration or data synchronization task and What is ETL?. No: ETL is disabled. |
| Monitoring and Alerting | Whether to configure alerts for the sync instance. Yes: configure alert thresholds and notification contacts — DTS notifies them if the task fails or synchronization latency exceeds the threshold. See Configure monitoring and alerting when you create a DTS task. No: alerting is disabled. |
Step 5: Save settings and run the precheck
-
(Optional) To view the API parameters that correspond to your configuration, hover over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters.
-
Click Next: Save Task Settings and Precheck.
DTS runs a precheck before starting the sync task. The task can start only after all precheck items pass. If the precheck fails, click View Details next to each failed item, fix the issues, and click Precheck Again. If an item triggers an alert that you choose to ignore, click Confirm Alert Details, then click Ignore in the dialog, click OK, and run the precheck again. Ignoring an alert may cause data inconsistency.
Step 6: Purchase the instance
-
Wait until Success Rate reaches 100%, then click Next: Purchase Instance.
-
On the purchase page, configure the following parameters.
| Section | Parameter | Description |
|---|---|---|
| New Instance Class | Billing Method | Subscription: pay upfront for a set period, more cost-effective for long-term use. Pay-as-you-go: billed hourly, suitable for short-term use. Release the instance when it is no longer needed to stop charges. |
| Resource Group Settings | The resource group for the sync instance. Default: default resource group. See What is Resource Management?. | |
| Instance Class | The instance class determines synchronization speed. See Instance classes of data synchronization instances. | |
| Subscription Duration | Available only for the Subscription billing method. Options: 1–9 months, or 1, 2, 3, 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.
You can view the task progress in the task list.
Data type mapping
| Source data type | Lindorm data type |
|---|---|
| BOOLEAN | BOOLEAN |
| BIT | BOOLEAN |
| TINYINT | TINYINT |
| SMALLINT | SMALLINT |
| INTEGER | INTEGER |
| BIGINT | BIGINT |
| BIGINT UNSIGNED | BIGINT |
| FLOAT | FLOAT |
| DOUBLE | DOUBLE |
| DECIMAL | DECIMAL |
| CHAR / VARCHAR / TEXT / TINYTEXT / MEDIUMTEXT / LONGTEXT | CHAR / VARCHAR |
| BINARY | BINARY |
| BLOB | VARBINARY |
| VARBINARY | VARBINARY |
| TIMESTAMP | TIMESTAMP |
| YEAR | INTEGER |
| DATE | DATE (Lindorm 2.8.0.2 and later) / VARCHAR (earlier than 2.8.0.2) |
| DATETIME | VARCHAR |
| TIME | TIME (Lindorm 2.8.0.2 and later) / VARCHAR (earlier than 2.8.0.2) |
| JSON | JSON |
Notes on specific types:
-
BIGINT UNSIGNED: Only values within the BIGINT range (−9,223,372,036,854,775,808 to 9,223,372,036,854,775,807) are supported.
-
DECIMAL: The precision must match the corresponding field in the source instance. A mismatch causes the task to fail.
-
DATETIME: Maps to VARCHAR in the destination. Mapping to TIMESTAMP may cause data inconsistency due to time zone differences. Use the ETL feature during task configuration to ensure data consistency.
-
TIME (Lindorm 2.8.0.2 and later): Stored in
hh:mm:ssformat. Sub-second precision is truncated — for example,08:11:15.354becomes08:11:15.