June 2016
Beginner to intermediate
1255 pages
29h 1m
English
Redis is an advanced kind of key-value store where the values can be of different types: string, list, set, sorted set or hash. Redis stores data in memory like memcached but it can be persisted on disk, unlike memcached, which has no such option. Redis supports fast reads and writes, in the order of 100,000 set or get operations per second.
To interact with Redis, we need to install the Redis-py module to Python, which is available on pypi and can be installed with pip:
$ pip install redis
Now, we can connect to Redis via the host and port of the DB server. We assume that we have already installed a Redis server, which is running with the default host (localhost) and port (6379) parameters:
>>> import redis >>> r = ...
Read now
Unlock full access