memcached and distribution or assignment

I have been using Memcached in a lot of different type of caching solutions for web services and thought of sharing some basic facts,

  1. Memcached servers are just very efficient key value storage providing APIs to get and set values over the network.
  2. Client makes the solution distributed. The client has the logic to select or choose the destination host for get or set operation using consistent hashing.
  3. The memcached client library supports a number of different distribution algorithms that are used in multi-server configurations. Please read the protocol.
  4.  The cache key is used in the consistent hashing to determine distrubution. The same server is selected during both set and get operations. The algorithms are Ketama and Wheel in code.
  5. following diagram is for simplicity in understanding the process.

Untitled Diagram

In the next post, I will show how to use Guava and Memcached together to implement a multi layered caching solution.