Redis Cluster provides a way to run a Redis installation where data is automatically sharded across multiple Redis nodes. Even though it has many benefits, it also comes with several limitations:
Cross-slot commands: In Redis Cluster, you can't perform operations that involve multiple keys unless they are all part of the same hash slot. This means commands like
DEL with multiple keys could fail if the keys are in different slots.
Transactions: Redis Cluster does not support multi-key transactions using commands like
WATCH. However, single key operations are atomic as in single instance Redis.
Lua scripts: Lua scripts have to be designed carefully. All keys that the script uses should be hashed to the same slot, meaning that they should all correspond to the same node.
Database selection: The
SELECT command is not available in cluster mode. Redis Cluster uses database 0 and cannot switch databases.
Subset of commands are allowed in readonly mode: Read-only commands can be issued in read-only mode on slave nodes, but not all read-only commands are available.
Node failures: While Redis Cluster is resilient to a point, simultaneous failure of a primary and its corresponding replica(s) would result in data loss for that shard.
Adding or removing nodes: Redis Cluster does not support online resharding of data (moving data from one node to another) and rebalancing when nodes are added or removed.
Each of these limitations can be worked around or mitigated to some extent depending on your use case, but they do represent areas where behavior differs from standalone Redis installations. It's important to design your application keeping these limitations in mind when using Redis Cluster.