Introduction to the single server level

We'll improve certain aspects of Memcached by modifying its internal mechanisms for a single server. Memcached uses four main data structures to form a key-value store:

  1. A Hash table

  2. A Cache item data structure

  3. A Slab allocator

  4. A Least Recently Used (LRU) list

Hashtable with separate chaining

The hashtable uses hash functions to look up items using the key quickly. As illustrated below, the hashtable is an array of buckets, where each bucket is a linked list.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.