Redis Cluster - Application Entry Point

66 views
Skip to first unread message

Deepak

unread,
Jul 19, 2016, 1:42:05 PM7/19/16
to Redis DB
I have a python app that uses redis for Data sets, I have been working with a single redis instance in my dev environment. The middleware team is building a redis cluster with 3 masters and 3 slaves, could someone help me understand where should I point my application ? (to one master ? or to multiple masters using a loadbalancer / with some haproxy-redis failover mode ?).

I am new to this and any help would be great.

Tuco

unread,
Jul 19, 2016, 11:49:50 PM7/19/16
to Redis DB
You need to use an appropriate redis client in python, a client which supports cluster...the list is present at http://redis.io/clients#python, something like pyredis should do it, as it seems to support cluster, and just follow how pyredis accepts the ip:ports of redis instances.

Deepak

unread,
Jul 20, 2016, 2:59:55 AM7/20/16
to Redis DB
Great - Thanks for that. Does that mean I have to make changes to the existing application ?

Also are there any simple solution other than clustering which won't require much changes to the app ? I need something that can scale as well !

Deepak

unread,
Jul 20, 2016, 3:00:52 AM7/20/16
to Redis DB
I am confused with how Redis cluster works as well, the documentation is not that great.

Is all the data replicated across all the cluster instances ? (if a master fails - could i just point to another master and will it work like normal ?)

Tuco

unread,
Jul 20, 2016, 3:08:41 AM7/20/16
to Redis DB
For each master node, its data will be replicated by its slave redis node.
If a master is down, and its slave is promoted to be a master by redis, a smart redis client will know that, and will use the new master accordingly. I am not aware of how well the pyredis handles it. We use java which has good smart clients in Jedis and Lettuce.

Deepak

unread,
Jul 20, 2016, 5:56:07 AM7/20/16
to Redis DB
Thank you Tuco.
Reply all
Reply to author
Forward
0 new messages