Propsal: Redis Cluster support in ActiveSupport cache

Hi, I notice that in ActiveSupport Cache, the redis-rb v5 gem is supported. However, Redis Cluster is not supported since the client would raise an exception when operations like mget is called.

For example, in read_multi_mget, it is possible to perform a pipeline of get commands instead since the underlying gem redis-cluster-client would internally fan-out and gather the response from multiple Redis nodes. Likewise for multi-key del in delete_multi_entries.

Would it make sense to add support for it within ActiveSupport::Cache::RedisCacheStore?

Hello,

The version 0.9.0 of redis-cluster-client was released. It made MSET, MGET and DEL commands able to pass multiple keys without a hashtag to prevent cross-slot errors by using pipelining. I’d say that it’s useful in the use case, but the performance is degradated than an original MGET. I think it might work if we pass an instance of redis-clustering client to ActiveSupport cache.

1 Like