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

guava

1.2K
193
+ 1
6
Memcached

7.6K
5.5K
+ 1
473
Redis

58.1K
44.7K
+ 1
3.9K

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 guava, Memcached, and Redis
Francisco José Casasaltas Perales
Needs advice
on
EhcacheEhcacheguavaguava
and
MemcachedMemcached

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...

See more
Replies (1)
Recommends
on
RedisRedis

Redis can do the same jobs as Memcached, ECache or any other im-memory caching tool and can do them better. - Redis can act as a cache as well. It can store key/value pairs too. In Redis, they can even be up to 512MB. - Redis is better documented than Memcached and ECached. - Supports many data types. (Strings, Hashes, Lists, Sets, Sorted Sets, Geo, Bitmap and HyperLogLog) - Redis provides pub/sub as well. - Redis can be scaled easily horizontally if needed using its own tool Redis Sentinel. - Wide variety of client libraries in almost every language.

See more
Decisions about guava, 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 guava
Pros of Memcached
Pros of Redis
  • 5
    Interface Driven API
  • 1
    Easy to setup
  • 139
    Fast object cache
  • 129
    High-performance
  • 91
    Stable
  • 65
    Mature
  • 33
    Distributed caching system
  • 11
    Improved response time and throughput
  • 3
    Great for caching HTML
  • 2
    Putta
  • 886
    Performance
  • 542
    Super fast
  • 513
    Ease of use
  • 444
    In-memory cache
  • 324
    Advanced key-value cache
  • 194
    Open source
  • 182
    Easy to deploy
  • 164
    Stable
  • 155
    Free
  • 121
    Fast
  • 42
    High-Performance
  • 40
    High Availability
  • 35
    Data Structures
  • 32
    Very Scalable
  • 24
    Replication
  • 22
    Great community
  • 22
    Pub/Sub
  • 19
    "NoSQL" key-value data store
  • 16
    Hashes
  • 13
    Sets
  • 11
    Sorted Sets
  • 10
    NoSQL
  • 10
    Lists
  • 9
    Async replication
  • 9
    BSD licensed
  • 8
    Bitmaps
  • 8
    Integrates super easy with Sidekiq for Rails background
  • 7
    Keys with a limited time-to-live
  • 7
    Open Source
  • 6
    Lua scripting
  • 6
    Strings
  • 5
    Awesomeness for Free
  • 5
    Hyperloglogs
  • 4
    Transactions
  • 4
    Outstanding performance
  • 4
    Runs server side LUA
  • 4
    LRU eviction of keys
  • 4
    Feature Rich
  • 4
    Written in ANSI C
  • 4
    Networked
  • 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
    Scalable
  • 2
    Existing Laravel Integration
  • 2
    Channels concept
  • 2
    Object [key/value] size each 500 MB
  • 2
    Simple

Sign up to add or upvote prosMake informed product decisions

Cons of guava
Cons of Memcached
Cons of Redis
    Be the first to leave a con
    • 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 guava?

    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.

    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 guava, Memcached, and Redis as a desired skillset
    LaunchDarkly
    Oakland, California, United States
    What companies use guava?
    What companies use Memcached?
    What companies use Redis?

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

    What tools integrate with guava?
    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

    Pinterest

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

    OneSignal

    PostgreSQLRedisRuby+8
    9
    4639
    Jun 6 2019 at 5:11PM

    AppSignal

    RedisRubyKafka+9
    15
    1639
    What are some alternatives to guava, Memcached, and Redis?
    Java 8
    It is a revolutionary release of the world’s no 1 development platform. It includes a huge upgrade to the Java programming model and a coordinated evolution of the JVM, Java language, and libraries. Java 8 includes features for productivity, ease of use, improved polyglot programming, security and improved performance.
    RxJava
    A library for composing asynchronous and event-based programs by using observable sequences for the Java VM.
    Quarkus
    It tailors your application for GraalVM and HotSpot. Amazingly fast boot time, incredibly low RSS memory (not just heap size!) offering near instant scale up and high density memory utilization in container orchestration platforms like Kubernetes. We use a technique we call compile time boot.
    Apache FreeMarker
    It is a "template engine"; a generic tool to generate text output (anything from HTML to auto generated source code) based on templates. It's a Java package, a class library for Java programmers.
    Jackson
    It is a suite of data-processing tools for Java (and the JVM platform), including the flagship streaming JSON parser / generator library, matching data-binding library (POJOs to and from JSON) and additional data format modules to process data encoded in Avro, BSON, CBOR, CSV, Smile, (Java) Properties, Protobuf, XML or YAML; and even the large set of data format modules to support data types of widely used data types such as Guava, Joda.
    See all alternatives