-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecating Sharded Jedis (for 2.5.0) #629
Conversation
@HeartSaVioR @xetorthio I think it'd be nice to add a What about adding a short description of why we're deprecating and a link to the google groups thread in the ShardedJedis class at least? |
@marcosnils Yes, you're right. |
Conflicts: src/main/java/redis/clients/jedis/ShardedJedis.java
I wonder why we decided to remove it. Following semver we should only On Sun, May 25, 2014 at 7:02 PM, Jungtaek Lim notifications@git.luolix.topwrote:
|
@xetorthio @marcosnils Didn't we decided to remove at 3.0.0? |
@xetorthio. My understanding and @HeartSaVioR's was that we wanted to That's why we are deprecating it for 2.5 so we can remove it completely in sent from mobile
|
@marcosnils So do I. Actually we can implement Consistent Hashing and let ShardedJedis give a new life. |
@xetorthio @marcosnils But we cannot rely on google groups for gathering opinions about issue. tl;dr : We should make a decision by our hands though we cannot gather opinions or thoughts. |
@HeartSaVioR Yes, Indeed. I was checking out |
As SITZ said, I think there is value in allowing custom versions of ShardedJedis so that users could add what makes sense for their application. Consistent hashing is one example (esp. for using Redis as a cache). |
Right now you can write your own hashing algo and use it with jedis. So it
|
Another one approach - we can simplify ShardedJedis to only support Consistent 2014년 6월 23일 월요일, Jonathan Leibiuskynotifications@github.com님이 작성한 메시지:
Name : 임 정택 |
I do not understand why we would drop support for ShardedJedis in favor of JedisCluster when they seem to have different use cases. JedisCluster seems to depend on Redis Cluster and therefore it is locked into the master/slave approach that Redis Cluster provides. ShardedJedis allows for application-level control over sharding and, if combined with the ability to check if a Redis node is up/down, could be used to provide a resilient system that re-allocates shard keys across available nodes if one node goes down. I would advocate that shardedJedis provides application developers to choose their own models for managing and distributing cache in a much finer-grained way than the generic Redis Cluster model which relies on master-slave. Has this issue been fully decided or is there a chance that the ShardedJedis functionality can be saved since it does not impact the use of ClusteredJedis but provides more functionality and flexibility. |
For what is worth, I believe that for many plan get/set caching setups where writes are idempotent and no data structures are used, memcached-alike consistent hashing targeting available servers automatically is a very viable option compared to Redis Cluster. So I would retain the code inside Jedis. Btw the goal for the future is to have direct support for something like that in Redis Cluster itself. |
So perhaps it makes sense to support (and maybe even augment) ShardedJedis in the near future until Redis Cluster matures to be production-ready and to support a more complete set of functionality relating to these scenarios. |
@drewmorris Redis Cluster is production ready now, and can be used for caching scenarios (and should be used every time the cache uses data structures, otherwise consistent hashing will do a mess). Here the problem is that Redis Cluster has not a special mode of operation for volatile caching where availability of the cache is the most important thing, no failover is needed, consistency requirements are weak since writes are idempotent and TTL/LRU are enough to evict old garbage, and so forth. Most of the times I would use Redis Cluster, but not when there are specific set of requirements, so why to delete the code from Jedis? |
@antirez I completely agree with you. I think there are definitely scenarios where ShardedJedis could be needed and I think it warrants keeping the code. On the other point I wasn't aware that Redis Cluster was production ready for all scenarios yet. Am I correct that it requires a master-slave scenario though and that it doesn't support a mode where all nodes can be used without slaves and where node failure results in new read/writes to a specific hash range being re-distributed across the remaining nodes? |
Yes. There are valid arguments here to keep supporting it. On Thu, May 14, 2015 at 10:20 AM drewmorris notifications@github.com
|
@drewmorris yes you are right it's master-slave design. Failures are not handled like with consistent hashing as you said, but via master-slave failover and replicas migration when masters remain orphaned, this is needed in order to have certain degrees of consistency. When you use consistent hashing with Redis, if key A Redis Cluster mode specific for caching in order to better cover use cases where now consistent hashing is used would be still different than consistent hashing, even if only composed of master nodes. For example it could work like that: when a master is not available instead of triggering a failover to a slave (that does not exist) the cluster would reassign hash slots of this master to other available masters in order for the computation to continue. When the old master is back online, we could at least avoid to insert it back into the cluster without any clue like it happens with a naive consistent hashing implementation. We could at least:
Or something else... but because Redis Cluster has more state we can do a better job than client side consistent hashing IMHO. |
At first, we decided to stop supporting ShardedJedis cause we expect Redis Cluster can replace it. But now we have other reason to stop, cause of maintaining cost. Here's what I remove ShardedJedis and relevant interfaces from Jedis, #875.
It doesn't mean we deprecate ShardedJedis. We were decided to maintain ShardedJedis at 2.x, and remove ShardedJedis at 3.x. But that can be changed. Who knows. |
@HeartSaVioR my guess is that SharedJedis should not be part of Jedis itself, but just a separated library using Jedis. Then it can have a different set of developers and a different life: if it is still interesting enough, it will survive, if everybody will switch to Redis Cluster, it will likely die. IMHO to be more useful it should get more complex, and it is possible to add complexity once extrapolated away from Jedis. The additional complexity could allow to do more interesting things like putting wallclock timestamps in keys and do read repair or alike, basically it should be a multi master AP system with some decent feature in my vision... |
Another thing that should be considered is if those features are better handled by a proxy like Twemproxy instead of being copied again and again in the context of each client library. The obvious reply is YES but I don't see enough work in this area... |
@antirez |
Please keep in mind that it is very hard to maintain consistent hash via client side since clients are hard to check added/removed/killed nodes, as @antirez stated. |
It's for completely removing ShardedJedis at 3.0.0.
Discussion for deprecating starts at https://groups.google.com/d/msg/jedis_redis/avphfQld81Y/X_uouHp_lCIJ.
Although it couldn't get many "agreement"s, but no "disagreement" received.
So we will start removing ShardedJedis.
@xetorthio @marcosnils Please review and comment! Thanks!