Sobes.tech
Senior

Can Redis clusters be scaled in real-time by adding shards on the fly?

sobes.tech AI

Answer from AI

In Redis Cluster, you can add new shards (nodes) for scaling, but this is not exactly "hot" in the traditional sense. The process requires certain operations: adding new nodes to the cluster and subsequently redistributing slots (resharding) among them.

When adding a new shard:

  • Launch a new Redis node with cluster support.
  • Add it to the existing cluster using the CLUSTER MEET command.
  • Redistribute slots from existing nodes to the new one using CLUSTER SETSLOT commands or specialized tools (e.g., redis-trib or redis-cli --cluster).

This process takes time and can impact performance, as data migration occurs between nodes. There is no fully transparent and instant scaling without affecting cluster operation.

Example commands to add a node to the cluster:

redis-cli --cluster add-node <new-node-ip>:6379 <existing-node-ip>:6379
redis-cli --cluster reshard <existing-node-ip>:6379

Thus, scaling is possible but requires planning and some time for data redistribution.

Can Redis clusters be scaled in real-time by adding… - sobes.tech