tags:

views:

116

answers:

1

Predis claim to have Client-side sharding (support for consistent hashing of keys). http://github.com/nrk/predis

I can do sharding using connect to an array of profiles (nodes) but it isn't consistent hashing. When I add another node to the pool, some of the keys can't be found. Anyone has any experience on this?

Using php 5.2 (and redis's php 5.2 version).

+1  A: 

The official Redis site says "Redis supports client-side sharding via consistent hashing. Currently there is no support for fail tolerance nor to add or remove clusters at run time."

From what I understand at the moment this kind of sharing is not fault tolerant, and all keys stored on a failed node will be lost. Equally if you add a new node, some portion of the key space will now be lost (as the keys will be stored on the wrong node). Normally in a consistent hashing system, when a new node joins it copies all the keys which now map to it from its neighbours. There is no support in the Redis server to do this.

So the consistent hashing works fine if you are using Redis as a cache, where the actually data is stored behind Redis, but for the moment don't expect your data to not go missing.

bramp