Introduction to memcached
Memcached is a very simple in-memory key value store; we can assume it to be an in-memory store for a hash map. This can be used in conjunction with Storm supervisors to serve as a common memory storage, which can be accessed for read/write operations by all the Storm workers on various nodes in the Storm cluster.
Memcached has the following components:
- The memcached server
- The memcache client
- The hashing algorithm (client-based implementation)
- The server algorithm for data retention
Memcached uses Least Recently Used (LRU) to discard the elements from the cache. This means that the items that have not been referred since the longest time are the first ones to be removed from the cache. These items are said to be expired from the cache, and if they are referred after expiry, they are reloaded from a stable storage.
The following is the flow of how entries are loaded and retrieved from or through a cache:
The preceding figure depicts the scenarios of cache hit and cache...