0

I am new to Redis.

I want to deploy redis cache across multiple clusters in a container. Is there a way to achieve the same?

Question - 1. How discovery will happen between redis nodes across clusters. 2. If someone tried and have a simple dockerfile, please share the same.

Thanks in advance!

Sum
  • 161
  • 1
  • 2
  • 11
  • 1
    You can use redis sentinel for distributed caching https://redis.io/topics/sentinel or redis cluster if you want to do sharding, to make Docker compatible with Redis Cluster you need to use the host networking mode of Docker. https://redis.io/topics/cluster-tutorial – MrKulli Nov 18 '19 at 14:19
  • What are you trying to do? Are you trying to setup master-master redis or master-slave(fallback) cache system. – MrKulli Nov 18 '19 at 14:21
  • Thanks @MrFox. I want to do data sharding using redis cluster across few vms on two static cluster. – Sum Nov 22 '19 at 02:41
  • 1
    There are different ways you can do this, depends on your requirements Client side partitioning - means you need to implement client which handles where to write and read from , Proxy assisted partitioning - where you can use proxy layers like (https://github.com/twitter/twemproxy, https://github.com/Netflix/dynomite) which make sure to forward requests to the right Redis instance according to the configured partitioning schema – MrKulli Nov 22 '19 at 03:04
  • 1
    Query routing : you can send your query to a random instance, and the instance will make sure to forward your query to the right node, redis cluster implements an hybrid form of query routing I suggest you to read this https://redis.io/topics/partitioning and highly recommend netflix dynomite if you want to use proxy based approach. – MrKulli Nov 22 '19 at 03:04

0 Answers0