Skip to content

Instantly share code, notes, and snippets.

@iolloyd
Created January 29, 2016 21:12
Show Gist options
  • Save iolloyd/b2a17370cc00ee273156 to your computer and use it in GitHub Desktop.
Save iolloyd/b2a17370cc00ee273156 to your computer and use it in GitHub Desktop.
Some reasons to put redis in your stack

There are a lot of articles exploring the whys and wherefores of redis and I thought I would share some thoughts from somebody well versed in redis having used it in production over the past five or six years.

Build your own tailor-made indexes.

One of the foundations of the power of relational databases is the use of indexes. Redis gives you the ability to build your own, the way you want it, in a completely visible manner.

Sub element retrieval.

The essence of any database system is the ability to get information back out. Redis allows you to do this in an efficient manner. Even comparing to 'K/V' datastores, redis is exceptional because it allows you to retrieve discrete sub-elements, as opposed to having to de-serialize an entire object containing the part you want, to get the part you want.

Speed.

(Nearly) all the commands happen in O(1) complexity!

Locking and threads.

Redis is single-threaded and lock-free. That's easy to reason about, in anyone's book.

Some values are so much more.

Redis stores values, of course, but those values can be strings, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs, geospatial indexes with radius queries, Phew!

Scripting.

Lua. It rocks. Do you know lua? check it out.

Persistent. In memory?

Yes, redis is persistent, and as persistent as even postgresql! And, in memory? yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment