views:

275

answers:

1

Hi everybody,

Redis really seems like a great product with the built in replication and the amazing speed. After testing it out, it feels definitely like the 2010 replacement of memcached.

However, since when normally using memcached, a consistent hashing is being used to evenly spread out the data across the servers in a pool. If one of the servers in the pool goes down and stops being accessible, it is being handled transparently and only the keys that were lost will be recreated and evenly distributed across the remaining available servers in the pool.

Redis has on the other hand also built-in sharding, but also another really interesting feature called automatic replication. Thanks to that, availability of the data could be greatly increased while utilizing slave servers to use in the event of the shit hitting the fan.

However, I have yet not found any good solution to handle changing a redis server's status as a slave to become a new master automatically or by any other way automatically handling the failover with Redis.

How could this be done? What would be an appropriate approach to this?

+1  A: 

However, since when normally using memcached, a consistent hashing is being used to evenly spread out the data across the servers in a pool. If one of the servers in the pool goes down and stops being accessible, it is being handled transparently and only the keys that were lost will be recreated and evenly distributed across the remaining available servers in the pool.

This is not what memcached does, the client library is doing all this magic ;)

However, I have yet not found any good solution to handle changing a redis server's status as a slave to become a new master automatically or by any other way automatically handling the failover with Redis.

Use the SlaveofCommand to change the characteristics. Automatic failover will need a bit more coding, connect to the server and if you loose the connection and can't establish it again for a time X then choose one slave to be master and change the slave-master-status of all other servers.

Tobias P.
Hi Tobias, thanks for your answer. I am already aware of that consistent hashing in memcached is handled by the client though :)
Industrial