-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Plan for redis-rb 5.0 #1070
Comments
Yes, I’d love to switch to something like redis-client and lose the redundant mutex. I would also up the minimum Ruby version to 2.7 and clean up any legacy IO hacks. Sidekiq 7.0 will match Rails defaults of Ruby 2.7+ and require Redis 6+. |
Current implementation of cluster mode already extracts keys by using COMMAND information. It might be easy to separate them. |
Current |
So, I don't have a specific answer to it right now, but my reasoning is: 95% of users should only need My hunch says both Sentinel and consistent hashing are only used by a small minority of users. So they should probably come in a well integrated extra gem. We'll have to experiment a bit how we can make all these plug an play. Maybe some kind of "middleware system" might make sense. |
So I've put a bit more thought into it, and while in theory I think a mono-repo with both So I'm very tempted to do this in a new repo. |
Ok, so a quick update. The code can be seen at: https://github.com/redis-rb/redis-client I believe it's now pretty much feature complete for "regular" redis (no cluster support). At this stage is mostly need to be tested in production like conditions to iron out potential bugs. There's also an open question on wether it should provide pooling out of the box or not (redis-rb/redis-client#4). @mperham are you interested in trying to convert Sidekiq to use Also @supercaracal, let me know if you'd like to participate on the cluster support, I can add you as a collaborator to the |
@casperisfine I love the idea and I would be happy to help with a prototype spike if you want to open an issue or PR against Sidekiq's |
@mperham sounds good, I'll take a stab at it tomorrow. Enjoy your vacation! |
@casperisfine I would definitely like to participate in the organization. I think it would be better to separate gem and repository for cluster support. It seems that Redis cluster V2 will no longer need heavy implementation of the clients. So we can maybe remove cluster support in the future. I'd say that the |
@supercaracal sounds good. I sent you an invite, feel free to create a For now |
@casperisfine I understand. Thank you for your invitation. |
As discussed in redis/redis-rb#1070 (comment) Current shortcomings (redis-rb/redis-client#6): - No `namespace` support. This one is debatable. - No connection `url` support (this will be added very soon) - No `reconnect_attempts` support. I'd like to add it, but in a smarter way.
As discussed in redis/redis-rb#1070 (comment) Current shortcomings (redis-rb/redis-client#6): - No `namespace` support. This one is debatable. - No connection `url` support (this will be added very soon) - No `reconnect_attempts` support. I'd like to add it, but in a smarter way.
As discussed in redis/redis-rb#1070 (comment) Current shortcomings (redis-rb/redis-client#6): - No `namespace` support. This one is debatable. - No connection `url` support (this will be added very soon) - No `reconnect_attempts` support. I'd like to add it, but in a smarter way.
As discussed in redis/redis-rb#1070 (comment) Current shortcomings (redis-rb/redis-client#6): - No `namespace` support. This one is debatable. - No connection `url` support (this will be added very soon) - No `reconnect_attempts` support. I'd like to add it, but in a smarter way.
As discussed in redis/redis-rb#1070 (comment) Current shortcomings (redis-rb/redis-client#6): - No `namespace` support. This one is debatable. - No connection `url` support (this will be added very soon) - No `reconnect_attempts` support. I'd like to add it, but in a smarter way.
As discussed in redis/redis-rb#1070 (comment) Current shortcomings (redis-rb/redis-client#6): - No `namespace` support. This one is debatable. - No connection `url` support (this will be added very soon) - No `reconnect_attempts` support. I'd like to add it, but in a smarter way.
As discussed in redis/redis-rb#1070 (comment) Current shortcomings (redis-rb/redis-client#6): - No `namespace` support. This one is debatable. - No connection `url` support (this will be added very soon) - No `reconnect_attempts` support. I'd like to add it, but in a smarter way.
Quick update here since it has been a while.
Since Redis 5.x is no longer supported (October 31, 2021), I'll likely soon start working on a new major version of the However since it's quite a big breaking change, I'll likely cut a few more |
|
❤️ |
Closing as most of this has now been merged. I will likely release a beta in a couple days. |
This change removes references to their being a `mutex` protecting the underlying Redis connection from concurrent access. This was removed in `5.x`[1]. [1]: redis#1070
A large part of redis-rb maintenance cost comes from having to implement each command Redis add.
A year after Redis 6.2 release, we're still missing a large part of the newly added commands,
and tengentially commands added by Redis modules are hard to use.
This comes down to the RESP2 protocol that requires to know how to parse each command output.
However Redis 6.0 introduced the RESP3 protocol, which is properly typed
allowing clients to not know anything about the commands they are sending, which means a drastically simpler and smaller implementation that don't need keeping up with commands added upstream.
So I'd like to split
redis-rb
in multiple gems (probably kept in the same git repository)redis-client
gemWhat I'd like to do is to start a new simpler
redis-client
gem, that only support Redis 6.0+ and pretty much only offerthe following API:
We may also need some API for dealing with subscriptions commands, but that's about it unless I'm missing something.
This simple client would:
redis-rb
, to share a client between theads use a thread pool.Users should be encouraged to use
redis-client
directly.I explored this avenue back in 2019.
redis-cluster-client
gemClustering support adds lots of complexity, so I think it should be shipped separately for people that need it.
It should however be API compatible.
One difficulty with clustering is that the client must be able to extract the parts of the command that are keys.
Right now this is handled with lots of ad hoc code for each command, but we should instead load the list of command signatures from the redis server with
COMMAND
and extract the keys that way.With the above
redis-cluster-client
should be able to be a drop-in replacement forredis-client
redis-rb
5.0redis-rb
should then be refactored to be a thin wrapper aroundredis-client
allowing to keep backward compatibility for the most part. Users would still be encouraged to migrate toredis-client
even though there is not plan to sunset theredis
gem any time soon.Since we wouldn't have to know about return types, we could also explore generating the methods from the
COMMANDS
output, as to simplify keeping up with Redis.Timeline
I don't have a specific timeline yet.
Redis 6.0 will soon be the oldest supported version. I also see that Sidekiq plans to only support Redis 6+ soon, so 2022 is likely the good time for this to happen.
The text was updated successfully, but these errors were encountered: