Redis is the default for almost every cache workload now: it has data structures, persistence, pub-sub, and clustering in the box. Memcached is the right answer when the workload is a flat key-value cache and the team values the simplest possible operational story.
Redis
In-memory data structure store. Cache, queue, pub-sub, primary store — take your pick.
Since
2009
By
Salvatore Sanfilippo / Redis Ltd. (now under Redis Source Available License v2)
License
RSALv2 / SSPLv1 (since 2024); BSD until then. Valkey is the BSD fork.
These tools live in different categories now. Redis is a wide platform that also caches well. Memcached is a single-purpose cache that does only one thing. Most teams pick Redis for the optionality. The teams who pick Memcached do so because that optionality is, for them, a cost.
Quick takes
If you're…
You only need a flat key-to-value cache and have many CPU cores→MemcachedMemcached is multi-threaded; Redis is mostly single-threaded per instance.
You need sorted sets, hashes, streams, or geospatial queries→RedisMemcached has no data type beyond a byte blob.
You want a cache that survives a restart→RedisRedis ships RDB snapshots and AOF; Memcached loses everything on restart by design.
You need pub-sub or stream-style messaging→RedisRedis Pub/Sub and Streams are built in. Memcached has neither.
You are fronting Postgres or MySQL with cached page renders→EitherBoth work well. Familiarity and ops cost decide it.
You are building rate limiters or session stores→RedisINCR with EXPIRE is trivial in Redis; Memcached’s atomic operations are weaker.
You need strict TTL eviction and predictable memory shape→MemcachedMemcached’s slab allocator and LRU is the simplest predictable behaviour to deploy.
Values are small (under 1MB) and access is random→EitherBoth saturate the network at this size. Latency difference is sub-millisecond.
Strings, lists, hashes, sets, sorted sets, bitmaps, HyperLogLogs, geospatial entries, streams. Each has dedicated commands (LPUSH, ZADD, HSET, GEOADD, XADD). The data-structure surface is the reason most teams choose Redis.
Memcached
Byte blob. Clients can JSON-encode whatever they want, but atomic operations on individual fields are not available. INCR exists. That is the extent of structure.
core
Persistence
edge: Redis
Redis
RDB snapshots for point-in-time backups and AOF for an append-only log of every command, with tunable fsync. Configurable for "never lose more than 1s of writes." Persistence is optional; pure-cache mode is supported.
Memcached
None. Restarts lose everything. This is intentional. It keeps the design simple and avoids the corruption-recovery story.
core
Threading model
edge: Memcached
Redis
Single-threaded event loop for command execution. Redis 6+ added multi-threaded I/O but command dispatch is still serial. Predictable, no locking, but per-instance throughput is bounded by one core.
Memcached
Multi-threaded. Scales close to linearly across cores up to about 16 threads. On a 32-core machine, Memcached out-throughputs a single Redis instance on simple GET/SET by 2-3x.
ops
Clustering
edge: Redis
Redis
Redis Cluster is built in. Hash-slot sharding (16384 slots), automatic failover via Sentinel or Cluster mode, automatic resharding. Client libraries handle MOVED redirects.
Memcached
No native clustering. Sharding is client-side, usually consistent hashing in the client library (ketama). Simple, but rebalancing is the operator’s problem.
features
Pub/Sub and messaging
edge: Redis
Redis
Native Pub/Sub and Redis Streams, the latter with consumer groups, persistence, and message acks. Streams covers many event-driven needs without reaching for a full broker.
Memcached
None.
ops
Memory efficiency
tie
Redis
Variable overhead per key, roughly 50-100 bytes for short keys. Multiple encoding schemes (ziplist, intset, listpack) compact small structures. MEMORY DOCTOR helps debug overhead.
Memcached
Slab allocator with fixed page sizes. Lower per-key overhead, but memory can be wasted if value sizes do not fit slab boundaries. Tunable via -f and -n flags.
ecosystem
License (post-2024)
edge: Memcached
Redis
Redis Ltd. moved Redis to RSALv2 and SSPLv1 in 2024. Cloud vendors can no longer offer it as a service without a commercial agreement. AWS, GCP, and Oracle forked the BSD-era code to create Valkey, now under the Linux Foundation.
Memcached
BSD 3-clause. Stable for two decades. No license-change events to worry about.
ecosystem
Hosted offerings
edge: Redis
Redis
AWS ElastiCache (Redis and Valkey), GCP Memorystore, Azure Cache, Upstash, Redis Cloud, Aiven. Since the 2024 license change, most clouds default to Valkey but accept Redis if the customer pays.
Memcached
AWS ElastiCache (Memcached engine), GCP Memorystore (Memcached). Quieter, but very stable.
Benchmark
GET-heavy workload, 100-byte keys, 1KB values
memtier_benchmark, 32 client threads, 50/50 GET/SET, 10M keys, c5.4xlarge (16 vCPU). Single-instance Redis runs on one core; Memcached spreads across all 16; the cluster row shows Redis sharded across 6 nodes for matched parallelism. Numbers reproduced from the official memtier_benchmark README plus AWS's public Redis-vs-Memcached ElastiCache study.