Need advice about which tool to choose?Ask the StackShare community!


+ 1

+ 1
Add tool

Memcached vs Redis: What are the differences?

Key differences between Memcached and Redis

Memcached and Redis are both popular in-memory data stores used for caching and improving the performance of applications. However, there are several key differences between the two.

  1. Data Structure Support: Redis supports a wide variety of data structures such as strings, lists, sets, sorted sets, and hashes, whereas Memcached only supports a simple key-value store without any built-in support for complex data structures. This makes Redis more versatile and suitable for a wider range of use cases.

  2. Persistence: Redis provides the option to persist data to disk, allowing the data to be recovered in case of a system restart or failure. Memcached, on the other hand, does not offer any built-in persistence mechanism and relies solely on system memory for data storage. This makes Redis more reliable in situations where data durability is required.

  3. Data Expiration: Redis allows setting an expiration time for individual keys, providing a convenient way to automatically remove data after a certain period. Memcached, on the other hand, relies on the Least Recently Used (LRU) eviction strategy and does not support setting explicit expiration times for individual keys. This makes Redis more suitable for scenarios that require fine-grained control over data expiration.

  4. Replication and Clustering: Redis supports replication and clustering, allowing data to be replicated across multiple nodes or distributed across a cluster of servers. This provides scalability, high availability, and fault tolerance. Memcached, on the other hand, does not provide built-in support for replication or clustering, making it less suitable for scenarios that require high scalability or fault tolerance.

  5. Advanced functionalities: Redis offers advanced functionalities such as pub/sub messaging, transactions, Lua scripting, and support for complex data manipulations. These features enable Redis to be used as a versatile data store and a message broker. Memcached, on the other hand, focuses primarily on caching and does not provide these advanced functionalities.

  6. Memory Efficiency: Memcached is generally more memory-efficient compared to Redis for storing large volumes of data. Redis stores more metadata per entry, leading to higher memory usage. However, Redis provides efficient memory management techniques such as memory compression and virtual memory that can help mitigate this issue in certain scenarios.

In summary, Redis offers a more diverse set of features and capabilities compared to Memcached, including support for complex data structures, persistence, data expiration, replication, clustering, advanced functionalities, and memory efficiency. Memcached, on the other hand, excels at being a lightweight and performant caching solution.

Decisions about Memcached and Redis
Matthew Evans

The obvious volatile memory choices were either Memcached or Redis. We eventually sided with Redis as it natively handled replication, and this replication fell under the PCI responsibility scope of AWS. This added duribility meant that if a redis node were to die, our downtime would be in the seconds, rather than 15 minutes which we would incur using Memcached

See more
Mark Harrison

The requirement was the classic "cache the results of a SQL query for a period of time."

While the Internet is full of "Redis is fuller featured" posts, the key issue for us was the actual performance. We discovered, in various stress scenario testing, that Memcached outperformed Redis for simple key-value retrieval dramatically (over twice as fast.) That's not to say that Redis is bad - we use that in other places where the requirements are more sophisticated than simple key/value retrieval.

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Memcached
Pros of Redis
  • 139
    Fast object cache
  • 129
  • 91
  • 65
  • 33
    Distributed caching system
  • 11
    Improved response time and throughput
  • 3
    Great for caching HTML
  • 2
  • 886
  • 542
    Super fast
  • 513
    Ease of use
  • 444
    In-memory cache
  • 324
    Advanced key-value cache
  • 194
    Open source
  • 182
    Easy to deploy
  • 164
  • 155
  • 121
  • 42
  • 40
    High Availability
  • 35
    Data Structures
  • 32
    Very Scalable
  • 24
  • 22
    Great community
  • 22
  • 19
    "NoSQL" key-value data store
  • 16
  • 13
  • 11
    Sorted Sets
  • 10
  • 10
  • 9
    Async replication
  • 9
    BSD licensed
  • 8
  • 8
    Integrates super easy with Sidekiq for Rails background
  • 7
    Keys with a limited time-to-live
  • 7
    Open Source
  • 6
    Lua scripting
  • 6
  • 5
    Awesomeness for Free
  • 5
  • 4
  • 4
    Outstanding performance
  • 4
    Runs server side LUA
  • 4
    LRU eviction of keys
  • 4
    Feature Rich
  • 4
    Written in ANSI C
  • 4
  • 3
    Data structure server
  • 3
    Performance & ease of use
  • 2
    Dont save data if no subscribers are found
  • 2
    Automatic failover
  • 2
    Easy to use
  • 2
    Temporarily kept on disk
  • 2
  • 2
    Existing Laravel Integration
  • 2
    Channels concept
  • 2
    Object [key/value] size each 500 MB
  • 2

Sign up to add or upvote prosMake informed product decisions

Cons of Memcached
Cons of Redis
  • 2
    Only caches simple types
  • 15
    Cannot query objects directly
  • 3
    No secondary indexes for non-numeric data types
  • 1
    No WAL

Sign up to add or upvote consMake informed product decisions

- No public GitHub repository available -

What is Memcached?

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.

What is Redis?

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.

Need advice about which tool to choose?Ask the StackShare community!

Jobs that mention Memcached and Redis as a desired skillset
Oakland, California, United States
What companies use Memcached?
What companies use Redis?
See which teams inside your own company are using Memcached or Redis.
Sign up for StackShare EnterpriseLearn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Memcached?
What tools integrate with Redis?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

Dec 22 2020 at 9:26PM


Amazon EC2C langMemcached+4
Nov 20 2019 at 3:38AM


Jun 6 2019 at 5:11PM


What are some alternatives to Memcached and Redis?
Ehcache is an open source, standards-based cache for boosting performance, offloading your database, and simplifying scalability. It's the most widely-used Java-based cache because it's robust, proven, and full-featured. Ehcache scales from in-process, with one or more nodes, all the way to mixed in-process/out-of-process configurations with terabyte-sized caches.
Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents. Varnish Cache is really, really fast. It typically speeds up delivery with a factor of 300 - 1000x, depending on your architecture.
With its various distributed data structures, distributed caching capabilities, elastic nature, memcache support, integration with Spring and Hibernate and more importantly with so many happy users, Hazelcast is feature-rich, enterprise-ready and developer-friendly in-memory data grid solution.
MongoDB stores data in JSON-like documents that can vary in structure, offering a dynamic, flexible schema. MongoDB was also designed for high availability and scalability, with built-in replication and auto-sharding.
Developed as an alternative to traditionally inflexible SQL databases, the Couchbase NoSQL database is built on an open source foundation and architected to help developers solve real-world problems and meet high scalability demands.
See all alternatives