Using hedis to work with redis (key-value, list and hash)
Redis (http://redis.io) is a key-value store and more. It offers facilities very different than relational databases. As a NoSQL database, one has to employ a different philosophy, such as duplicating keys across stores, maintaining reverse lookup, and so on.
In this recipe, we will be using redis to create key-value stores, sorted sets, and hash sets. We will be using the hedis library to connect to Redis and manipulate the data.
Getting ready...
- Install Redis from http://redis.io. On Microsoft Windows, use the Windows port from the Microsoft Open Tech Group at https://github.com/MicrosoftArchive/redis.
- Start Redis in a default mode by simply running redis-server from the command line. You should see the following messages on successful start. You might want to go with the Windows service on Microsoft Windows or a daemonized mode on Unix flavoured systems. Optionally, you can also supply the configuration file:
d:\Tools\redis>redis...