Memcached
activeby Memcached community (originally Danga Interactive) · since 2003 · also known as memcache
The original multi-threaded, dead-simple distributed memory cache for key-value blobs.
Overview
Memcached is a multi-threaded, in-memory cache that does one thing: store opaque values under keys with an expiry, evicting by LRU when memory runs out. There is no persistence, replication or server-side clustering; clients hash keys across a pool of independent nodes. That simplicity is its strength, and it still runs some of the largest cache fleets in the world. Modern releases add an extstore flash tier, TLS, a meta-command protocol and a built-in proxy for routing and replication. Pick it when you need a pure cache with predictable latency and nothing else.
Strengths & trade-offs
Strengths
- +Multi-threaded design uses every core on a box with very little tuning
- +Extremely predictable latency and memory behaviour with slab allocation
- +Extstore spills cold items to NVMe to cut RAM cost
- +Protocol supported by nearly every web framework and language
- +Tiny operational surface: no persistence, no replication state to manage
Trade-offs
- −No persistence: a restart empties the cache
- −Only opaque blobs; no data structures, queries or server-side scripting
- −No built-in replication or failover outside the proxy
- −Item size limit (1 MB default) and no secondary access paths
Great for
- +Read-through caching of database query results
- +Rendered page and fragment caching
- +Session storage when losing sessions is acceptable
- +Very large, horizontally sharded look-aside cache tiers
Think twice for
- −Any data you cannot afford to lose
- −Queues, pub/sub or counters with complex semantics
- −Rich data structures (use Redis or Valkey)
Capabilities
Native or official first-party support · 2 of 25 tracked
Scale & consistency
- Comfortable data size
- Large · ≤ 1 PB
- Horizontal scaling
- Manual
- Multi-region
- No
- Transactions
- None
- Consistency
- Eventual
- Schema
- Schemaless
- Architecture
- In memory, Single node, Client server
- Query languages
- Memcached text/meta protocol
Scales by adding nodes and client-side consistent hashing; the built-in proxy can route and replicate. Meta and Netflix run fleets of thousands of nodes.
Deployment
available on · AWS · Google Cloud · Alibaba Cloud · Tencent Cloud
Ecosystem
Alternatives to Memcached
The in-memory data structure server that became the default cache, now with search, JSON and vectors built in.
memcached vs redis →The Linux Foundation's BSD-licensed fork of Redis, now the default engine on AWS and Google Cloud.
memcached vs valkey →A multi-threaded, shared-nothing in-memory store that speaks Redis and Memcached on one big box.
memcached vs dragonfly →AWS's managed Valkey, Redis OSS and Memcached service, provisioned or serverless.
memcached vs amazon-elasticache →The standard embedded JVM cache, with heap, off-heap and disk tiers and optional Terracotta clustering.
memcached vs ehcache →Netflix's memcached-based distributed cache with zone-aware replication, built for AWS microservices.
memcached vs evcache →Memcached FAQ
What is Memcached?
Memcached is a key-value database by Memcached community (originally Danga Interactive), first released in 2003. Memcached is a multi-threaded, in-memory cache that does one thing: store opaque values under keys with an expiry, evicting by LRU when memory runs out. There is no persistence, replication or server-side clustering; clients hash keys across a pool of independent nodes. That simplicity is its strength, and it still runs some of the largest cache fleets in the world. Modern releases add an extstore flash tier, TLS, a meta-command protocol and a built-in proxy for routing and replication. Pick it when you need a pure cache with predictable latency and nothing else.
Is Memcached open source?
Yes. Memcached is open source. License: BSD 3-Clause.
Does Memcached support ACID transactions?
No. Memcached does not provide ACID transactions; its consistency model is eventual.
Does Memcached scale horizontally?
Memcached has no built-in sharding; scaling out means partitioning data in your application. It is comfortable at large scale (≤ 1 PB).
How can I run Memcached?
You can self-host it. Managed offerings include Amazon ElastiCache for Memcached and Memorystore for Memcached. It is available on AWS, Google Cloud, Alibaba Cloud and Tencent Cloud.
What is Memcached best for?
Memcached is a strong fit for read-through caching of database query results; rendered page and fragment caching; and session storage when losing sessions is acceptable. Think twice for any data you cannot afford to lose.
What are the best alternatives to Memcached?
Common alternatives to Memcached include Redis, Valkey, Dragonfly, Amazon ElastiCache and Ehcache. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
How popular is Memcached?
Memcached ranks #25 of 844 databases on the WhichDB Score (50.6/100), and #4 among key-value databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.


