Skip to main content

Redis

Target DataSource:

Connection

Basic Functions

FunctionDescription
Full Data Migration and Incremental Data Sync

Synchronize data by executing the PSYNC command, with optional historical data initialization.

Position Resetting

Initialize historical data again by modifying the position.

Supported Deployment

Support single node, Sentinel, and Redis sharded cluster.

Supported Commands

Currently support the following commands (continuously expanding):

  • SET, SETNX, SETEX, APPEND, GETSET, HSET, HSETNX, MSET, HMSET
  • DEL, HDEL, UnLink
  • INCR, INCRBY, HINCRBY
  • LPUSH, RPUSH, LSET, LINSERT, LREM
  • SADD, ZADD, ZREM, ZREMRANGEBYSCORE, SREM
  • EXPIRE, PExpire, RENAME, Eval

Advanced Functions

FunctionDescription
Cache Expiration Time

Allow setting the cache expiration time (in seconds) for data after it is written to Redis.

Bidirectional Redis Synchronization

Support full data migration and incremental data synchronization in which the circular data replication is prevented. See Redis Bidirectional Data Synchronization.

Supported Commands for Redis Bidirectional Synchronization

Currently, the following commands are supported in bidirectional synchronization (continuously expanding):

  • SET, SETNX, SETEX, APPEND, GETSET, HSET, HSETNX, MSET, HMSET
  • DEL, HDEL, UnLink
  • LPUSH, RPUSH, LSET, LINSERT, LREM
  • SADD, ZADD, ZREM, ZREMRANGEBYSCORE
  • EXPIRE, PExpire, Eval

Limits

LimitDescription
Failover Compatibility

Redis 3.x, due to its use of an earlier version of PSYNC, has poor failover compatibility and carries a risk of data loss.

Replication Backlog Configuration

The default Redis replication parameter repl-backlog-size is too small. If there is significant data synchronization latency, it may trigger a FULL SYNC for full initialization. It is recommended to increase the value of this parameter.

Examples

TitleDetails
Redis Bidirectional Data Synchronization

See Redis Bidirectional Data Synchronization.


Source

Prerequisites

PrerequisiteDescription
Command Preparation

The PSYNC command can be executed (may not be supported by managed cloud services).

Port Preparation

Allow the migration and sync node (Worker) to connect to the Redis port and Sentinel port (if available).

Parameters

ParameterDescription
dbHeartbeatIntervalSec

Interval for sending the PING command.

deCycle

Enable event filtering in bidirectional data synchronization, which filters out the specific events to prevent circular data replication in the Incremental stage.

deCycleMode

Bidirectional data synchronization event filter modes: GET_KEY represents query marking mode, and DEL_KEY represents delete marking mode.

enableDbMapping

Enable Redis DB mapping. Make sure that the number of DBs in the source and target instances are equal.

deCycleEventExpireSec

Expiration time for the specific events to prevent circular data replication written to the target instance; <0 means the events won‘t expired.

extractorQueueSize

Queue size for temporarily stored Redis events.

inputStreamBufferSize

Buffer size of byte streams for receiving Redis response.

connAndSoTimeoutMs

TCP connection parameter SO_TIMEOUT.

receiveBufferSize

TCP connection parameter SO_RCVBUF.

sendBufferSize

TCP connection parameter SO_SNDBUF.

isSentinel

true represents Redis Sentinel Cluster, while false represents Single Node or Sharded Cluster.

sentinelUser

Username for connecting to Sentinel.

sentinelPassword

Password for connecting to Sentinel.

sentinelMasterName

Master Name specified in the Redis Sentinel configuration.

Tips: To modify the general parameters, see General Parameters and Functions.


Target

Prerequisites

PrerequisiteDescription
Port Preparation

Allow the migration and sync node (Worker) to connect to the Redis port and Sentinel port (if available).

Parameters

ParameterDescription
isSentinel

true represents Redis Sentinel Cluster, while false represents Single Node or Sharded Cluster.

sentinelUser

Username for connecting to Sentinel.

sentinelPassword

Password for connecting to Sentinel.

sentinelMasterName

Master Name specified in the Redis Sentinel configuration.

secondsToExpire

Use the set command to specify the expiration time of data written to the Target; -1 means no limit.

Tips: To modify the general parameters, see General Parameters and Functions.

Connection

Basic Functions

Advanced Functions

Limits

Example

FAQ

Source

Prerequisites

Parameters

Target

Prerequisites

Parameters