Redis vs Memcached vs Valkey by Use Case
8 use cases. For each: who wins, why, and named real-world users. The matrix that most Redis vs Memcached articles skip.
| Use case | Memcached | Redis / Valkey | Why |
|---|---|---|---|
| Page cache (HTML / API response) | Strong | Equally strong | Both work. Memcached's narrow lane: multi-threaded throughput edge for pure ephemeral GET/SET. |
| Session store | No | Strong | Sessions need persistence + replication. Memcached restart = users logged out. |
| Rate limiter | Awkward (CAS) | Strong | Atomic INCR + EXPIRE is Redis/Valkey's native pattern. Memcached CAS for rate limiting is fragile. |
| Leaderboard (sorted scores) | No | Strong | Redis sorted sets (ZADD / ZREVRANGE) are purpose-built. O(log N) insert, O(log N + K) range query. |
| Pub/sub messaging | No | Strong | Memcached has no pub/sub. Redis SUBSCRIBE/PUBLISH or Streams. Valkey is equivalent. |
| Job queue | No | Strong | Redis Lists (LPUSH/RPOP) or Streams (XADD/XREAD with consumer groups). At-least-once semantics. |
| Geospatial (radius search) | No | Strong | GEOADD / GEORADIUS commands built-in. Memcached has no geospatial primitives. |
| Vector search (AI / RAG) | No | Redis 8.0 only | VADD / VSIM commands shipped in Redis 8.0 (May 2025). Valkey roadmap but not in 8.1. |
Deep-dive guides
Code samples, stack-specific guidance, and real-world named users for the three most common use cases.
The definitive guide to why Memcached for sessions is a 2010-era pattern. Code samples, Rails/Django defaults, Redis hash field TTL.
When Memcached genuinely wins (pure ephemeral GET/SET), and when Redis takes over. Stack-specific guides for Rails, Django, Node.js, Spring.
Memcached has no pub/sub. Redis SUBSCRIBE/PUBLISH vs Redis Streams vs Kafka. When each is right.
The hybrid pattern: Memcached + Redis/Valkey in the same stack
Many large companies run both in the same stack. Facebook runs Memcached for HTML page caching and Redis (or equivalent) for everything else. The pattern: use Memcached for pure ephemeral page cache where multi-threaded throughput matters most, and Redis (or Valkey) for sessions, rate limiters, pub/sub, leaderboards, and any use case requiring persistence or data structures.
This is a legitimate architecture in 2026, not over-engineering. Memcached and Redis are not competitors for the same workload: they are complements for different workloads. The license difference (Memcached BSD, Redis tri-licensed, Valkey BSD) makes the hybrid pattern even simpler for license-sensitive shops: Memcached + Valkey = two BSD-licensed components.