StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Follow on

© 2025 StackShare. All rights reserved.

Product

  • Stacks
  • Tools
  • Feed

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  1. Stackups
  2. Application & Data
  3. In-Memory Databases
  4. In Memory Databases
  5. Memcached vs Redis

Memcached vs Redis

OverviewDecisionsComparisonAlternatives

Overview

Redis
Redis
Stacks61.9K
Followers46.5K
Votes3.9K
GitHub Stars42
Forks6
Memcached
Memcached
Stacks7.9K
Followers5.7K
Votes473
GitHub Stars14.0K
Forks3.3K

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.

Share your Stack

Help developers discover the tools you use. Get visibility for your team's tech choices and contribute to the community's knowledge.

View Docs
CLI (Node.js)
or
Manual

Advice on Redis, Memcached

Mark
Mark

Director at Werarewe

Jul 7, 2020

Decided

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.

14.7k views14.7k
Comments
Matthew
Matthew

Aug 5, 2020

Decided

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

30.2k views30.2k
Comments

Detailed Comparison

Redis
Redis
Memcached
Memcached

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.

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.

Statistics
GitHub Stars
42
GitHub Stars
14.0K
GitHub Forks
6
GitHub Forks
3.3K
Stacks
61.9K
Stacks
7.9K
Followers
46.5K
Followers
5.7K
Votes
3.9K
Votes
473
Pros & Cons
Pros
  • 888
    Performance
  • 542
    Super fast
  • 514
    Ease of use
  • 444
    In-memory cache
  • 324
    Advanced key-value cache
Cons
  • 15
    Cannot query objects directly
  • 3
    No secondary indexes for non-numeric data types
  • 1
    No WAL
Pros
  • 139
    Fast object cache
  • 129
    High-performance
  • 91
    Stable
  • 65
    Mature
  • 33
    Distributed caching system
Cons
  • 2
    Only caches simple types

What are some alternatives to Redis, Memcached?

MongoDB

MongoDB

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.

MySQL

MySQL

The MySQL software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.

PostgreSQL

PostgreSQL

PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions.

Microsoft SQL Server

Microsoft SQL Server

Microsoft® SQL Server is a database management and analysis system for e-commerce, line-of-business, and data warehousing solutions.

SQLite

SQLite

SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file.

Cassandra

Cassandra

Partitioning means that Cassandra can distribute your data across multiple machines in an application-transparent matter. Cassandra will automatically repartition as machines are added and removed from the cluster. Row store means that like relational databases, Cassandra organizes data by rows and columns. The Cassandra Query Language (CQL) is a close relative of SQL.

MariaDB

MariaDB

Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry. MariaDB is designed as a drop-in replacement of MySQL(R) with more features, new storage engines, fewer bugs, and better performance.

RethinkDB

RethinkDB

RethinkDB is built to store JSON documents, and scale to multiple machines with very little effort. It has a pleasant query language that supports really useful queries like table joins and group by, and is easy to setup and learn.

ArangoDB

ArangoDB

A distributed free and open-source database with a flexible data model for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.

InfluxDB

InfluxDB

InfluxDB is a scalable datastore for metrics, events, and real-time analytics. It has a built-in HTTP API so you don't have to write any server side code to get up and running. InfluxDB is designed to be scalable, simple to install and manage, and fast to get data in and out.

Related Comparisons

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot

Liquibase
Flyway

Flyway vs Liquibase