Home / Use Cases

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 caseMemcachedRedis / ValkeyWhy
Page cache (HTML / API response)StrongEqually strongBoth work. Memcached's narrow lane: multi-threaded throughput edge for pure ephemeral GET/SET.
Session storeNoStrongSessions need persistence + replication. Memcached restart = users logged out.
Rate limiterAwkward (CAS)StrongAtomic INCR + EXPIRE is Redis/Valkey's native pattern. Memcached CAS for rate limiting is fragile.
Leaderboard (sorted scores)NoStrongRedis sorted sets (ZADD / ZREVRANGE) are purpose-built. O(log N) insert, O(log N + K) range query.
Pub/sub messagingNoStrongMemcached has no pub/sub. Redis SUBSCRIBE/PUBLISH or Streams. Valkey is equivalent.
Job queueNoStrongRedis Lists (LPUSH/RPOP) or Streams (XADD/XREAD with consumer groups). At-least-once semantics.
Geospatial (radius search)NoStrongGEOADD / GEORADIUS commands built-in. Memcached has no geospatial primitives.
Vector search (AI / RAG)NoCore (vector sets)VADD / VSIM ship in Redis 8.0 core (May 2025). Valkey offers vector similarity search through the valkey-search module (GA Jul 2025), not a core data type.

Deep-dive guides

Code samples, stack-specific guidance, and real-world named users for the three most common use cases.

Session StoreRedis or Valkey

The definitive guide to why Memcached for sessions is a 2010-era pattern. Code samples, Rails/Django defaults, Redis hash field TTL.

Real users: Twitter, Stack Overflow (Redis)
Full guide →
Cache LayerMemcached or Redis

When Memcached genuinely wins (pure ephemeral GET/SET), and when Redis takes over. Stack-specific guides for Rails, Django, Node.js, Spring.

Real users: Facebook, YouTube, Wikipedia (Memcached)
Full guide →
Pub/SubRedis or Valkey

Memcached has no pub/sub. Redis SUBSCRIBE/PUBLISH vs Redis Streams vs Kafka. When each is right.

Real users: Discord, Slack (Redis pub/sub)
Full guide →

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.

Code samples →Feature comparison →Monorepo vs Polyrepo (related) →

Didn't find your answer?

Ask us. A real person reads every question and we answer the ones we can, with sources. If your question would help other readers, we may publish an anonymised version, with your permission. General reference only.

Ask a question

questions@redisvsmemcached.com