ApsaraDB for Redis provides multiple data synchronization solutions based on Data Transmission Service (DTS) and redis-shake. These solutions apply to the following scenarios: data synchronization between on-premises Redis databases and Alibaba Cloud services, active geo-redundancy, disaster recovery, and data analysis.

Data synchronization tools

  • DTS (recommended)

    DTS is a real-time data streaming service that is provided by Alibaba Cloud. The service allows you to migrate, subscribe to, and synchronize data by using stable and secure transmission channels. DTS supports one-way and two-way data synchronization. These synchronization solutions apply to scenarios such as active geo-redundancy and geo-disaster recovery.

  • redis-shake

    redis-shake is an open source Linux-based tool that is developed by Alibaba Cloud. You can use this tool to parse (decode mode), restore (restore mode), back up (dump mode), and synchronize (sync or rump mode) data in ApsaraDB for Redis instances. For scenarios in which DTS is not suitable, you can use redis-shake to synchronize data.

The following table describes the differences between DTS and redis-shake for Redis data synchronization.

Note You can synchronize data between different database types and architectures described in the following table. For example, you can synchronize data from a self-managed Redis database in the cluster architecture to an ApsaraDB for Redis Community Edition instance in the standard architecture.
Table 1. Differences
Tool Supported source database Supported destination database Supported architecture Supported synchronization topology
DTS (recommended)
  • Self-managed Redis database

    Redis 2.8, 3.0, 3.2, 4.0, and 5.0

  • ApsaraDB for Redis Community Edition

    Redis 4.0 and 5.0

  • ApsaraDB for Redis Enhanced Edition (Tair)

    Redis 5.0

  • ApsaraDB for Redis Community Edition

    Redis 4.0 and 5.0

  • ApsaraDB for Redis Enhanced Edition (Tair)

    Redis 5.0

Note Read/write splitting instances do not support data synchronization between ApsaraDB for Redis instances that belong to different Alibaba Cloud accounts.
  • One-way synchronization
  • Cross-account synchronization
  • Two-way synchronization
Note Only ApsaraDB for Redis Enhanced Edition (Tair) instances whose database engine version is Redis 5.0 support two-way synchronization.
redis-shake
  • Self-managed Redis database

    Redis 2.8, 3.0, 3.2, 4.0, and 5.0

  • Self-managed Redis database

    Redis 2.8, 3.0, 3.2, 4.0, and 5.0

  • ApsaraDB for Redis Community Edition

    Redis 4.0 and 5.0

  • ApsaraDB for Redis Enhanced Edition (Tair)

    Redis 5.0

One-way synchronization

Required permissions

The permissions that are required by DTS and redis-shake vary based on different synchronization scenarios. Before you configure data synchronization, you must obtain the required permissions on the source and destination databases based on the synchronization scenarios. The following table describes the required permissions.

Note For more information about how to create an account for an ApsaraDB for Redis instance and grant the required permissions to the account, see Create and manage database accounts.
Table 2. Required permissions
Tool Synchronization scenario Permission on the source database Permission on the destination database
DTS (recommended)
  • Synchronize data between ApsaraDB for Redis instances that belong to the same Alibaba Cloud account
  • Synchronize data from an ApsaraDB for Redis instance to a self-managed Redis database
Read permissions Read and write permissions
  • Synchronize data between ApsaraDB for Redis instances that belong to different Alibaba Cloud accounts
Replication permissions
Note You cannot create an account that has replication permissions for the source instance in the cluster or read/write splitting architecture. If the destination instance is an ApsaraDB for Redis instance, you can submit a ticket to eliminate the limit.
Read and write permissions
  • Synchronize data from a self-managed Redis database to an ApsaraDB for Redis instance
  • Synchronize data between self-managed Redis databases
Permissions to run the SYNC or PSYNC command Read and write permissions
redis-shake
  • Synchronize data from a self-managed Redis database to an ApsaraDB for Redis instance
  • Synchronize data between self-managed Redis databases
Permissions to run the SYNC or PSYNC command Read and write permissions
  • Synchronize data between ApsaraDB for Redis instances that belong to the same Alibaba Cloud account
  • Synchronize data between ApsaraDB for Redis instances that belong to different Alibaba Cloud accounts
  • Synchronize data from an ApsaraDB for Redis instance to a self-managed Redis database
Replication permissions Read and write permissions

Data synchronization solutions

Notice The configuration methods for different scenarios are similar. The following table describes the solutions for general data synchronization scenarios. If your synchronization scenario is not included in the following table, you can view the topics about similar scenarios and configure the Required permissions.
Scenario Tool Solution
Synchronize data from a self-managed database to an ApsaraDB for Redis instance DTS Synchronize data from a self-managed Redis cluster to an ApsaraDB for Redis cluster instance
Synchronize data from a self-managed Redis database hosted on ECS to an ApsaraDB for Redis instance
Synchronize data from a Codis cluster hosted on ECS to an ApsaraDB for Redis instance
Synchronize data from a Twemproxy Redis cluster hosted on ECS to an ApsaraDB for Redis instance
ssdb-port Use ssdb-port to synchronize data from SSDB to ApsaraDB for Redis
Note You can use ssdb-port to synchronize data from SSDB to ApsaraDB for Redis in real time.
Synchronize data between ApsaraDB for Redis instances DTS Synchronize data in one direction between ApsaraDB for Redis instances
Configure two-way data synchronization between ApsaraDB for Redis Enhanced Edition (Tair) instances
Synchronize data between ApsaraDB for Redis cluster instances across Alibaba Cloud accounts
Synchronize data between self-managed Redis databases DTS Synchronize data from a self-managed Redis database connected over Express Connect, VPN Gateway, or Smart Access Gateway to a self-managed Redis database hosted on ECS