Redis FAQ or: what you learn when idling in #redis

(by )

Sometime ago I created the redis-faq, a small list of common or not so common questions coming up in the #redis channel on freenode.

There’s not much on it yet, but I would like to extend it whenever possible. If you have something you want to add just ping me on twitter or on freenode (badboy_).

For now these are the only things in there so far:

Q: X is weird in my instance. Can you help?

Maybe. To better help please give the following info:

Don’t spam the channel, upload it to pastebin, as a gist or similar.

Q: I want to use SELECT to seperate my data. Is this a good idea?

Antirez decided select was an anti-pattern a loooong time ago. He won’t fully deprecate it, but it doesn’t get support in new features such as cluster. (via brycebaril). Relevant mail.

Just use seperate instances or use namespacing (often used: namespace:real-key-name)

Q: I have some data and need to retrieve it by date. How to to that?

Sorted Sets can be useful here. Store some value and use the timestamp as the score. Then use ZRANGEBYSCORE to get it back.

Q: I installed a new version, but redis-cli info server still shows the old one

Q: I have a background in SQL. Now I’m looking into how I can use Redis. Anything I need to consider?

If you’re used to SQL, storing data in Redis is more like creating the indexes for your SQL schema (from: brycebaril)