Can Redis cluster sharding be used by jedis client and how?

Skip to first unread message

Pushkar Deole

Dec 17, 2021, 9:48:30 AM12/17/21
to Jedis

We are using Jedis client for connecting to Azure cache for Redis. 
Recently we changed from redis standalone server to Redis Cluster with 2 shards. 

We are creating multiple small sized hashes to store data for a short time duration in redis, and would like to know if Jedis support usage of multiple Redis cluster shards. 

Specifically on below question, would greatly appreciate if someone can provide inputs:
1. while storing data, the 2 shards should be used to balance out load. Is this handled by Redis cluster or Jedis needs to handle this?
2. If Jedis to handle, then is it done by Jedis internally or application need to provide some logic on top?

Oscar Besga

Dec 17, 2021, 1:13:47 PM12/17/21
to Jedis
AFAIK, Jedis supports cluster

Here you have a good java example on  how to fo it

Also renember:
- use key hash tags {} on similart key to have it in the same hash slot
- be aware that operations to the entire keyset or to mulitple values are more difficult or  not possible (or make it for every server int he cluster)
- it has not strong consistency

Hope it helps
Reply all
Reply to author
0 new messages