Redis vs Memcached
Two in-memory caches. Redis offers rich data types, persistence, replication, and pub/sub (single-threaded per core); Memcached is simpler, multithreaded, strings-only, and intentionally ephemeral. Both are excellent; the choice is about features vs simplicity.
| Dimension | Redis | Memcached |
|---|---|---|
| Data types | Strings, hashes, lists, sets, sorted sets, streams, HyperLogLog. | Strings only. |
| Persistence | Optional RDB snapshots + AOF. | None by design (pure cache). |
| Replication/HA | Cluster sharding + replication + Sentinel. | None by design; client hashing across nodes. |
| Throughput per node | Single-threaded per core; cluster to scale. | Multithreaded; saturates a multi-core box for plain GET/SET. |
| Use as more than cache | Queues, rate limiting, pub/sub, leaderboards. | Caching only. |
Data types
- Redis
- Strings, hashes, lists, sets, sorted sets, streams, HyperLogLog.
- Memcached
- Strings only.
Persistence
- Redis
- Optional RDB snapshots + AOF.
- Memcached
- None by design (pure cache).
Replication/HA
- Redis
- Cluster sharding + replication + Sentinel.
- Memcached
- None by design; client hashing across nodes.
Throughput per node
- Redis
- Single-threaded per core; cluster to scale.
- Memcached
- Multithreaded; saturates a multi-core box for plain GET/SET.
Use as more than cache
- Redis
- Queues, rate limiting, pub/sub, leaderboards.
- Memcached
- Caching only.
When Redis wins
- You need data structures, persistence, replication, or pub/sub.
- You want one tool for cache + lightweight queue + rate limiting.
When Memcached wins
- You want the simplest, fastest pure cache with no extra features.
- Multithreaded throughput on a single node matters more than data types.
Verdict
Default to Redis for its versatility; choose Memcached when you want a deliberately minimal, multithreaded pure cache and nothing more.