Skip to content

[WIP] Add Redis Backend Support#56

Open
daknob wants to merge 6 commits intomasterfrom
feature/redis
Open

[WIP] Add Redis Backend Support#56
daknob wants to merge 6 commits intomasterfrom
feature/redis

Conversation

@daknob
Copy link
Copy Markdown
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
Copy Markdown
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