Redis cluster provides a way to run a Redis installation where data is automatically sharded across multiple Redis nodes. Horizontal scaling, which is the process of adding more nodes to the system to improve performance and space, is one of the key features of Redis Cluster.
To horizontally scale a Redis Cluster, you need to add new nodes to the cluster and rebalance your data. Here's a basic example:
redis-cli tool provided by Redis.
This command moves keys from the most populated nodes to the least populated ones, trying to get an even distribution.
Make sure to monitor your application during this process as it might impact its performance. It's generally recommended to do such operations during periods of low load or in a maintenance window.
Also, note that Redis Cluster does not support automatic resharding, meaning when you add or remove nodes, you'll have to manually reshard the data.