StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Product

  • Stacks
  • Tools
  • Companies
  • Feed

Company

  • About
  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2025 StackShare. All rights reserved.

API StatusChangelog
  1. Stackups
  2. Application & Data
  3. Databases
  4. Memcached vs Redis vs guava

Memcached vs Redis vs guava

OverviewDecisionsComparisonAlternatives

Overview

Redis
Redis
Stacks60.7K
Followers46.5K
Votes3.9K
GitHub Stars42
Forks6
Memcached
Memcached
Stacks8.0K
Followers5.7K
Votes473
GitHub Stars14.0K
Forks3.3K
guava
guava
Stacks1.2K
Followers193
Votes6
GitHub Stars51.2K
Forks11.1K

Memcached vs Redis vs guava: What are the differences?

Key Differences between Memcached and Redis and Guava

Memcached and Redis are both popular in-memory data stores that are commonly used for caching and improving the performance of web applications. Guava, on the other hand, is a Java library that provides various utility classes and functions. While all three have caching capabilities, there are some key differences between them.

  1. Data Structure Support: Redis and Guava provide more extensive data structure support compared to Memcached. Redis includes data structures such as strings, hashes, lists, sets, and sorted sets, making it more suitable for complex data manipulation. Guava, on the other hand, offers data structures like collections, caching, and functional types that are highly efficient.

  2. Persistence: Redis has built-in persistence options, allowing data to be stored on disk and loaded back into memory upon restart. This feature makes Redis more suitable for use cases that require persistence and data durability. Memcached, on the other hand, does not provide built-in persistence and is generally used for caching purposes only. Guava does not offer persistence as it is mainly focused on providing utility functions.

  3. Scalability: Redis and Memcached are designed to be highly scalable and can be easily scaled horizontally by adding more servers to the cache cluster. Memcached is a distributed cache that allows data to be spread across multiple nodes, while Redis supports replication and sharding for scalability. Guava, being a Java library, does not provide built-in scalability features and is limited by the resources of a single Java Virtual Machine (JVM).

  4. Support for Multiple Programming Languages: Memcached and Redis are both designed to support multiple programming languages and can be accessed from various application frameworks. Redis supports clients for different programming languages, including Java, C++, Python, and more. Guava, being a Java library, is primarily targeted for Java developers and does not have direct support for other programming languages.

  5. Cache Eviction Policies: Redis and Guava both provide flexible cache eviction policies, allowing control over how data is evicted from the cache in case it becomes full. Redis offers a variety of eviction options, including LRU (Least Recently Used), LFU (Least Frequently Used), and more. Guava also provides different eviction policies like LRU, LFU, and size-based eviction. Memcached, however, does not provide built-in eviction policies and relies on application logic to manage cache eviction.

  6. Additional Features: Redis provides additional features such as pub/sub messaging, transactions, and Lua scripting, making it more suitable for use cases requiring real-time messaging and atomic operations. Guava, being a utility library, offers various additional features like functional programming support, string manipulation utilities, and concurrency primitives.

In Summary, Memcached and Redis are powerful in-memory data stores with key differences in data structure support, persistence, scalability, programming language support, cache eviction policies, and additional features. Guava, on the other hand, is a Java library focused on providing utility classes and functions.

Advice on Redis, Memcached, guava

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
Francisco José
Francisco José

Software engineer

Nov 9, 2019

Needs advice

Hi guys! I need an in-memory key/value storage with a lifespan for each key What do you recommend me to use? I was thinking about using a ConcurrentHashMap, with a scheduled thread evicting keys when apply. In fact, it is a possibility due because the performance is not important. But, on the other side, I have considered using any library such as Memcached, Ehcache, guava...

9.88k views9.88k
Comments

Detailed Comparison

Redis
Redis
Memcached
Memcached
guava
guava

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.

The Guava project contains several of Google's core libraries that we rely on in our Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth.

Statistics
GitHub Stars
42
GitHub Stars
14.0K
GitHub Stars
51.2K
GitHub Forks
6
GitHub Forks
3.3K
GitHub Forks
11.1K
Stacks
60.7K
Stacks
8.0K
Stacks
1.2K
Followers
46.5K
Followers
5.7K
Followers
193
Votes
3.9K
Votes
473
Votes
6
Pros & Cons
Pros
  • 887
    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
Pros
  • 5
    Interface Driven API
  • 1
    Easy to setup

What are some alternatives to Redis, Memcached, guava?

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