README.rst

rediscluster-py

a Python interface to a Cluster of Redis key-value stores.

Project Goals

The goal of rediscluster-py, together with rediscluster-php,
is to have a consistent, compatible client libraries accross programming languages
when sharding among different Redis instances in a transparent, fast, and
fault tolerant way. rediscluster-py is based on the awesome
redis-py StrictRedis
Api, thus the original api commands would work without problems within
the context of a cluster of redis servers

Travis CI

Currently, rediscluster-py is being tested via travis ci for python
version 2.6, 2.7 and 3.2:

Cluster Configuration

The cluster configuration is a hash that is mostly based on the idea of a node, which is simply a host:port pair
that points to a single redis-server instance. This is to make sure it doesn’t get tied it
to a specific host (or port).
The advantage of this is that it is easy to add or remove nodes from
the system to adjust the capacity while the system is running.

Hash Tags

In order to specify your own hash key (so that related keys can all land
on a given node), rediscluster allows you to pass a list where you’d normally pass a scalar.
The first element of the list is the key to use for the hash and the
second is the real key that should be fetched/modify:

>>> r.get("bar{foo}")

In that case “foo” is the hash key but “bar” is still the name of
the key that is fetched from the redis node that “foo” hashes to.

Multiple Keys Redis Commands

In the context of storing an application data accross many redis servers, commands taking multiple keys
as arguments are harder to use since, if the two keys will hash to two different
instances, the operation can not be performed. Fortunately, rediscluster is a little fault tolerant
in that it still fetches the right result for those multi keys operations as far as the client is concerned.
To do so it processes the related involved redis servers at interface level.