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

Compression of data in Redis #18

Merged
merged 2 commits into from
Dec 20, 2019
Merged

Compression of data in Redis #18

merged 2 commits into from
Dec 20, 2019

Conversation

vovayartsev
Copy link
Contributor

By default, the adapter encodes all the data via :erlang.term_to_binary/1 function which optionally accepts [:compressed] as a 2-nd argument. This option can reduce Redis memory consumption.

The compression rate depends on the nature of the data cached, so I decided to make it configurable on per-key basis (rather than on per-nebulex-cache-instance basis) by introducing :compressed data type:

@cache.set("foo", %{bar: 42}, dt: :compressed)

@cabol cabol merged commit 1028ab0 into cabol:master Dec 20, 2019
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

Successfully merging this pull request may close these issues.

2 participants