DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

Memcached


Memcached (pronunciation: mem-cash-dee) is a distributed in-memory key-value storage system, usually used for caching objects in memory to speed up database applications. Typically, users wrap database queries with Memcached get/set operations to cache recently-used objects.[02][03]

Start Year
2003 [03]
Project Type
Commercial
Supported Languages
C++, Perl
Operating Systems
AIX, BSD, Linux, macOS, Solaris, Windows
License
BSD License

Database Entry

Memcached


Memcached (pronunciation: mem-cash-dee) is a distributed in-memory key-value storage system, usually used for caching objects in memory to speed up database applications. Typically, users wrap database queries with Memcached get/set operations to cache recently-used objects.[02][03]

History[03]


Memcached was originally developed by Brad Fitzpatrick from Danga Interactive for LiveJournal. It was originally written in Perl, but is rewritten in C by Anatoly Vorobey. Now Memcached is used widely in many systems, including YouTube, Twitter, Facebook, and Wikipedia. It is also provided in many cloud platform services, including Google App Engine, Microsoft Azure, and Amazon Web Services.

Checkpoints[04]


There is no checkpointing in Memcached, since it is intended for being a caching system. The cache is not persistant between restarts.

Concurrency Control[04]


Memcached doesn't have the concept of transactions. The get/set operations are atomic, though. For example, multiple sets on the same key can be issued concurrently, but only the last will stay.

Data Model[03]


Memcached servers maintain a key-value map. Keys are up to 250 bytes long and values are up to 1 MB large. There are no relational schemas.

Foreign Keys[05]


Memcached only stores one key-value map. There is no support for relational schemas. Therefore, there is no need to support foreign keys.

Indexes[03][06]


Memcached stores a key-value hash table on every server. As of May 2017, it uses MurmurHash 3 as the hash function.

Isolation Levels[04]


Memcached doesn't have the concept of transactions. The get/set operations are atomic, though. For example, multiple sets on the same key can be issued concurrently, but only the last will stay.

Joins[07]


Memcached only supports get/set and related operations on a key-value store. There is no support for SQL queries. Therefore, there is no need to support joins.

Logging[04]


There is no logging in Memcached, since it is intended for being a caching system. The cache is not persistant between restarts.

Query Compilation[07]


Memcached only supports get/set and related operations on a key-value store. There is no support for SQL queries. Therefore, there is no need for query compilation.

Query Execution[08]


Query Interface[07]


Memcached provides get/set and related operations. It also allows users to specify how long a cache item should last.

Storage Architecture[04]


In Memcached, everything is stored in memory, since it is intended for caching objects stored in a disk-oriented database. By storing everything in memory, it achieved the needed latency and speed. The cache is not persitent between restarts, which is an intended feature.

Storage Model[06][09]


Memcached stores a hash table. As of May 2017, it uses MurmurHash 3 as the hash function. Values items are slab-allocated.

Stored Procedures[07]


Memcached only supports get/set and related operations on a key-value store. There is no support for SQL queries. Therefore, there is no need to support stored procedures.

System Architecture[03]


In Memcached, a client knows all servers. Servers do not communicate with each other. Each key is hashed to determine which server is used to store the key-value pair. If all clients use the same hash function, then a client can read other clients' cached data.

Views[07]


Memcached only supports get/set and related operations on a key-value store. There is no support for SQL queries. Therefore, there is no need to support views.

Citations

9 sources
  1. memcached - a distributed memory object caching system memcached.org
  2. memcached - a distributed memory object caching system memcached.org
  3. Memcached - Wikipedia wikipedia.org
  4. ProgrammingFAQ · memcached/memcached Wiki · GitHub github.com
  5. Overview · memcached/memcached Wiki · GitHub github.com
  6. memcached/murmur3_hash.c at master · memcached/memcached · GitHub github.com
  7. Commands · memcached/memcached Wiki · GitHub github.com
  8. ProgrammingFAQ · memcached/memcached Wiki · GitHub github.com
  9. memcached/items.c at master · memcached/memcached · GitHub github.com
Revision #2 Last Updated: