MUltiple App Instances To One Remote Redis Server

I need to setup 4 locations / servers that all run one instance of an app. Traffic will be fed through a load balancer and directed to the closest node depending on location.

The problem I am running into is Redis. Each node cannot cannot run its own instance, instead they all need to connect to one central Redis node.

In some cases the distance is extreme. Chicago to Singapore for example.

Is there another way to achieve this and keep distance between app nodes and Redis shorter? Such as Node 1 Redis that has a mirror in another location?

I do not normally deal with Redis so I am not sure if I am simply stuck with a big performance hit on this.

Answer

Redis has a option to replicate data in a master-slave fasion, however this does mean you need to make your application aware of this. Writes to redis should go to a single node (HA preferably) which then may replicate data to nodes in each location for reading. The full how-to guide on this is a bit much to write out. but Redis has a topic in their documentation for this: https://redis.io/topics/replication

Attribution
Source : Link , Question Author : Dehay , Answer Author : Flash

Leave a Comment