How to reduce the number of shards in a Redis Enterprise Database?

Last updated 18, Apr 2024

Question

How to reduce the number of shards of a Redis Enterprise database?

Answer

It is not possible to scale down a Redis DB. You can only scale up by doubling the number of current shards. There are different alternatives to migrate data to a database with fewer shards, though.

Using replicaOf

To scale down from, e.g.,  6 to 4 shards, you will need to create a new DB with four shards then use the ReplicaOf feature to do a live sync between the old DB with 6 shards and the new DB with four shards. Once the sync is completed, you can redirect traffic to the new DB, remove the replicaOf, and remove the old DB. If you've already maxed out the number of shards your license allowed, you will need a temporary license with more shards for this operation.

Using RIOT

You can also export and import data using the RIOT tool. Riot also supports additional methods to transfer data from one database to another. Refer to the RIOT documentation.

References

https://developer.redis.com/riot/