Change tracking lets you subscribe to incremental data changes from a PolarDB for MySQL cluster in real time. Use it to build lightweight cache updates, decouple services asynchronously, or power extract, transform, and load (ETL) pipelines.
This topic shows you how to create a change tracking task from the DTS console or DMS console.
Before you begin
Steps overview:
Verify prerequisites — cluster version, VPC, and account permissions.
Configure the source database connection.
Select the objects to track.
Configure advanced settings (retry behavior, alerting).
Run the precheck and purchase the instance.
Prerequisites
Before you begin, ensure that you have:
A PolarDB for MySQL cluster running version 5.6, 5.7, or 8.0. See Create a cluster on a custom basis and Create a subscription cluster
A VPC and a vSwitch to host the change tracking instance. See Create a VPC and a vSwitch
A database account with Read-only access, or a custom account with the REPLICATION CLIENT, REPLICATION SLAVE, SHOW VIEW, and SELECT permissions
Limitations
Source database requirements
Tables must have PRIMARY KEY or UNIQUE constraints with no duplicate fields. Without these, some tracked changes may be duplicated.
A single change tracking task supports up to 500 tables. Exceeding this limit causes a request error. To track more than 500 tables, split them across multiple tasks or track the entire database instead.
Binary logging must be enabled, and
loose_polar_log_binmust be set toon. If not configured correctly, the precheck fails and the task cannot start.DTS requires binary logs to be retained for more than 24 hours. Shorter retention periods can cause the task to fail and, in extreme cases, data inconsistency or loss. Issues caused by insufficient binary log retention are not covered by the DTS Service-Level Agreement (SLA).
Read-only and temporary instances must have transaction logs enabled.
Other limitations
For FLOAT and DOUBLE columns, DTS uses
ROUND(COLUMN, PRECISION)to retrieve values. If no precision is specified, DTS defaults to 38 digits for FLOAT and 308 digits for DOUBLE. Verify that these defaults meet your requirements before starting the task.DTS does not track DDL operations performed using pt-online-schema-change. This can cause schema conflicts when the change tracking client writes consumed data to destination tables.
Rows larger than 16 MB cannot be consumed. Attempting to do so may cause an out of memory (OOM) error on the change tracking client.
If a DTS instance fails, the DTS helpdesk attempts recovery within 8 hours. Recovery operations may include restarting the instance or adjusting parameters — only DTS instance parameters are modified, not database parameters.
Procedure
Step 1: Open the Change Tracking Tasks page
Use one of the following methods to navigate to the Change Tracking Tasks page.
DTS console
Log on to the DTS console.DTS console
In the left-side navigation pane, click Change Tracking.
In the upper-left corner, select the region where the change tracking instance resides.
DMS console
The exact navigation path may vary based on your DMS console mode and layout. See Simple mode and Customize the layout and style of the DMS console.
Log on to the DMS console.DMS console
In the top navigation bar, move the pointer over Data + AI > DTS (DTS) > Change Tracking.
From the drop-down list to the right of Change Tracking Tasks, select the region where the instance resides.
Step 2: Configure the source database
On the Change Tracking Tasks page, click Create Task.
In the Source Database and Consumer Network Type sections, configure the following parameters.
WarningAfter selecting the source database instance, read the Limits displayed at the top of the page. Skipping this step may cause the task to fail or prevent you from consuming tracked data.
Parameter Description Task Name A descriptive name for the change tracking task. DTS assigns a name automatically, but a meaningful name makes the task easier to identify. Names don't need to be unique. Select Existing Connection If the database is already registered with DTS, select it from the list — DTS fills in the connection details automatically. Otherwise, enter the database information manually. Database Type Select PolarDB for MySQL. Access Method Select Alibaba Cloud Instance. Instance Region Select the region where the PolarDB for MySQL cluster resides. Replicate Data Across Alibaba Cloud Accounts Select No for same-account tracking. To track data across Alibaba Cloud accounts, select Yesalert notification settings and provide the Alibaba Cloud Account and RAM Role Name. You must also configure Resource Access Management (RAM) authorization for the account used to set up the DTS task. See Configure RAM authorization for cross-account DTS tasks. PolarDB Cluster ID Select the PolarDB for MySQL cluster ID. Database Account Enter the Read-only Account for the PolarDB for MySQL cluster, or a custom account with the REPLICATION CLIENT, REPLICATION SLAVE, SHOW VIEW, and SELECT permissions. Database Password The password for the database account. Encryption Select an encryption method as needed. For Secure Sockets Layer (SSL) encryption, see Set SSL encryption. Network Type Fixed to VPC. Select the VPC and vSwitch for the change tracking instance. If the change tracking client is deployed in a VPC, select the same VPC and vSwitch as the client to minimize network latency. This setting cannot be changed after the task is configured. Click Test Connectivity and Proceed.
DTS server IP addresses must be added to the allowlist of your source database. See Add DTS server IP addresses to a whitelist.
Step 3: Select objects to track
On the Configure Objects page, configure the following settings:
| Configuration | Description |
|---|---|
| Data Change Types | Selected by default and cannot be changed. Choose from: Data Update — tracks INSERT, DELETE, and UPDATE operations; Schema Update — tracks create, delete, and modify operations on all object schemas. For schema updates, use the change tracking client to filter the data you want to consume. |
| Source Objects | Select objects from the Source Objects list and click the right-arrow icon to move them to Selected Objects. Select tables to track specific tables only, or select a database to track all objects in that database, including new objects added later. To track more tables after the task is configured, see Modify the objects for change tracking. |
Click Next: Advanced Settings.
Step 4: Configure advanced settings
| Parameter | Description |
|---|---|
| Dedicated Cluster for Task Scheduling | By default, DTS runs the task on a shared cluster. To use dedicated resources, purchase a dedicated cluster. See What is a DTS dedicated cluster. |
| Retry Time for Failed Connections | How long DTS retries after a failed connection. Range: 10–1,440 minutes. Default: 720 minutes. Set to at least 30 minutes. If DTS reconnects within this period, the task resumes; otherwise, it fails. When multiple tasks share the same database instance, the shortest retry period across all tasks takes precedence. Fees apply during retry periods — release the DTS instance promptly if the source database is no longer available. |
| Retry Time for Other Issues | How long DTS retries after failed DDL or DML operations. Range: 1–1,440 minutes. Default: 10 minutes. Set to at least 10 minutes. This value must be less than Retry Time for Failed Connections. |
| 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 table SQL operations to the source database. Select Yes to suppress writes (a latency indicator may appear on the DTS instance). Select No to allow writes (physical backup and cloning of the source database may be affected). |
| Monitoring and Alerting | Select Yes to enable alerts when the task fails or latency exceeds the 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 and purchase the instance
Click Next: Save Task Settings and Precheck. To preview the API parameters for this task configuration, hover over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters before proceeding.
- DTS runs a precheck before the task starts. The task can only start after the precheck passes. - If any item fails, click View Details next to the failed item and fix the issue. Then rerun the precheck. - If an alert is generated for an item: fix and recheck items that cannot be ignored; for ignorable alerts, click Confirm Alert Details, then Ignore, confirm, and click Precheck Again. Ignoring alerts may cause data inconsistency.
Wait until Success Rate reaches 100%, then click Next: Purchase Instance.
On the Purchase page, configure the billing method.
Parameter Description Billing method Subscription — pay upfront, lower cost for long-term use. Duration options: 1–9 months, or 1, 2, 3, or 5 years. 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. Defaults to default resource group. See What is Resource Management? Subscription Duration Available for the Subscription billing method only. Select the subscription period and number of instances. Read and accept the Data Transmission Service (Pay-as-you-go) Service Terms.
Click Buy and Start. The task appears in the task list where you can monitor its progress.
What's next
After the change tracking task is running, create consumer groups based on your downstream client to consume the tracked data.