Data Transmission Service (DTS) supports one-way synchronization between ApsaraDB for Tair (Redis OSS-Compatible) instances. Use this feature for active geo-redundancy and geo-disaster recovery.
Prerequisites
Before you begin, make sure that:
The destination ApsaraDB for Tair (Redis OSS-Compatible) instance is created. For more information, see Step 1: Create an instance.
The available storage space of the destination instance is larger than the used storage space of the source instance.
The destination database version is the same as or later than the source database version. A lower destination version may cause compatibility issues.
The source database account has read permissions, and the destination database account has read and write permissions. For more information, see Create and manage database accounts.
Transparent data encryption (TDE) is not enabled on the source or destination instance. TDE-enabled instances cannot be used with DTS.
If the source is an ApsaraDB for Tair (Enterprise Edition) instance with a Persistent Memory storage medium, the
appendonlyparameter is set toyes. For more information, see Disable AOF persistence.Run
config set repl-timeout 600on the source instance to set the master-replica replication timeout to 600 seconds. If the source instance stores a large amount of data, increase this value based on your needs.Increase the value of
repl-backlog-sizeinredis.confon the source instance to improve synchronization stability.
Billing
| Synchronization type | Fee |
|---|---|
| Full data synchronization | Free |
| Incremental data synchronization | Charged. For more information, see Billing overview. |
Supported synchronization topologies
One-way one-to-one synchronization
One-way one-to-many synchronization
One-way cascade synchronization
For details, see Synchronization topologies.
Commands that can be synchronized
The following commands can be synchronized:
APPEND; BITOP, BLPOP, BRPOP, BRPOPLPUSH; DECR, DECRBY, DEL; EVAL, EVALSHA, EXEC, EXPIRE, EXPIREAT; GEOADD, GETSET; HDEL, HINCRBY, HINCRBYFLOAT, HMSET, HSET, HSETNX; INCR, INCRBY, INCRBYFLOAT; LINSERT, LPOP, LPUSH, LPUSHX, LREM, LSET, LTRIM; MOVE, MSET, MSETNX, MULTI; PERSIST, PEXPIRE, PEXPIREAT, PFADD, PFMERGE, PSETEX; RENAME, RENAMENX, RESTORE, RPOP, RPOPLPUSH, RPUSH, RPUSHX; SADD, SDIFFSTORE, SELECT, SET, SETBIT, SETEX, SETNX, SETRANGE, SINTERSTORE, SMOVE, SPOP, SREM, SUNIONSTORE; ZADD, ZINCRBY, ZINTERSTORE, ZREM, ZREMRANGEBYLEX, ZUNIONSTORE, ZREMRANGEBYRANK, ZREMRANGEBYSCORE; SWAPDB, UNLINK (source engine version 4.0 only); XADD, XCLAIM, XDEL, XAUTOCLAIM, XGROUP CREATECONSUMER, XTRIM.
The following commands cannot be synchronized:
PUBLISH: not supported.
EVAL/EVALSHA (Lua scripts): DTS cannot confirm whether Lua scripts are executed on the destination during incremental synchronization, because the destination does not return explicit results.
SYNC/PSYNC for LIST data: DTS does not clear existing data before syncing, so the destination may contain duplicate records.
Usage notes
Before you configure the task
| Category | Note |
|---|---|
| Source database limits | DTS inserts a key prefixed with DTS_REDIS_TIMESTAMP_HEARTBEAT into the source database to track update timestamps. In a cluster architecture, DTS inserts this key into each shard. The key is filtered during synchronization and expires when the task ends. |
| Source database limits | If the source database is read-only or the DTS account lacks WRITE (SETEX) permission, the reported synchronization latency may be inaccurate. |
| Source database limits | Do not run FLUSHDB or FLUSHALL on the source database. These commands cause data inconsistency between the source and destination. |
| Source database limits | If expiration policies are set on specific source keys, those keys may not be deleted promptly after expiry. The destination may therefore contain fewer keys than the source. Run the info command to check the key count on the destination. |
| Source database limits | If the source is a self-managed standalone Redis instance synchronizing to a Redis cluster: each command can only operate on a single slot. Performing operations on keys that belong to different slots causes the following error and interrupts synchronization: CROSSSLOT Keys in request don't hash to the same slot. Operate on only one key at a time during synchronization. |
| Destination database limits | During full data synchronization, DTS uses read and write resources of both instances, which may increase server load. Synchronize data during off-peak hours. |
| Destination database limits | Only use DTS to write data to the destination during synchronization. Writing from other sources causes data inconsistency. |
| Destination database limits | If the destination is deployed in a cluster architecture and a shard reaches its memory limit or the instance runs out of storage, the task fails due to out of memory (OOM). |
| Destination database limits | The default maxmemory-policy for Tair (Redis OSS-Compatible) instances is volatile-lru. If the destination has insufficient memory, data eviction may cause inconsistency between instances without stopping the task. To prevent data loss, set maxmemory-policy to noeviction on the destination — the task fails if memory runs out, but no data is silently lost. For more information, see What is the default eviction policy of Tair? |
| TLS/SSL | If the ApsaraDB for Tair (Redis OSS-Compatible) instance has TLS enabled, connect to DTS using SSL-encrypted. TLSv1.3 is not supported. Instances with TLS enabled cannot connect to DTS as an Alibaba Cloud Instance. |
| Version compatibility | The destination database version must be the same as or later than the source. |
During and after synchronization
| Category | Note |
|---|---|
| Reconfiguration required | If the number of shards in the source instance changes, or you scale the database specifications (such as memory capacity), reconfigure the synchronization task. Clear the previously synchronized data from the destination before reconfiguring to ensure consistency. |
| Reconfiguration required | If the connection address of the source or destination self-managed Redis database changes during synchronization, reconfigure the task. |
| Full resynchronization triggers | The following situations may cause DTS to resynchronize all data to the destination, resulting in a temporary data inconsistency: a transient connection failure where breakpoint resume fails; a master-slave switch or failover on the source or destination; a change in the connection address; or a modification to the synchronization objects. |
| Restarting the task | Restarting a synchronization instance that includes both full and incremental tasks causes DTS to re-execute both phases. |
| DTS task restoration | If a DTS task fails, DTS technical support will attempt to restore it within 8 hours. During this process, the task may be restarted and task parameters (not database parameters) may be modified. Parameters that may be modified are listed in Modify instance parameters. |
Configure a one-way synchronization task
Step 1: Open the Data Synchronization page
Use one of the following methods to open the Data Synchronization page.
DTS console
Log on to the DTS console.
In the left-side navigation pane, click Data Synchronization.
In the upper-left corner, select the region where the synchronization instance resides.
DMS console
The actual operations may vary based on the mode and layout of the DMS console. For more information, see Simple mode and Customize the layout and style of the DMS console.
Log on to the 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 synchronization instance resides.
Step 2: Create a task
Click Create Task to open the task configuration page.
Step 3: Configure the source and destination databases
| Section | Parameter | Description |
|---|---|---|
| N/A | Task Name | The task name. DTS generates a name automatically. Specify a descriptive name for easy identification. The name does not need to be unique. |
| Source Database | Select Existing Connection | If the instance is already registered with DTS, select it from the drop-down list — DTS auto-fills the remaining parameters. See Manage database connections. In the DMS console, use the Select a DMS database instance drop-down. If the instance is not registered, configure the parameters below manually. |
| Source Database | Database Type | Select Tair/Redis. |
| Source Database | Access Method | Select Alibaba Cloud Instance. |
| Source Database | Instance Region | Select the region of the source ApsaraDB for Tair (Redis OSS-Compatible) instance. |
| Source Database | Replicate Data Across Alibaba Cloud Accounts | Select No (this example uses instances in the same account). |
| Source Database | Instance ID | Select the ID of the source instance. |
| Source Database | Authentication Method | Select Password Login for this example. Note Account + Password Login requires Redis version 6.0 or later. For Secret-free login, enable password-free access on the instance first — see Enable password-free access. |
| Source Database | Database Password | Enter the password for the source instance. The format is <user>:<password> — for example, admin:Rp829dlwa. For account permissions, see the Prerequisites section. |
| Source Database | Encryption | Select Non-encrypted or SSL-encrypted. If Access Method is not Alibaba Cloud Instance and you select SSL-encrypted, upload a CA Certificate and enter a CA Key. |
| Destination Database | Select Existing Connection | Same as the source database. |
| Destination Database | Database Type | Select Tair/Redis. |
| Destination Database | Access Method | Select Alibaba Cloud Instance. |
| Destination Database | Instance Region | Select the region of the destination ApsaraDB for Tair (Redis OSS-Compatible) instance. |
| Destination Database | Replicate Data Across Alibaba Cloud Accounts | Select No (this example uses instances in the same account). |
| Destination Database | Instance ID | Select the ID of the destination instance. |
| Destination Database | Authentication Method | Select Password Login for this example. Same notes apply as for the source. |
| Destination Database | Database Password | Enter the password for the destination instance. The format is <user>:<password>. |
| Destination Database | Encryption | Select Non-encrypted or SSL-encrypted. |
Click Test Connectivity and Proceed at the bottom of the page.
Make sure the CIDR blocks of DTS servers are added to the security settings of both instances to allow DTS access. For more information, see Add the CIDR blocks of DTS servers.
If the source or destination is a self-managed database not accessed via Alibaba Cloud Instance, click Test Connectivity in the CIDR Blocks of DTS Servers dialog box.
Step 4: Configure synchronization objects
In the Configure Objects step, set the following parameters:
Parameter Description Synchronization Types Select Incremental Data Synchronization, or Full Data Synchronization + Incremental Data Synchronization. NoteIf you select Incremental Data Synchronization, also select Full Data Synchronization.
Synchronization Topology Select One-way Synchronization. NoteThis parameter is only available when both the source and destination are Tair (Enterprise Edition) instances.
Processing Mode of Conflicting Tables Precheck and Report Errors: DTS checks whether data exists in the destination. If data exists, the precheck fails and the task cannot start. Ignore Errors and Proceed: Skips the existence check. WarningThis may cause data loss — source records overwrite destination records with the same keys.
Source Objects Select databases to synchronize and click the arrow icon to add them to Selected Objects. You can only select databases, not individual keys. To filter specific keys, use the data filtering feature in Selected Objects. Selected Objects To map data to a specific database (DB 0–DB 255) or filter by key prefix, right-click a database in Selected Objects and configure settings in the Edit Schema dialog. See Map object names and Specify filter conditions. Click Next: Advanced Settings and configure the following:
Parameter Description Dedicated Cluster for Task Scheduling By default, DTS uses the shared cluster. Purchase a dedicated cluster for higher task stability. See What is a DTS dedicated cluster. Retry Time for Failed Connections How long DTS retries if the source or destination becomes unavailable. Valid values: 10–1440 minutes. Default: 720 minutes. Set this to more than 30 minutes. If DTS reconnects within this period, the task resumes; otherwise, it fails. NoteIf multiple tasks share the same source or destination database, the shortest retry time applies. Charges continue while DTS is retrying.
Retry Time for Other Issues How long DTS retries if DDL or DML operations fail. Valid values: 1–1440 minutes. Default: 10 minutes. Set this to more than 10 minutes. This value must be less than Retry Time for Failed Connections. Enable Throttling for Full Data Synchronization Limit DTS's resource usage on the source and destination during full synchronization by setting 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 Limit DTS's resource usage during incremental synchronization by setting RPS of Incremental Data Synchronization and Data synchronization speed for incremental synchronization (MB/s). Environment Tag An optional tag to identify the DTS instance. Extend Expiration Time of Destination Database Key Extends the validity period of keys synchronized to the destination. Set this if your workflow uses the following commands to ensure consistency: EXPIRE key seconds,PEXPIRE key milliseconds,EXPIREAT key timestamp,PEXPIREAT key timestampMs.NoteIn distributed lock scenarios, extended expiry may delay lock release.
Configure ETL Select Yes to configure the extract, transform, and load (ETL) feature, then enter processing statements in the code editor. Select No to skip. See What is ETL? and Configure ETL in a data migration or data synchronization task. Monitoring and Alerting Select Yes to configure alerts for task failures or latency exceeding a threshold, then set the alert threshold and notification contacts. Select No to skip. See Configure monitoring and alerting when you create a DTS task. Click Next Step: Data Verification to configure data verification. For more information, see Configure a data verification task.
Step 5: Run the precheck
To view the API parameters for this task configuration, hover over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters.
Click Next: Save Task Settings and Precheck to save the configuration and start the precheck.
The task can only start after the precheck passes.
If the precheck fails, click View Details next to each failed item, troubleshoot the issues, then rerun the precheck.
If an alert is triggered: for items that cannot be ignored, troubleshoot and rerun the precheck. For items that can be ignored, click Confirm Alert Details, then click Ignore > OK > Precheck Again. Ignoring an alert may result in data inconsistency.
Step 6: Purchase and start the instance
Wait until the 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 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 avoid ongoing charges. Resource Group Settings The resource group for this instance. Default: default resource group. See What is Resource Management? Instance Class DTS provides multiple instance classes that differ in synchronization speed. Select based on your throughput requirements. See Instance classes of data synchronization instances. Subscription Duration For subscription billing only: select 1–9 months, or 1, 2, 3, or 5 years. Read and select Data Transmission Service (Pay-as-you-go) Service Terms.
Click Purchase And Start, then click OK in the confirmation dialog.
The task appears on the Data Synchronization page. You can monitor its progress there.
If the task includes both full and incremental synchronization (Synchronization Types includes both Full Data Synchronization and Incremental Data Synchronization), it displays as Incremental Data Synchronization in the task list after the full phase completes.
What's next
After the synchronization task is running, verify that data is flowing correctly:
Check the task status on the Data Synchronization page — a healthy task shows Synchronizing.
Monitor synchronization latency in the task details. High or growing latency may indicate that the source database is generating changes faster than DTS can apply them, or that a network issue is slowing replication.
If you configured Monitoring and Alerting, confirm that alerts are set up for task failure and latency thresholds.
If the task fails, check the error details and refer to the Usage notes section for common causes. DTS technical support will also attempt to restore a failed task within 8 hours.