All Products
Search
Document Center

ApsaraDB for Redis:Limits on commands supported by cluster instances and read/write splitting instances

Last Updated:Jan 19, 2024

Compared with standard instances, cluster instances and read/write splitting instances have different levels of support for native Redis commands. For example, specific commands are disabled, and a single command is prevented from accessing keys that hash to multiple slots. It is crucial to be aware of these differences and follow the recommended practices and guidelines for each architecture.

Limits on commands supported by cluster instances

Redis cluster instances are compatible with different open source Redis versions. For information about the commands supported by each version, see Commands supported by ApsaraDB for Redis Community Edition.

Cluster instances are available in two modes: the direct connection mode and the proxy mode. The limits on commands are different in different modes.

Cluster instances in direct connection mode

  • Specific mainstream Redis clients such as Jedis do not provide built-in support for the SELECT command.

  • Only cluster instances that are compatible with Redis 7.0 support the SWAPDB command.

  • To run a command that involves multiple keys, make sure that all keys are stored in the same slot, for example, by using hashtags.

  • In a cluster instance in direct connection mode, a transaction must be executed in the same manner as in an open source Redis cluster. Make sure that all keys involved in the transaction are stored in the same slot.

Cluster instances in proxy mode

  • In addition to the commands that are not supported by cluster instances in direct connection mode, proxy nodes also do not support commands such as WAIT, HELLO, and CLIENT ID. However, proxy nodes support the SELECT command, and can run commands such as DEL and EXISTS on multiple keys across different slots. For more information, see Commands supported by instances in proxy mode.

  • The CLIENT KILL command is available in the following formats: CLIENT KILL <ip:port> and CLIENT KILL ADDR <ip:port>.

  • The CLIENT LIST command retrieves information about all client connections to a proxy node. The output of the CLIENT LIST command in Tair may be different from the output of the native Redis command.

    • The following fields have the same meanings as the fields in the native Redis command: id, age, idle, addr, fd, name, db, multi, omem, and cmd.

    • The values of the sub and psub fields are the same. The values are 1 or 0.

    • The following fields have no specific meanings: qbuf, qbuf-free, obl, and oll.

  • When a transaction is executed in a cluster instance in proxy mode, the transaction is split into multiple sub-transactions to ensure compatibility with the master-replica architecture. As a result, the atomicity of the transaction cannot be guaranteed. If the WATCH command is used in a transaction or if the transaction contains commands that involve multiple keys, such as MSET and DEL, the transaction is not split. In this case, to keep the transaction atomic, make sure that the keys involved in the transaction are stored in the same slot.

  • To facilitate routine management and O&M, cluster instances in proxy mode support multiple commands developed in-house by Alibaba Cloud. For more information, see In-house commands for ApsaraDB for Redis instances in proxy mode.

Redis Cluster imposes specific limits on the use of Lua scripts. On top of this, ApsaraDB for Redis cluster instances impose additional limits. For more information, see Limits on Lua scripts in cluster instances.

Limits on commands supported by read/write splitting instances

Redis read/write splitting instances are compatible with different open source Redis versions. For information about the commands supported by each version, see Commands supported by ApsaraDB for Redis Community Edition.

  • By default, read/write splitting instances contain proxy nodes. Therefore, the command limits imposed by proxy nodes also apply to read/write splitting instances. For example, proxy nodes do not support commands such as WAIT, HELLO, and CLIENT ID. For more information, see Commands supported by instances in proxy mode.

  • To facilitate routine management and O&M, read/write splitting instances support multiple commands developed in-house by Alibaba Cloud. For more information, see In-house commands for ApsaraDB for Redis instances in proxy mode.

Commands supported by instances in proxy mode

The following information applies to cluster instances in proxy mode and read/write splitting instances. The following list describes the symbols that are used in the tables of this topic:

  • ✔️ indicates that the command is supported by proxy nodes. If the command supports multiple keys, the command can be run across different slots.

  • ⭕️ indicates that the command is supported by proxy nodes, but with specific limits. Make sure that the keys involved in the command are stored in the same slot. This can be achieved by using techniques such as hashtags.

  • ❌ indicates that the command is not supported by proxy nodes.

  • Footnote ①: The command returns only OK or an empty result to maintain compatibility with specific client frameworks.

  • Footnote ②: The request is directly handled by proxy nodes, regardless of the Redis version being used.

Bitmaps

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

BITCOUNT

✔️

✔️

✔️

✔️

BITFIELD

✔️

✔️

✔️

✔️

BITFIELD_RO

BITOP

⭕️

⭕️

✔️

⭕️

BITPOS

✔️

✔️

✔️

✔️

GETBIT

✔️

✔️

✔️

✔️

SETBIT

✔️

✔️

✔️

✔️

Cluster management

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

CLUSTER ADDSLOTS ①②

✔️

✔️

CLUSTER ADDSLOTSRANGE

CLUSTER BUMPEPOCH

CLUSTER COUNT-FAILURE-REPORTS ②

✔️

✔️

CLUSTER COUNTKEYSINSLOT ②

✔️

✔️

CLUSTER DELSLOTS ①②

✔️

✔️

CLUSTER DELSLOTSRANGE

CLUSTER FAILOVER ①②

✔️

✔️

CLUSTER FLUSHSLOTS

CLUSTER FORGET ①②

✔️

✔️

CLUSTER GETKEYSINSLOT ①②

✔️

✔️

CLUSTER INFO ②

✔️

✔️

CLUSTER KEYSLOT ②

✔️

✔️

CLUSTER LINKS

CLUSTER MEET ①②

✔️

✔️

CLUSTER MYID

CLUSTER NODES ②

✔️

✔️

CLUSTER REPLICAS

CLUSTER REPLICATE ①②

✔️

✔️

CLUSTER RESET ①②

✔️

✔️

CLUSTER SAVECONFIG ①②

✔️

✔️

CLUSTER SET-CONFIG-EPOCH ①②

✔️

✔️

CLUSTER SETSLOT ①②

✔️

✔️

CLUSTER SHARDS

CLUSTER SLAVES ②

✔️

✔️

CLUSTER SLOTS ②

✔️

✔️

READONLY ①②

✔️

✔️️

READWRITE ①②

✔️

✔️

Connection management

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

AUTH

✔️

✔️

✔️

CLIENT CACHING

CLIENT GETNAME ②

✔️

✔️

CLIENT GETREDIR

CLIENT ID

CLIENT INFO

CLIENT KILL ②

✔️

✔️

CLIENT LIST ②

✔️

✔️

CLIENT NO-EVICT

CLIENT PAUSE

CLIENT REPLY

CLIENT SETNAME ②

✔️

✔️

CLIENT TRACKING

CLIENT TRACKINGINFO

CLIENT UNBLOCK

CLIENT UNPAUSE

ECHO

✔️

✔️

✔️

HELLO

PING ②

✔️

✔️

✔️

QUIT ②

✔️

✔️

✔️

✔️

RESET

SELECT

✔️

✔️

✔️

✔️

Generic

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

COPY

⭕️

⭕️

✔️

⭕️

DEL

✔️

⭕️

✔️

⭕️

DUMP

✔️

✔️

✔️

✔️

EXISTS

✔️

⭕️

✔️

⭕️

EXPIRE

✔️

✔️

✔️

✔️

EXPIREAT

✔️

✔️

✔️

✔️

EXPIRETIME

✔️

✔️

✔️

✔️

KEYS

✔️

✔️

✔️

MIGRATE

MOVE

✔️

✔️

✔️

✔️

OBJECT

✔️

✔️

✔️

✔️

OBJECT HELP

✔️

✔️

✔️

✔️

PERSIST

✔️

✔️

✔️

✔️

PEXPIRE

✔️

✔️

✔️

✔️

PEXPIREAT

✔️

✔️

✔️

✔️

PEXPIRETIME

✔️

✔️

✔️

✔️

PTTL

✔️

✔️

✔️

✔️

RANDOMKEY

✔️

✔️

✔️

RENAME

⭕️

⭕️

✔️

⭕️

RENAMENX

⭕️

⭕️

✔️

⭕️

RESTORE

✔️

✔️

✔️

✔️

SCAN

✔️

✔️

✔️

SORT

⭕️

⭕️

✔️

⭕️

SORT_RO

✔️

✔️

✔️

✔️

TOUCH

TTL

✔️

✔️

✔️

✔️

TYPE

✔️

✔️

✔️

✔️

UNLINK

✔️

⭕️

✔️

⭕️

WAIT

Geospatial indices

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

GEOADD

✔️

✔️

✔️

✔️

GEODIST

✔️

✔️

✔️

✔️

GEOHASH

✔️

✔️

✔️

✔️

GEOPOS

✔️

✔️

✔️

✔️

GEORADIUS

⭕️

⭕️

✔️

⭕️

GEORADIUSBYMEMBER

⭕️

⭕️

✔️

⭕️

GEOSEARCH

✔️

✔️

✔️

✔️

GEOSEARCHSTORE

⭕️

⭕️

✔️

⭕️

Hashes

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

HDEL

✔️

✔️

✔️

✔️

HEXISTS

✔️

✔️

✔️

✔️

HGET

✔️

✔️

✔️

✔️

HGETALL

✔️

✔️

✔️

✔️

HINCRBY

✔️

✔️

✔️

✔️

HINCRBYFLOAT

✔️

✔️

✔️

✔️

HKEYS

✔️

✔️

✔️

✔️

HLEN

✔️

✔️

✔️

✔️

HMGET

✔️

✔️

✔️

✔️

HMSET

✔️

✔️

✔️

✔️

HRANDFIELD

✔️

✔️

✔️

✔️

HSCAN

✔️

✔️

✔️

✔️

HSET

✔️

✔️

✔️

✔️

HSETNX

✔️

✔️

✔️

✔️

HSTRLEN

✔️

✔️

✔️

✔️

HVALS

✔️

✔️

✔️

✔️

HyperLogLog

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

PFADD

✔️

✔️

✔️

✔️

PFCOUNT

⭕️

⭕️

✔️

⭕️

PFMERGE

⭕️

⭕️

✔️

⭕️

Lists

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

BLPOP

⭕️

⭕️

✔️

⭕️

BLMOVE

⭕️

⭕️

✔️

⭕️

BLMPOP

⭕️

⭕️

✔️

⭕️

BRPOP

⭕️

⭕️

✔️

⭕️

BRPOPLPUSH

⭕️

⭕️

✔️

⭕️

LINDEX

✔️

✔️

✔️

✔️

LINSERT

✔️

✔️

✔️

✔️

LLEN

✔️

✔️

✔️

✔️

LMOVE

⭕️

⭕️

✔️

⭕️

LMPOP

⭕️

⭕️

✔️

⭕️

LPOP

✔️

✔️

✔️

✔️

LPUSH

✔️

✔️

✔️

✔️

LPUSHX

✔️

✔️

✔️

✔️

LRANGE

✔️

✔️

✔️

✔️

LREM

✔️

✔️

✔️

✔️

LSET

✔️

✔️

✔️

✔️

LTRIM

✔️

✔️

✔️

✔️

RPOP

✔️

✔️

✔️

✔️

RPOPLPUSH

⭕️

⭕️

✔️

⭕️

RPUSH

✔️

✔️

✔️

✔️

RPUSHX

✔️

✔️

✔️

✔️

Pub/Sub

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

PSUBSCRIBE

✔️

✔️

PUBLISH

✔️

✔️

✔️

✔️

PUBSUB

✔️

✔️

✔️

PUBSUB HELP

PUBSUB SHARDCHANNELS

✔️

✔️

✔️

PUBSUB SHARDNUMSUB

✔️

✔️

✔️

PUNSUBSCRIBE

✔️

✔️

SPUBLISH

✔️

✔️

✔️

✔️

SUBSCRIBE

✔️

✔️

SSUBSCRIBE

✔️

✔️

SUNSUBSCRIBE

✔️

✔️

UNSUBSCRIBE

✔️

✔️

Scripting and functions

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

EVAL

⭕️

✔️

✔️

EVAL_RO

⭕️

✔️

✔️

EVALSHA

⭕️

✔️

✔️

EVALSHA_RO

⭕️

✔️

✔️

FCALL

⭕️

✔️

✔️

FCALL_RO

⭕️

✔️

✔️

FUNCTION DELETE

✔️

✔️

FUNCTION DUMP

✔️

✔️

FUNCTION FLUSH

✔️

✔️

FUNCTION HELP

✔️

✔️

FUNCTION KILL

✔️

✔️

FUNCTION LIST

✔️

✔️

FUNCTION LOAD

✔️

✔️

FUNCTION RESTORE

✔️

✔️

FUNCTION STATS

✔️

✔️

SCRIPT DEBUG

SCRIPT EXISTS

✔️

✔️

SCRIPT FLUSH

✔️

✔️

SCRIPT KILL

✔️

✔️

SCRIPT LOAD

✔️

✔️

Server management

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

ACL CAT

ACL DELUSER

ACL DRYRUN

ACL GENPASS

ACL GETUSER

ACL HELP

ACL LIST

ACL LOAD

ACL LOG

ACL SAVE

ACL SETUSER

ACL USERS

ACL WHOAMI

BGREWRITEAOF

BGSAVE

COMMAND

✔️

✔️

✔️

COMMAND COUNT

✔️

✔️

✔️

COMMAND DOCS

✔️

✔️

✔️

COMMAND GETKEYS

✔️

✔️

✔️

COMMAND GETKEYSANDFLAGS

✔️

✔️

✔️

COMMAND INFO

✔️

✔️

✔️

COMMAND LIST

✔️

✔️

✔️

CONFIG GET

✔️

✔️

✔️

CONFIG HELP

CONFIG RESETSTAT

CONFIG REWRITE

CONFIG SET ①②

✔️

✔️

✔️

DBSIZE

✔️

✔️

✔️

DEBUG OBJECT

DEBUG SEGFAULT

FAILOVER

FLUSHALL

✔️

✔️

✔️

FLUSHDB

✔️

✔️

✔️

INFO

✔️

✔️

✔️

LASTSAVE

LATENCY DOCTOR

LATENCY GRAPH

LATENCY HELP

LATENCY HISTOGRAM

LATENCY HISTORY

LATENCY LATEST

LATENCY RESET

LOLWUT

✔️

✔️

✔️

MEMORY DOCTOR

✔️

✔️

MEMORY HELP

✔️

✔️

MEMORY MALLOC-STATS

✔️

✔️

MEMORY PURGE

✔️

✔️

MEMORY STATS

✔️

✔️

MEMORY USAGE

✔️

✔️

MODULE LIST

MODULE LOAD

MODULE LOADEX

MODULE UNLOAD

MONITOR

✔️

✔️

PSYNC

REPLICAOF

ROLE ②

✔️

✔️

SAVE

SHUTDOWN

SLAVEOF

SLOWLOG

✔️

✔️

✔️

SLOWLOG HELP

✔️

✔️

✔️

SLOWLOG RESET

✔️

✔️

✔️

SWAPDB

✔️

✔️

✔️

SYNC

TIME

✔️

✔️

✔️

Sentinel

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

SENTINEL sentinels ②

✔️

✔️

SENTINEL get-master-addr-by-name ②

✔️

✔️

Sets

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

SADD

✔️

✔️

✔️

✔️

SCARD

✔️

✔️

✔️

✔️

SDIFF

✔️

⭕️

✔️

⭕️

SDIFFSTORE

✔️

⭕️

✔️

⭕️

SINTER

✔️

⭕️

✔️

⭕️

SINTERCARD

✔️

⭕️

✔️

⭕️

SINTERSTORE

✔️

⭕️

✔️

⭕️

SISMEMBER

✔️

✔️

✔️

✔️

SMEMBERS

✔️

✔️

✔️

✔️

SMISMEMBER

✔️

✔️

✔️

✔️

SMOVE

✔️

⭕️

✔️

⭕️

SPOP

✔️

✔️

✔️

✔️

SRANDMEMBER

✔️

✔️

✔️

✔️

SREM

✔️

✔️

✔️

✔️

SSCAN

✔️

✔️

✔️

✔️

SUNION

✔️

⭕️

✔️

⭕️

SUNIONSTORE

✔️

⭕️

✔️

⭕️

Sorted sets

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

BZMPOP

⭕️

⭕️

✔️

⭕️

BZPOPMAX

⭕️

⭕️

✔️

⭕️

BZPOPMIN

⭕️

⭕️

✔️

⭕️

ZADD

✔️

✔️

✔️

✔️

ZCARD

✔️

✔️

✔️

✔️

ZCOUNT

✔️

✔️

✔️

✔️

ZDIFF

✔️

⭕️

✔️

⭕️

ZDIFFSTORE

✔️

⭕️

✔️

⭕️

ZINCRBY

✔️

✔️

✔️

✔️

ZINTER

✔️

✔️

✔️

✔️

ZINTERCARD

✔️

⭕️

✔️

⭕️

ZINTERSTORE

✔️

⭕️

✔️

⭕️

ZLEXCOUNT

✔️

✔️

✔️

✔️

ZMPOP

⭕️

⭕️

✔️

⭕️

ZMSCORE

✔️

✔️

✔️

✔️

ZPOPMAX

✔️

✔️

✔️

✔️

ZPOPMIN

✔️

✔️

✔️

✔️

ZRANDMEMBER

✔️

✔️

✔️

✔️

ZRANGE

✔️

✔️

✔️

✔️

ZRANGEBYLEX

✔️

✔️

✔️

✔️

ZRANGEBYSCORE

✔️

✔️

✔️

✔️

ZRANGESTORE

⭕️

⭕️

✔️

⭕️

ZRANK

✔️

✔️

✔️

✔️

ZREM

✔️

✔️

✔️

✔️

ZREMRANGEBYLEX

✔️

✔️

✔️

✔️

ZREMRANGEBYRANK

✔️

✔️

✔️

✔️

ZREMRANGEBYSCORE

✔️

✔️

✔️

✔️

ZREVRANGE

✔️

✔️

✔️

✔️

ZREVRANGEBYLEX

✔️

✔️

✔️

✔️

ZREVRANGEBYSCORE

✔️

✔️

✔️

✔️

ZREVRANK

✔️

✔️

✔️

✔️

ZSCAN

✔️

✔️

✔️

✔️

ZSCORE

✔️

✔️

✔️

✔️

ZUNION

✔️

⭕️

✔️

⭕️

ZUNIONSTORE

✔️

⭕️

✔️

⭕️

Streams

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

XACK

✔️

✔️

✔️

✔️

XADD

✔️

✔️

✔️

✔️

XAUTOCLAIM

✔️

✔️

✔️

✔️

XCLAIM

✔️

✔️

✔️

✔️

XDEL

✔️

✔️

✔️

✔️

XGROUP

✔️

✔️

✔️

✔️

XGROUP CREATECONSUMER

✔️

✔️

✔️

✔️

XINFO

✔️

✔️

✔️

✔️

XLEN

✔️

✔️

✔️

✔️

XPENDING

✔️

✔️

✔️

✔️

XRANGE

✔️

✔️

✔️

✔️

XREAD

⭕️

⭕️

✔️

⭕️

XREADGROUP

⭕️

⭕️

✔️

⭕️

XREVRANGE

✔️

✔️

✔️

✔️

XTRIM

✔️

✔️

✔️

✔️

Strings

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

APPEND

✔️

✔️

✔️

✔️

DECR

✔️

✔️

✔️

✔️

DECRBY

✔️

✔️

✔️

✔️

GET

✔️

✔️

✔️

✔️

GETDEL

✔️

✔️

✔️

✔️

GETEX

✔️

✔️

✔️

✔️

GETRANGE

✔️

✔️

✔️

✔️

GETSET

✔️

✔️

✔️

✔️

LCS

✔️

⭕️

✔️

⭕️

INCR

✔️

✔️

✔️

✔️

INCRBY

✔️

✔️

✔️

✔️

INCRBYFLOAT

✔️

✔️

✔️

✔️

MGET

✔️

⭕️

✔️

⭕️

MSET

✔️

⭕️

✔️

⭕️

MSETNX

⭕️

⭕️

✔️

⭕️

PSETEX

✔️

✔️

✔️

✔️

SET

✔️

✔️

✔️

✔️

SETEX

✔️

✔️

✔️

✔️

SETNX

✔️

✔️

✔️

✔️

SETRANGE

✔️

✔️

✔️

✔️

STRALGO

STRLEN

✔️

✔️

✔️

✔️

Transactions

Command

Cluster architecture

Whether the command can be run in transactions within cluster instances

Read/write splitting architecture

Whether the command can be run in transactions within read/write splitting instances

DISCARD

✔️

✔️

✔️

✔️

EXEC

✔️

✔️

✔️

✔️

MULTI

✔️

✔️

UNWATCH

✔️

✔️

✔️

WATCH

✔️

✔️