Search code examples
redisredis-clusterredis-sentinel

Does Redis supports databases in sentinel setup with multiple nodes?


Redis by default have 16 databases that can be selected by using SELECT command.

But as per the docs, https://redis.io/commands/select,

When using Redis Cluster, the SELECT command cannot be used, since Redis Cluster only supports database zero. In the case of a Redis Cluster, having multiple databases would be useless and an unnecessary source of complexity.

As per redis docs, cluster/HA is achieved by

  1. cluster - https://redis.io/topics/cluster-tutorial
  2. sentinel - https://redis.io/topics/sentinel.

I am clear that Redis Cluster only supports database zero, but I couldn't get the info anywhere to check the support for multiple databases in Sentinel setup with multiple nodes?

Any reference to this would be helpful. Thanks!


Solution

  • With sentinel setup, you can have multiple databases.

    Redis Sentinel is only used to provide HA for Redis, it doesn't change Redis in any way. And you can use this Redis as the single instance Redis without sentinel.