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

[Feature request] compression/decompression in lua scripts #4894

Closed
halaei opened this issue May 3, 2018 · 2 comments
Closed

[Feature request] compression/decompression in lua scripts #4894

halaei opened this issue May 3, 2018 · 2 comments

Comments

@halaei
Copy link
Contributor

halaei commented May 3, 2018

I couldn't find any command available in lua script to decompress strings compressed via popular compression libraries like zlib. It will be great if redis lua interpreter loads a zlib library by default.

Also any practical advice regarding decompressing string in lua scripts evaled by Redis is appreciated.

@itamarhaber
Copy link
Member

Hello @halaei.

I couldn't find...

That's because there isn't, but you've learned that the hard way.

It will be great if redis lua interpreter loads a zlib library by default.

Superficially, that could be a good a idea. However, do you really want Redis to spend its time (currently, Lua scripts block the main server thread) on compression and decompression? If Redis a Ferrari, that's like using it to drive to the grocery store :)

That said, while Redis itself doesn't do compression, Redis modules can! I'm not aware of a zlib module (although it should be fairly easy to put one together), but here's something that does a fairly sophisticated zstd (IIRC threaded): https://github.com/chadnickbok/redis-zstd-module

@halaei
Copy link
Contributor Author

halaei commented May 3, 2018

About redis spending time on decompression; I want that if the time complexity is linear with respect to the string size. If I am not making a mistake, the time for that is actually linear, so why not? For my use-case I actually don't need compression inside lua script.
Thanks for the provided link.

@halaei halaei closed this as completed Oct 5, 2018
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

2 participants