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

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 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 on 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 based on the support that the services provide for Redis data synchronization. For more information, see the following table.

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 a standard instance of ApsaraDB for Redis Community Edition.
Table 1. Synchronization support
Tool Supported source database Supported destination database Supported architecture Supported synchronization topology
DTS (recommended)
  • Self-managed Redis database

    Versions 2.8, 3.0, 3.2, 4.0, and 5.0

  • ApsaraDB for Redis Community Edition

    Version 4.0 and 5.0

  • ApsaraDB for Redis Enhanced Edition (Tair)

    Version 5.0

  • Self-managed Redis database

    Versions 2.8, 3.0, 3.2, 4.0, and 5.0

  • ApsaraDB for Redis Community Edition

    Version 4.0 and 5.0

  • ApsaraDB for Redis Enhanced Edition (Tair)

    Version 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
  • Two-way synchronization
Note Only ApsaraDB for Redis Enhanced Edition instances (Redis 5.0) support two-way synchronization.
redis-shake
  • Self-managed Redis database

    Versions 2.8, 3.0, 3.2, 4.0, and 5.0

  • ApsaraDB for Redis Community Edition

    Version 4.0 and 5.0

  • Self-managed Redis database

    Versions 2.8, 3.0, 3.2, 4.0, and 5.0

  • ApsaraDB for Redis Community Edition

    Version 4.0 and 5.0

  • ApsaraDB for Redis Enhanced Edition (Tair)

    Version 5.0

One-way synchronization

Required permissions

DTS and redis-shake have different required permissions for different synchronization scenarios. Before you configure data synchronization, you must obtain relevant permissions for the source and destination databases based on the synchronization scenarios that are described in the following table.

Note For more information about how to create an account for an ApsaraDB for Redis instance and grant the account required permissions, see Create and manage database accounts.
Table 2. Required permissions
Tool 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 If the source database is a cluster instance or read/write splitting instance, you cannot create an account that is granted the replication permissions. If the destination database is an ApsaraDB for Redis instance, you can submit a ticket to create an account that has the replication permissions.
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 common scenarios are similar. The following table describes configuration methods for general data synchronization scenarios. If your scenario is not included in the following table, you can refer to the documentation 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 Sequence Similarity DataBase (SSDB) to ApsaraDB for Redis in real time.
Synchronize data between ApsaraDB for Redis instances. DTS Configure one-way data synchronization 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