Hi All,
I am exploring jedis library for our redis cluster setup with Master-Slave-Sentinel deployment.
I have the following deployment presently -
1] Bunch of master redis instances
2] Bunch of slave redis instances (1 slave per master)
3] Bunch of sentinels monitoring all the Master/Slave instances
I need the following functionality -
1] Client to connect to sentinel for getting the cluster state
2] Client writer to partition data evenly across all masters by key to be flushed to the bunch of masters
3] Client writer should have ability to receive notifications of new masters (which were slaves earlier) when there is a failover of an existing master
4] Client should have the ability to pipeline the requests for better performance
5] The connections to every redis instance should support pooling
6] The ability to scale up and down the number of masters-slave nodes with the client seamlessly able to catch up with the cluster state dynamically
I would like to know whether Jedis library can support all the 6 points I have listed above.
More specifically I am interested in know the following -
1] At start
a) Client queries sentinels to get the list of masters
b) This list is used to create an in memory state of the cluster by client as follows -
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
ShardedJedisPool pool = new ShardedJedisPool(jedisPoolConfig, shards);
c) In case of failover when master fails and slave gets promoted to master how do I update this in memory state in a thread safe
performant way considering traffic will be flowing through the system as client gets notification from the sentinel about the
failed and newly elected nodes. Do I need to explicitly do this or will the Jedis client take care of updating the state
automatically in a dynamic way.
d) What happens when the number of nodes increases or decreases. will this cause shifting of all the keys or does the jedis client use
consistent-hashing which will cause only K/N keys to be shifted.
Regards,
Aditya