How do Redis and Memcached differ, and when do you choose each for a project?
Short answer
Memcached is a pure key–value cache: byte strings, multi-threaded, no persistence, no replication. Redis is an in-memory data store with many data types, atomic operations, persistence, replication and Cluster; new projects almost always pick Redis or Valkey.
3 points to say:
- Memcached: string key–value, multi-threaded so one node uses many cores, and losing the cache is acceptable.
- Redis/Valkey: leaderboards,
INCR, rate limiters, locks, atomic server-side operations, replicas and failover. - Licensing: Redis 7.4 moved to RSALv2/SSPLv1; Valkey is the BSD fork; Redis 8 added an AGPLv3 option.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.