What is Memcached?
ALI KARABAY laravelmemcachedcacheopen source cachesystem 0 Comment

Memcached is an open source distributed caching system. It is used to speed up dynamic web applications by reducing database load. In other words, it adds additional load to the server each time a database request is made. Memcached reduces load by storing data objects in dynamic memory (think of it as short-term memory for applications). Memcached stores data based on key/ value pairs for small strings or objects:

  • Results of database calls
  • API calls
  • Create a page

Memcached consists of four main components. These components allow the client and server to work together to deliver cached data as efficiently as possible:

  1. Client software : Given a list of available Memcached servers
  2. Client-based hash algorithm : Selects a server based on "key"
  3. Server software : Saves values and keys to an internal hash table
  4. LRU : Determines when old data is discarded or when memory is reused

How does Memcached work?

As mentioned above, Memcached consists of four main components, which are elements that allow data storage and receiving. Each elementconsists of    key and expiration time and raw data. Memcached at the top level works as follows:

  1. The client requests a piece of data that Memcached checks to see if it is stored in the cache.
  2. Here are two possible outcomes:
  3. If the data is stored in the cache: it returns the data from Memcached (you don't need to check the database).
  4. If the data is not stored in the cache: queries the database, retrieves the data, and then stores it in Memcached.
  5. When information is changed or an item expires, Memcached updates its cache to ensure that new content is forwarded to the client.

My feed

  • Data is sent only to one server.
  • Sunucular veri paylaşmaz.
  • Servers keep values in RAM. If ram runs out, the oldest value is discarded.


KARABAY A, 2020 . What is Memcached ?,


(Accessed June 12, 2020).

  Share this post

Comments (0)


Useful Links