Storing data in Redis
Redis (REmote DIctionary Server) is an in-memory, key-value database, written in C. In the in-memory mode, Redis is extremely fast, with writing and reading being almost equally fast. Redis follows the publish/subscribe model and uses Lua scripts as stored procedures. Publish/subscribe makes use of channels to which a client can subscribe in order to receive messages. The most recent Redis version at the time of writing was 2.8.12. Redis can be downloaded from the home page at http://redis.io/. After unpacking the Redis distribution, issue the following command to compile the code and create all the binaries:
$ make
Run the server as follows:
$ src/redis-server
Now let's install a Python driver:
$ sudo pip install redis $ pip freeze|grep redis redis==2.10.1
It's pretty easy to use Redis when you realize it's a giant dictionary. However, Redis does have its limitations. Sometimes, it's just convenient to store a complex object as a JSON string (or other format). That...