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

Ehcache

172
159
+ 1
4
Redis

58.1K
44.7K
+ 1
3.9K
Add tool

Ehcache vs Redis: What are the differences?

Ehcache and Redis are both popular caching technologies used in web applications. Here are some key differences between them:

  1. Storage: Ehcache is an in-memory cache, meaning that the data is stored in the application's memory. On the other hand, Redis is an in-memory data store that can also persist data on disk. This makes Redis more suitable for scenarios where data durability is essential or when a larger dataset needs to be cached.

  2. Data Structures: Redis offers a wide range of data structures like strings, hashes, lists, sets, and more, allowing for complex data storage and retrieval. Ehcache, on the other hand, is primarily focused on simple key-value pairs, making it simpler and more lightweight for straightforward caching needs.

  3. Scalability: Redis is known for its horizontal scalability, allowing you to distribute data across multiple Redis instances using sharding or clustering. This makes it a better choice for applications that require high scalability and distributed caching. Ehcache, on the other hand, is typically used as an embedded cache within a single application instance and may not scale as easily.

  4. Replication and High Availability: Redis provides built-in replication and high availability mechanisms, allowing for data redundancy in case of node failures. Ehcache, on the other hand, relies on the application's infrastructure for replication and high availability. While it is possible to achieve replication with Ehcache, it requires extra effort and custom implementation.

  5. Integration: Redis is a standalone cache that can be used with various programming languages and frameworks through its client libraries. Ehcache, on the other hand, is often tightly integrated with Java-based frameworks and technologies like Hibernate, Spring, and Java EE. This makes it a more seamless choice for Java applications.

  6. Features: Redis provides additional features like pub/sub messaging, geospatial indexing, and Lua scripting, making it versatile for various use cases beyond simple caching. Ehcache, on the other hand, focuses primarily on caching and may not offer these advanced features out of the box.

In summary, Ehcache is a lightweight in-memory cache primarily focused on simple key-value pairs, while Redis is a more powerful and versatile in-memory data store with additional features, scalability, and data persistence options. The choice between the two depends on the specific requirements and complexity of the caching needs.

Advice on Ehcache and Redis
Dadakhalandar S
Sr Solution Specialist at Nokia · | 2 upvotes · 10.1K views
Needs advice
on
EhcacheEhcache
and
RedisRedis

Hello, I am working on designing the API application for Mobile. We are going to use SpringBoot + Zuul Proxy for API Access Layer and API Services again Spring Boot with REST services exposed. Can you please help me to understand the implementation of REST Caching with ETag or Http Headers cache and how it is different from EhCache for Database side. So if you need to handle caching from REST and Database side, please advise me to get some idea of strategy in implementing it. Thank you so much in advance.

Also for the Java app, which is easy to implement whether Redis or Ehcache, I am new to Redis.

Regards, Dada

See more
Replies (1)
Gerry King
Development Manager at molk · | 1 upvotes · 9.1K views
Recommends
on
RedisRedis

Redis and Ehcache are server-side caches. Ehcache is used to cache data within a Java application. Redis runs in it's own environment so it survives OOM JVM crashes. You can use Redis with a multitude of languages.

https://db-engines.com/en/system/Ehcache%3BRedis

ETAGS and HTTP Headers are mainly used by the client side user agent to cache resources locally.

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Ehcache
Pros of Redis
  • 1
    Way Faster than Redis and Elasticache Redis
  • 1
    Easy setup
  • 1
    Simpler to run in testing environment
  • 1
    Container doesn't have to be running for local tests
  • 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 Ehcache
Cons of Redis
    Be the first to leave a con
    • 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 Ehcache?

    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.

    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 Ehcache and Redis as a desired skillset
    LaunchDarkly
    Oakland, California, United States
    What companies use Ehcache?
    What companies use Redis?
    See which teams inside your own company are using Ehcache 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 Ehcache?
    What tools integrate with Redis?
      No integrations found

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

      Blog Posts

      Nov 20 2019 at 3:38AM

      OneSignal

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

      AppSignal

      RedisRubyKafka+9
      15
      1640
      GitHubDockerReact+17
      40
      36265
      What are some alternatives to Ehcache and Redis?
      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.
      Apache Ignite
      It is a memory-centric distributed database, caching, and processing platform for transactional, analytical, and streaming workloads delivering in-memory speeds at petabyte scale
      Hazelcast
      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.
      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.
      GraphQL Cache
      A custom middleware for graphql-ruby that handles key construction and cache reads/writes transparently.
      See all alternatives