Skip to content
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

Redis Cluster Support #221

Open
srimithravemula opened this issue Apr 12, 2022 · 2 comments
Open

Redis Cluster Support #221

srimithravemula opened this issue Apr 12, 2022 · 2 comments

Comments

@srimithravemula
Copy link

Hi Nicolasff,

Have a query on whether webdis supports redis cluster.
If it is not supported, can you please let me know what is recommended way of configuring webdis with redis cluster - like to configure one webdis node per each redis node in cluster and sending queries to right webdis node depending on key hash?

Thanks

@nicolasff
Copy link
Owner

Hello,

Webdis does not support any of the client-based logic around hash slots like redirects and migrations. With Redis Cluster, the amount of processing that is moved from Redis to the client makes the client so complex that very few client libraries seem to implement all the logic defined in the "Cluster spec" document.

Webdis supports one Redis host and port, and does not "understand" the commands you send but simply translates the HTTP requests it receives into the Redis protocol and sends that. When a response is received, it similarly translates it back to a format of your choice (like JSON or MessagePack), but does not interpret the response like what would be needed to follow a MOVED response from Redis Cluster, for example.

One way to use Webdis with multiple Redis nodes is indeed to have one Webdis instance per Redis node, and either use a simple sharding model or actually handle the cluster-specific responses yourself. Doing the sharding yourself seems much easier than implementing the Redis Cluster logic.

In addition to the simplicity of a pool that uses something like consistent hashing, I'm also concerned about the reliability of Redis Cluster and the comments made by its primary author in response to simulations that demonstrated the possibility of data loss multiple times. With these deficiencies being fundamental properties of the protocol, I do not want to encourage Webdis users to deploy such a deeply unsafe system that would also need Webdis to implement a complex and half-baked protocol that shifts a major amount of work onto the client.

@caojiajun
Copy link

add a proxy which support redis-cluster between webdis and redis-cluster?

such as redis-cluster-proxy and camellia and predixy ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants