7

In recent study, I was led to the belief that it is not possible for redis to be setup with multiple masters with each master having 2 slaves.

https://github.com/uolter/redis_failover/issues/4#issuecomment-24377513

I was quite taken aback by this comment so I decided to ask the community whether it is possible and how people are handling fail overs?

I have heard of the redis-cluster project but it seems like this isn't really stable at the moment so I wasn't daring enough to try this in production.

Mark
  • 171
  • 1
  • 1
  • 4

1 Answers1

5

You can deploy as many masters as you want, with any number of slaves each, but they will behave like a single separated cluster with their own memory space, and it will be your responsibility at the application layer to spread your keys properly using each of the masters, just as you would do in a Memcached multi-node deployment.

Also, if you have no Redis Sentinel watching your data nodes, your application will have to take care of the failover process in a per-master basis to promote one of the slaves as master and redirect other slaves to use the new master.

Anyway, a single slave is enough for most use cases, unless you intend to use all of the slaves as read replicas for improved read throughput.

And about Redis-Cluster, well... IMHO, Redis Cluster introduces some penalties (No multi-key operations. no pipelining...) that have a big impact in the typical Redis use case, so you should evaluate it carefully before implementing it.

ma.tome
  • 1,169
  • 8
  • 15