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

[WIP] Add Redis Backend Support #56

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

[WIP] Add Redis Backend Support #56

wants to merge 6 commits into from

Conversation

daknob
Copy link
Owner

@daknob daknob commented Nov 13, 2016

Due to limitations of the filesystem backend, I decided to push a redis backend which will store all pastes and metadata to a Redis instance. The current data storage scheme is:

Paste Storage

Key: <paste_id>
Value: <paste_content>

Paste Metadata Storage

Key: <paste_id>.<metadata_key>
Value: <metadata_value>

Due to the List Pastes feature, this backend has to run the Redis KEYS command, which according to the official documentation is not recommended for production. However, after checking the recommended options a little bit, this command might be necessary for the app to work. In addition to that, some benchmarks I ran against the KEYS command and the filesystem backend indicate that the KEYS command can run up to hundreds of thousands of keys (currently 1/3rd of them will be pastes) in under one second, which is much faster than the backend filesystem.

I am open of course to other options to store data using Redis and will not merge until some time, so we can evaluate alternatives. Until then, use of this backend will of course not be supported and there will be no guarantees of compatibility across versions. These guarantees only exist after merging to master.

@daknob
Copy link
Owner Author

daknob commented Nov 19, 2016

Metadata will most likely have to be reimplemented using Redis Hashes. I am currently investigating this option.

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.

1 participant