Configure DTS tasks for PolarDB-X source instances

更新时间:
复制 MD 格式

DTS supports data synchronization and migration from sources. When more than two RDS for MySQL instances are attached to the source, a single DTS task can cause performance bottlenecks and stability risks. Configure a separate DTS task for each attached RDS for MySQL instance under the instance to improve performance and stability.

Prerequisites

Review Limits for using PolarDB-X as the source instance.

Configuration options

Solution Configuration method Summary
Solution 1 Configure a separate DTS task for each RDS for MySQL instance attached to the instance. Map database and table names from each source instance to the destination.

Provides better performance and stability than a single task for the instance.

Important This solution supports only table-level synchronization or migration.
Recommended. Better performance and stability than Solution 2, with no limit on attached RDS for MySQL instances under the instance.
Solution 2 Use the instance directly as the source for a single DTS task. If more than two RDS for MySQL instances are attached, task stability and operability degrade significantly and may impact your business. Performance and stability risks increase when more than two RDS for MySQL instances are attached to the source instance.

Solution comparison

Item Solution 1 Solution 2
Performance Multiple DTS tasks significantly improve write performance for large-scale data to PolarDB Distributed Edition . A single DTS task for the source instance. Performance bottlenecks can occur under high write volumes.
Stability High stability.

Each RDS for MySQL instance under the instance runs its own DTS task. A single task failure does not affect others—you only need to recover the failed task.

Moderate stability.

A single DTS task using PolarDB distributed version as the source means any fault fails the entire task.

Ease of use More complex. Requires multiple tasks with table name mapping from each source RDS for MySQL instance to the destination. Configuration effort scales with the number of attached instances and tables. Simple. One DTS task for the source instance.
Resource usage Consumes n DTS instances for n separate tasks. Consumes a single DTS instance.

DDL synchronization and incremental migration

Currently, DTS tasks with a source do not support DDL synchronization or incremental migration. If you run DDL operations on the source instance during a task, take these steps to prevent write failures to the destination:

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

In certain scenarios with as the source, you can apply DDL changes without stopping the task. The following table lists supported scenarios and operations.

Scenario Operation
Use Solution 1 for table-level synchronization only.
  • Add tables by modifying the synchronization objects.
  • Adding or deleting columns is supported only between instances:
    1. Modify the synchronization objects to include or exclude the columns.
    2. Add or delete columns in the destination database first, then perform the same operations on the source. If a column already exists in the destination, DTS ignores the error and does not report a write failure.
Use Solution 2 when the synchronization or migration object is the entire database.
  • Only adding tables is supported. Add the new table to the destination database first, then execute the add-table operation at the source.
  • Adding or deleting columns is not supported.
    Warning If you add a column to the source PolarDB-X instance, the underlying physical tables may become inconsistent—some have the new column while others do not. DTS may fail to locate the column or lose its data, causing task failure or data inconsistency.
Use Solution 2 when the synchronization object is not the entire database.
  • Only adding tables is supported:
    1. Modify the synchronization objects to include the new table.
    2. Add the new table to the destination database first, then execute the add-table operation on the source.
  • Adding or deleting columns is not supported.