SteelReed

Search

Search posts, questions…

Caching & RedisQuestion 9 / 24

Middle

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.

yesnoyesno, want multi-threadingNeed structures, atomicops,persistence?Redis or ValkeyNeed replicas, failover?Memcached

3 points to say:

  1. Memcached: string key–value, multi-threaded so one node uses many cores, and losing the cache is acceptable.
  2. Redis/Valkey: leaderboards, INCR, rate limiters, locks, atomic server-side operations, replicas and failover.
  3. 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.