0

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!

Here_2_learn
  • 5,013
  • 15
  • 50
  • 68

1 Answers1

1

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.

for_stack
  • 21,012
  • 4
  • 35
  • 48
  • Thanks for responding. Just to be clear, Redis sentinel(3 nodes) with 3 nodes redis-server setup will support multiple databases, right? My confusion is data sync should happen among these 3 redis-server nodes to support HA, so this is something similar to redis-cluster. – Here_2_learn May 28 '20 at 01:15
  • 1. YES, your setup will support multiple databases. 2. Both single instance Redis (with slaves) and Redis Cluster (with slaves), will sync data from master to slave. The difference is that with Redis Cluster, data is sharded. – for_stack May 28 '20 at 02:24