ApsaraDB for Redis provides instances of multiple editions and architectures. The supported commands vary based on different instance types. Based on native Redis commands, this topic describes the commands supported by ApsaraDB for Redis. It also provides further details about the limits on these commands.

Notes

To simplify operations and maintenance, cluster and read/write splitting instances supports multiple commands that are developed by Alibaba Cloud. For more information, see Redis commands developed by Alibaba Cloud.

Comments description

The following sections show the description of the comments that are used in the tables of this topic:

  • ✔️ indicates that this command is supported.
  • ❌ indicates that this command is not supported.
  • ➖ indicates that the command is not supported in native Redis. For example, the TOUCH command is supported by only Redis 3.2.1 and later. This command is marked as ➖ in the Redis 2.8 column of the table.
  • Footnote 1: When you run the command on a cluster instance, you must enable direct connection to use a private endpoint to connect to the instance. For more information, see Use a private endpoint to connect to an ApsaraDB for Redis instance. You can run the command when you use the endpoint of a proxy node to connect to an instance.
  • Footnote 2: To be compatible with some client frameworks, when you run the CONFIG SET command, only OK is returned, and the parameters are not modified.
Note By default, commands in all command groups are supported by standard instances, cluster instances, and read/write splitting instances. For more information about instance types, see Overview.

Supported command groups

Cluster command group

Note
  • The commands in the cluster command group do not apply to the standard instances.
  • When you use the endpoint of the proxy node to connect to an instance, some of the commands in the cluster command group are supported. These commands include CLUSTER COUNTKEYSINSLOT, CLUSTER INFO, CLUSTER KEYSLOT, CLUSTER NODES, CLUSTER SLAVES, and CLUSTER SLOTS.
Command Redis 2.8 Redis 4.0 Redis 5.0
CLUSTER ADDSLOTS
CLUSTER BUMPEPOCH
CLUSTER COUNT-FAILURE-REPORTS
CLUSTER COUNTKEYSINSLOT ① ✔️ ✔️
CLUSTER DELSLOTS
CLUSTER FAILOVER
CLUSTER FLUSHSLOTS
CLUSTER FORGET
CLUSTER GETKEYSINSLOT ✔️ ✔️ ✔️
CLUSTER INFO ① ✔️ ✔️ ✔️
CLUSTER KEYSLOT ① ✔️ ✔️ ✔️
CLUSTER MEET
CLUSTER MYID
CLUSTER NODES ① ✔️ ✔️ ✔️
CLUSTER REPLICAS
CLUSTER REPLICATE
CLUSTER RESET
CLUSTER SAVECONFIG
CLUSTER SET-CONFIG-EPOCH
CLUSTER SETSLOT
CLUSTER SLAVES
CLUSTER SLOTS
READONLY
READWRITE

Connection command group

Command Redis 2.8 Redis 4.0 Redis 5.0
AUTH ✔️ ✔️ ✔️
CLIENT CACHING
CLIENT GETNAME ✔️ ✔️ ✔️
CLIENT GETREDIR
CLIENT ID ✔️
CLIENT KILL ✔️ ✔️ ✔️
CLIENT LIST ✔️ ✔️ ✔️
CLIENT PAUSE
CLIENT REPLY
CLIENT SETNAME ✔️ ✔️ ✔️
CLIENT TRACKING
CLIENT UNBLOCK ✔️
ECHO ✔️ ✔️ ✔️
HELLO
PING ✔️ ✔️ ✔️
QUIT ✔️ ✔️ ✔️
SELECT ✔️ ✔️ ✔️

Geo command group

Command Redis 2.8 Redis 4.0 Redis 5.0
GEOADD ✔️ ✔️ ✔️
GEODIST ✔️ ✔️ ✔️
GEOHASH ✔️ ✔️ ✔️
GEOPOS ✔️ ✔️ ✔️
GEORADIUS ✔️ ✔️ ✔️
GEORADIUSBYMEMBER ✔️ ✔️ ✔️

Hashes command group

Command Redis 2.8 Redis 4.0 Redis 5.0
HDEL ✔️ ✔️ ✔️
HEXISTS ✔️ ✔️ ✔️
HGET ✔️ ✔️ ✔️
HGETALL ✔️ ✔️ ✔️
HINCRBY ✔️ ✔️ ✔️
HINCRBYFLOAT ✔️ ✔️ ✔️
HKEYS ✔️ ✔️ ✔️
HLEN ✔️ ✔️ ✔️
HMGET ✔️ ✔️ ✔️
HMSET ✔️ ✔️ ✔️
HSCAN ✔️ ✔️ ✔️
HSET ✔️ ✔️ ✔️
HSETNX ✔️ ✔️ ✔️
HSTRLEN ✔️ ✔️ ✔️
HVALS ✔️ ✔️ ✔️

HyperLogLog command group

Command Redis 2.8 Redis 4.0 Redis 5.0
PFADD ✔️ ✔️ ✔️
PFCOUNT ✔️ ✔️ ✔️
PFMERGE ✔️ ✔️ ✔️

Keys command group

Command Redis 2.8 Redis 4.0 Redis 5.0
DEL ✔️ ✔️ ✔️
DUMP ✔️ ✔️ ✔️
EXISTS ✔️ ✔️ ✔️
EXPIRE ✔️ ✔️ ✔️
EXPIREAT ✔️ ✔️ ✔️
KEYS ✔️ ✔️ ✔️
MIGRATE
MOVE ✔️ ✔️ ✔️
OBJECT ✔️ ✔️ ✔️
PERSIST ✔️ ✔️ ✔️
PEXPIRE ✔️ ✔️ ✔️
PEXPIREAT ✔️ ✔️ ✔️
PTTL ✔️ ✔️ ✔️
RANDOMKEY ✔️ ✔️ ✔️
RENAME ✔️ ✔️ ✔️
RENAMENX ✔️ ✔️ ✔️
RESTORE ✔️ ✔️ ✔️
SCAN ✔️ ✔️ ✔️
SORT ✔️ ✔️ ✔️
TOUCH ✔️ ✔️
TTL ✔️ ✔️ ✔️
TYPE ✔️ ✔️ ✔️
UNLINK ✔️ ✔️
WAIT ✔️ ✔️

Lists command group

Command Redis 2.8 Redis 4.0 Redis 5.0
BLPOP ✔️ ✔️ ✔️
BRPOP ✔️ ✔️ ✔️
BRPOPLPUSH ✔️ ✔️ ✔️
LINDEX ✔️ ✔️ ✔️
LINSERT ✔️ ✔️ ✔️
LLEN ✔️ ✔️ ✔️
LPOP ✔️ ✔️ ✔️
LPUSH ✔️ ✔️ ✔️
LPUSHX ✔️ ✔️ ✔️
LRANGE ✔️ ✔️ ✔️
LREM ✔️ ✔️ ✔️
LSET ✔️ ✔️ ✔️
LTRIM ✔️ ✔️ ✔️
RPOP ✔️ ✔️ ✔️
RPOPLPUSH ✔️ ✔️ ✔️
RPUSH ✔️ ✔️ ✔️
RPUSHX ✔️ ✔️

Pub and Sub command group

Command Redis 2.8 Redis 4.0 Redis 5.0
PSUBSCRIBE ✔️ ✔️ ✔️
PUBLISH ✔️ ✔️ ✔️
PUBSUB ✔️ ✔️ ✔️
PUNSUBSCRIBE ✔️ ✔️ ✔️
SUBSCRIBE ✔️ ✔️ ✔️
UNSUBSCRIBE ✔️ ✔️ ✔️

Scripting command group

Command Redis 2.8 Redis 4.0 Redis 5.0
EVAL ✔️ ✔️ ✔️
EVALSHA ✔️ ✔️ ✔️
SCRIPT DEBUG
SCRIPT EXISTS ✔️ ✔️ ✔️
SCRIPT FLUSH ✔️ ✔️ ✔️
SCRIPT KILL ✔️ ✔️ ✔️
SCRIPT LOAD ✔️ ✔️ ✔️

Sentinel command group

Command Redis 2.8 Redis 4.0 Redis 5.0
SENTINEL sentinels ✔️ ✔️
SENTINEL get-master-addr-by-name ✔️ ✔️

Server command group

Command Redis 2.8 Redis 4.0 Redis 5.0
ACL CAT
ACL DELUSER
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 GETKEYS ✔️ ✔️ ✔️
COMMAND INFO ✔️ ✔️ ✔️
CONFIG GET ✔️ ✔️ ✔️
CONFIG RESETSTAT ✔️ ✔️ ✔️
CONFIG REWRITE
CONFIG SET ② ✔️ ✔️ ✔️
DBSIZE ✔️ ✔️ ✔️
DEBUG OBJECT
DEBUG SEGFAULT
FLUSHALL ✔️ ✔️ ✔️
FLUSHDB ✔️ ✔️ ✔️
INFO ✔️ ✔️ ✔️
LASTSAVE
LATENCY DOCTOR ✔️ ✔️ ✔️
LATENCY GRAPH ✔️ ✔️ ✔️
LATENCY HELP ✔️
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 UNLOAD
MONITOR ✔️ ✔️ ✔️
PSYNC
REPLICAOF
ROLE ✔️ ✔️
SAVE
SHUTDOWN
SLAVEOF
SLOWLOG ✔️ ✔️ ✔️
SWAPDB ✔️ ✔️
SYNC
TIME ✔️ ✔️ ✔️

Sets command group

Command Redis 2.8 Redis 4.0 Redis 5.0
SADD ✔️ ✔️ ✔️
SCARD ✔️ ✔️ ✔️
SDIFF ✔️ ✔️ ✔️
SDIFFSTORE ✔️ ✔️ ✔️
SINTER ✔️ ✔️ ✔️
SINTERSTORE ✔️ ✔️ ✔️
SISMEMBER ✔️ ✔️ ✔️
SMEMBERS ✔️ ✔️ ✔️
SMISMEMBER ✔️ ✔️ ✔️
SMOVE ✔️ ✔️ ✔️
SPOP ✔️ ✔️ ✔️
SRANDMEMBER ✔️ ✔️ ✔️
SREM ✔️ ✔️ ✔️
SSCAN ✔️ ✔️ ✔️
SUNION ✔️ ✔️ ✔️
SUNIONSTORE ✔️ ✔️ ✔️

Sorted sets command group

Command Redis 2.8 Redis 4.0 Redis 5.0
BZPOPMAX ✔️
BZPOPMIN ✔️
ZADD ✔️ ✔️ ✔️
ZCARD ✔️ ✔️ ✔️
ZCOUNT ✔️ ✔️ ✔️
ZINCRBY ✔️ ✔️ ✔️
ZINTERSTORE ✔️ ✔️ ✔️
ZLEXCOUNT ✔️ ✔️ ✔️
ZPOPMAX ✔️
ZPOPMIN ✔️
ZRANGE ✔️ ✔️ ✔️
ZRANGEBYLEX ✔️ ✔️ ✔️
ZRANGEBYSCORE ✔️ ✔️ ✔️
ZRANK ✔️ ✔️ ✔️
ZREM ✔️ ✔️ ✔️
ZREMRANGEBYLEX ✔️ ✔️ ✔️
ZREMRANGEBYRANK ✔️ ✔️ ✔️
ZREMRANGEBYSCORE ✔️ ✔️ ✔️
ZREVRANGE ✔️ ✔️ ✔️
ZREVRANGEBYLEX
ZREVRANGEBYSCORE ✔️ ✔️ ✔️
ZREVRANK ✔️ ✔️ ✔️
ZSCAN ✔️ ✔️ ✔️
ZSCORE ✔️ ✔️ ✔️
ZUNIONSTORE ✔️ ✔️ ✔️

Streams command group

Command Redis 2.8 Redis 4.0 Redis 5.0
XACK ✔️
XADD ✔️
XCLAIM ✔️
XDEL ✔️
XGROUP ✔️
XINFO ✔️
XLEN ✔️
XPENDING ✔️
XRANGE ✔️
XREAD ✔️
XREADGROUP ✔️
XREVRANGE ✔️
XTRIM ✔️

Strings command group

Command Redis 2.8 Redis 4.0 Redis 5.0
APPEND ✔️ ✔️ ✔️
BITCOUNT ✔️ ✔️ ✔️
BITFIELD ✔️ ✔️ ✔️
BITOP ✔️ ✔️ ✔️
BITPOS ✔️ ✔️ ✔️
DECR ✔️ ✔️ ✔️
DECRBY ✔️ ✔️ ✔️
GET ✔️ ✔️ ✔️
GETBIT ✔️ ✔️ ✔️
GETRANGE ✔️ ✔️ ✔️
GETSET ✔️ ✔️ ✔️
INCR ✔️ ✔️ ✔️
INCRBY ✔️ ✔️ ✔️
INCRBYFLOAT ✔️ ✔️ ✔️
MGET ✔️ ✔️ ✔️
MSET ✔️ ✔️ ✔️
MSETNX ✔️ ✔️ ✔️
PSETEX ✔️ ✔️ ✔️
SET ✔️ ✔️ ✔️
SETBIT ✔️ ✔️ ✔️
SETEX ✔️ ✔️ ✔️
SETNX ✔️ ✔️ ✔️
SETRANGE ✔️ ✔️ ✔️
STRALGO
STRLEN ✔️ ✔️ ✔️

Transaction command group

Command Redis 2.8 Redis 4.0 Redis 5.0
DISCARD ✔️ ✔️ ✔️
EXEC ✔️ ✔️ ✔️
MULTI ✔️ ✔️ ✔️
UNWATCH ✔️ ✔️ ✔️
WATCH ✔️ ✔️ ✔️