Add support for Redis protocol
mbrukman opened this issue · 3 comments
Thank you for writing and open-sourcing this project! It looks very interesting.
It looks like Rend only supports the memcached protocol at this time. @tyagihas and I were wondering if there are any plans to add Redis protocol as well, or if not, whether you would accept contributions to generalize the system to support multiple protocols, and add support for Redis.
What do you think?
@mbrukman what kinds of commands are you thinking? Right now Rend translates the text and binary Memcached protocols to internal representations of commands, which are then translated back into binary Memcached protocol if it needs to speak to the local Memcached process. Are you looking at only the redis commands that can map to memcached commands?
Since Memcached only deals with byte array keys and byte array values, there's no real support for data structures on the server side. It'd be possible to do simple things like get, set, delete, touch, but not things like appending to a list.
As for changing the internals to support both protocols, that would be a large undertaking. At the moment the internal interfaces are pretty well tied to Memcached commands, for instance the handlers.Handler interface has methods for each of the supported Memcached commands: https://github.com/Netflix/rend/blob/master/handlers/types.go#L26
If you want to take a stab at translating redis protocol commands into memcached ones, that would be great. I'm wary of changing all of the internals, however.
Merging #118 allows you to do whatever protocol you want now, including implement a protocol that speaks Redis if you wanted to. For the time being I don't want to move the internals away from the relatively limited set of operations that are the Memcached operations it initially was made to service. If there are Redis commands that map directly and a clean way to reject other commands, that would be a possible use.
@mbrukman the way it's set up now, you can make a separate package that implements the protocol and plug that in to Rend as needed in your own project. I'm still debating if I would accept a Redis patch for Rend itself.
I'm closing this as wontfix. There are no plans to support the redis protocol in this project. It may be fun to implement as a side project, but that's definitely outside the purview of this project / issue in particular. If you (or anyone) works on it, I'd be happy to help by answering questions.