redis-shardRedis Sharding API | |
Download |
redis-shard Ranking & Summary
Advertisement
redis-shard Tags
redis-shard Description
Redis Sharding API redis-shard is a redis sharding API. Sharding is done based on the CRC32 checksum of a key or key tag ("key{key_tag}"), according to this article http://antirez.com/post/redis-presharding.html.Usage:Creating a hash ring with multiple servers. By default the hash ring uses a crc32 hashing algorithm on the server's name config. You can define the name anything as you like,but it must be unique.I don't want to bind the hashring with ipaddress,because if I do some master/slave switches, I can only change the ipaddress related config. The name is kept,so the hashring's order is kept.>>> from redis_shard.shard import RedisShardAPI>>> servers = >>>>>> client = RedisShardAPI(servers)>>> client.set('test',1)>>> print client.get('test')>>> client.zadd('testset','first',1)>>> client.zadd('testset','second',2)>>> print client.zrange('testset',0,-1)Hash tagssee article http://antirez.com/post/redis-presharding.html for detail.>>> client.set('foo',2)>>> client.set('a{foo}',5)>>> client.set('b{foo}',5)>>> client.set('c{foo}',5) Requirements: · Python What's New in This Release: · Add MANIFEST.in file
redis-shard Related Software