I am new to the world of Memcached clusters
If I have a php web application that is using memcache - how does it does its hash and decide what node to check for a particular value to avoid having to check them all.
Bonus: How can I easily add a node in a way that avoids having to rebuild all the hashes.
Memcache clients know which node to check by hashing the key value. By default it uses the crc32 value of the key. In the old style, you would do something like
This meant that when you added a new server node, most things would remap to a different node.
For your bonus, use the new style where each node covers a linear rage of crc values determined by a randomly selected server number rather than every Nth value. This is called consistent hashing.