Memcached vs Redis
Memcached: The original multi-threaded, dead-simple distributed memory cache for key-value blobs. Redis: The in-memory data structure server that became the default cache, now with search, JSON and vectors built in.
key differences
- Licensing: Memcached is open source (permissive) (BSD 3-Clause); Redis is open source (copyleft) (Tri-license: AGPLv3, RSALv2 or SSPLv1 (Redis 8+)).
- Memcached is built for larger datasets (≤ 1 PB) than Redis (≤ 10 TB).
- Horizontal scaling is manual in Memcached and native in Redis.
- Transactions: Memcached offers none ACID; Redis offers limited.
- Only Redis has transactions, secondary indexes, full-text search, vector search, geospatial.
choose memcached for
- +Read-through caching of database query results
- +Rendered page and fragment caching
- +Session storage when losing sessions is acceptable
- +Very large, horizontally sharded look-aside cache tiers
best at · Cache, Sessions
choose redis for
- +Application and database query caching
- +Session storage and user tokens
- +Rate limiting and distributed locks
- +Leaderboards and counters
best at · Cache, Sessions, Queue
Memcached vs Redis: FAQ
What is the difference between Memcached and Redis?
Memcached: The original multi-threaded, dead-simple distributed memory cache for key-value blobs. Redis: The in-memory data structure server that became the default cache, now with search, JSON and vectors built in. Licensing: Memcached is open source (permissive) (BSD 3-Clause); Redis is open source (copyleft) (Tri-license: AGPLv3, RSALv2 or SSPLv1 (Redis 8+)). Memcached is built for larger datasets (≤ 1 PB) than Redis (≤ 10 TB). Horizontal scaling is manual in Memcached and native in Redis.
When should I choose Memcached over Redis?
Choose Memcached for read-through caching of database query results; rendered page and fragment caching; and session storage when losing sessions is acceptable. Choose Redis for application and database query caching; session storage and user tokens; and rate limiting and distributed locks.
Is Memcached or Redis more popular?
Redis ranks #2 on the WhichDB Score (84.3/100) and Memcached ranks #25 (50.6/100). Popularity is not fit: check the requirements that matter for your project.
Are Memcached and Redis open source?
Yes. Memcached is open source. License: BSD 3-Clause. Yes. Redis is open source. License: Tri-license: AGPLv3, RSALv2 or SSPLv1 (Redis 8+).