All Products
Search
Document Center

Data Transmission Service:Two-way synchronization between Tair (Enterprise Edition) instances

Last Updated:Mar 30, 2026

Data Transmission Service (DTS) lets you keep two Tair instances in sync in both directions — writes on either instance propagate to the other. This is the foundation for active geo-redundancy and geo-disaster recovery architectures.

Before you begin

Before you begin, make sure you have:

Supported instance types

Two-way synchronization supports only the following Tair instance types:

  • Tair instances using local disks

  • Tair dynamic random access memory (DRAM)-based instances using cloud disks

  • Tair persistent memory-optimized instances using cloud disks

DTS supports two-way synchronization between exactly two Tair instances. Topologies with three or more instances are not supported.

Limitations

Source database behavior

DTS adds a key prefixed with DTS_REDIS_TIMESTAMP_HEARTBEAT to the source database to track when data is synced to the destination. In cluster architecture, this key is added to each shard. The key is filtered out during synchronization and expires after the task completes.

If the source database is read-only, or the account running the task lacks SETEX permission, the reported synchronization latency may be inaccurate.

Increase the repl-backlog-size parameter in redis.conf to improve synchronization stability.

Avoid running FLUSHDB or FLUSHALL on the source database — these commands can cause data inconsistency between the two instances.

If key expiration is enabled on specific keys in the source database, expired keys may not be deleted immediately on the destination. Run the INFO command to check the key count in the destination database.

Operational constraints

Constraint Details
Changing instance specs If you change the number of shards or scale the memory capacity of the source instance, reconfigure the synchronization task. Clear the previously synced data in the destination instance before reconfiguring.
Database version The destination database version must be the same as or later than the source. An older destination version may cause compatibility issues.
Initial sync load Full data synchronization reads from and writes to both instances. Run the task during off-peak hours to reduce performance impact.
Write access Write only through DTS to the destination database during synchronization to prevent data inconsistency.
Conflict resolution When the same key exists with different values, the record with the latest key value overwrites conflicting records.
Memory limits If the destination instance is deployed in a cluster architecture and a shard reaches its memory limit, or if available storage is insufficient, the task fails with an out of memory (OOM) error.
Data eviction policy The default eviction policy (volatile-lru) can cause data inconsistency if the destination runs low on memory. However, this does not affect the data synchronization task itself. Set the eviction policy to noeviction so that DTS fails writes explicitly rather than silently evicting data — if memory is insufficient, DTS cannot write data and the task fails, but no data is lost due to eviction. For details, see How does Tair (Redis OSS-Compatible) evict data by default?
Transparent data encryption (TDE) If TDE is enabled on either instance, DTS cannot synchronize data.
Resumable sync If transient connection failures interrupt synchronization on the source, DTS may restart a full sync to the destination, which can cause temporary data inconsistency.

Forward and reverse task behavior

A two-way synchronization instance contains a forward synchronization task and a reverse synchronization task. For objects included in both tasks:

  • Only one task can synchronize both full and incremental data; the other task synchronizes incremental data only.

  • Data synced by the current task is not fed back as source data for the other task, preventing sync loops.

Supported commands

The following Redis 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, XADD, XCLAIM, XDEL, XAUTOCLAIM, XGROUP CREATECONSUMER, XTRIM, ZADD, ZINCRBY, ZINTERSTORE, ZREM, ZREMRANGEBYLEX, ZREMRANGEBYRANK, ZREMRANGEBYSCORE, ZUNIONSTORE

The following commands have known limitations:

  • PUBLISH — not supported for synchronization.

  • EVAL / EVALSHA — DTS cannot confirm whether Lua scripts executed on the source were applied to the destination, because the destination does not return explicit execution results during incremental synchronization.

  • SYNC / PSYNC (for LIST data) — DTS does not clear existing data in the destination before writing, which may result in duplicate records.

Configure two-way synchronization

The configuration has two stages: create the forward task, then configure the reverse task. The reverse task becomes available after the forward task reaches the Running state.

Stage overview:

  1. Create the forward task — configure source and destination databases, set synchronization objects and advanced settings, pass the precheck, and purchase the instance.

  2. Configure the reverse task — after the forward task reaches Running, find the automatically created reverse task and complete its configuration.

Stage 1: Create the forward task

Step 1: Go to the Data Synchronization Tasks page

  1. Log on to the Data Management (DMS) console.

  2. In the top navigation bar, click Data + AI.

  3. In the left-side navigation pane, choose DTS (DTS) > Data Synchronization.

The navigation path may vary based on the DMS console mode. See Simple mode and Customize the layout and style of the DMS console. Alternatively, go directly to the Data Synchronization Tasks page.

Step 2: Select a region

On the right side of Data Synchronization Tasks, select the region where the synchronization instance will reside.

In the new DTS console, select the region in the top navigation bar instead.

Step 3: Configure source and destination databases

Warning

Read the Limits displayed on the configuration page before proceeding. Skipping this step may cause the task to fail or result in data inconsistency.

Section Parameter Description
N/A Task Name DTS generates a name automatically. Specify a descriptive name to identify the task — uniqueness is not required.
Source Database Select a DMS database instance Select an existing DMS database instance, or configure the connection manually. If you select an existing instance, DTS populates the remaining parameters automatically.
Database Type Select Tair/Redis.
Connection Type Select Alibaba Cloud Instance.
Instance Region The region where the source Tair instance resides.
Replicate Data Across Alibaba Cloud Accounts Select No for same-account synchronization.
Instance ID The ID of the source Tair instance.
Database Password The password in <user>:<password> format. For example, if the username is admin and the password is Rp829dlwa, enter admin:Rp829dlwa.
Destination Database Select a DMS database instance Select an existing DMS database instance, or configure the connection manually.
Database Type Select Tair/Redis.
Connection Type Select Alibaba Cloud Instance.
Instance Region The region where the destination Tair instance resides.
Instance ID The ID of the destination Tair instance.
Database Password The password in <user>:<password> format.

Step 4: Test connectivity

Click Test Connectivity and Proceed.

DTS automatically adds its server CIDR blocks to the whitelist of Alibaba Cloud database instances and the security group rules of Elastic Compute Service (ECS) instances. For self-managed databases in data centers or hosted by third-party providers, manually add the DTS server CIDR blocks to the database whitelist. See Add the CIDR blocks of DTS servers.

Warning

Adding DTS CIDR blocks to whitelists or security groups introduces security exposure. Take preventive measures: use strong credentials, restrict exposed ports, authenticate API calls, and audit whitelist rules regularly. For higher security, connect the database to DTS through Express Connect, VPN Gateway, or Smart Access Gateway.

Step 5: Configure synchronization objects

Parameter Description
Synchronization Types Select both Full Data Synchronization and Incremental Data Synchronization. Full sync establishes the baseline; incremental sync keeps the instances in sync after that.
Processing Mode of Conflicting Tables Precheck and Report Errors: the precheck fails if data already exists in the destination. Ignore Errors and Proceed: skips the existence check.
Warning

selecting this option may cause data loss, because source records overwrite destination records with the same key.

Synchronization Topology Select Two-way Synchronization.
Source Objects Select one or more objects from Source Objects and click the arrow icon to move them to Selected Objects. Only databases can be selected — individual keys cannot.
Selected Objects To sync from DB 0 to DB 255 or filter by key prefix, right-click the database in Selected Objects and configure options in the Edit Schema dialog. See Map object names and Specify filter conditions. Object names can only be mapped one at a time.

Step 6: Configure advanced settings

Click Next: Advanced Settings.

Parameter Description
Monitoring and Alerting Select Yes to receive notifications when the task fails or synchronization latency exceeds a threshold. Configure the alert threshold and notification settings. See Configure monitoring and alerting. Select No to skip alerting.
Retry Time for Failed Connections The time window during which DTS retries failed connections. Valid values: 10–1440 minutes. Default: 720 minutes. Set this to at least 30 minutes. If DTS reconnects within the window, the task resumes automatically; otherwise it fails.
Note

When multiple tasks share the same source or destination database, the shortest retry window takes precedence. DTS charges for the instance during retries.

Extend Expiration Time of Destination Database Key Extends the validity period of synchronized keys in the destination database, in seconds. Set this to 600 when using EXPIRE, PEXPIRE, EXPIREAT, or PEXPIREAT commands to maintain data consistency across instances.
Configure ETL Select Yes to enable Extract, Transform, and Load (ETL) processing, then enter data transformation statements in the code editor. See Configure ETL in a data migration or data synchronization task. Select No to skip ETL.

Step 7: Save task settings and run the precheck

Click Next: Save Task Settings and Precheck.

To preview the API parameters for this task configuration, move the pointer over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters.

DTS runs a precheck before starting the task. If any check items fail:

  • Click View Details next to the failed item, resolve the issue, then click Precheck Again.

  • For alert items that can be ignored: click Confirm Alert Details, then click Ignore in the View Details dialog, confirm, and click Precheck Again. Ignoring alerts may result in data inconsistency.

Step 8: Purchase the instance

Wait until Success Rate reaches 100%, then click Next: Purchase Instance.

On the purchase page, configure the following:

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 no longer needed to stop charges.
Resource Group Settings The resource group for this instance. Default: default resource group. See What is Resource Management?
Instance Class Controls synchronization throughput. See Instance classes of data synchronization instances.
Subscription Duration Available only for Subscription billing. Options: 1–9 months, or 1, 2, 3, or 5 years.

Read and select Data Transmission Service (Pay-as-you-go) Service Terms, then click Buy and Start. In the dialog, click OK.

The forward synchronization task appears in the task list.

Step 9: Wait for the forward task to reach Running

Wait until the forward synchronization task reaches the Running state.

If both Full Data Synchronization and Incremental Data Synchronization are selected, Incremental Data Synchronization is shown in the task list after the full sync completes.

Stage 2: Configure the reverse task

Step 10: Find and start the reverse task

In the task list, find the reverse synchronization task listed below the forward task, then click Configure Task.

Step 11: Configure the reverse task

Follow the same steps as Steps 3–7 above.

Important
  • The reverse task requires fewer parameters than the forward task. Follow the on-screen instructions.

  • In the reverse task, the source and destination instances are swapped: the source is the destination from the forward task, and vice versa. Verify instance names, accounts, and passwords carefully.

Step 12: Complete the reverse task precheck

Wait until Success Rate reaches 100%, then click Back.

Step 13: Verify two-way synchronization is active

Wait until both the forward and reverse synchronization tasks are in the Running state. Two-way synchronization is now active.

What's next