Versus
Redis vs Memcached
Both are blazingly fast, in-memory key-value stores. For years, Memcached was the default for simple HTML caching, but Redis has eaten its lunch for almost every other use case.
| Feature | Redis | Memcached |
|---|---|---|
| Data Types | Strings, Hashes, Lists, Sets, Sorted Sets, Bitmaps, HyperLogLogs. | Strings and integers only. |
| Persistence | Yes (RDB snapshots and AOF logs). | No. If it restarts, data is gone. |
| Architecture | Single-threaded event loop (mostly). | Multi-threaded architecture. |
The Verdict
Use Redis unless you have a very specific, pure-string caching workload on a multi-core machine where Redis's single-threaded nature becomes a provable bottleneck (which is incredibly rare). Redis's data structures allow you to push computation (like sorting or ranking) into the cache layer, which Memcached cannot do.