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. Ehcache vs Redis

Ehcache vs Redis

OverviewDecisionsComparisonAlternatives

Overview

Redis
Redis
Stacks61.9K
Followers46.5K
Votes3.9K
GitHub Stars42
Forks6
Ehcache
Ehcache
Stacks616
Followers160
Votes4
GitHub Stars2.1K
Forks585

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.

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, Ehcache

Dadakhalandar
Dadakhalandar

Sr Solution Specialist at Nokia

Feb 14, 2020

Needs advice

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

11.4k views11.4k
Comments

Detailed Comparison

Redis
Redis
Ehcache
Ehcache

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.

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.

Statistics
GitHub Stars
42
GitHub Stars
2.1K
GitHub Forks
6
GitHub Forks
585
Stacks
61.9K
Stacks
616
Followers
46.5K
Followers
160
Votes
3.9K
Votes
4
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
  • 1
    Container doesn't have to be running for local tests
  • 1
    Way Faster than Redis and Elasticache Redis
  • 1
    Easy setup
  • 1
    Simpler to run in testing environment

What are some alternatives to Redis, Ehcache?

Hazelcast

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.

Aerospike

Aerospike

Aerospike is an open-source, modern database built from the ground up to push the limits of flash storage, processors and networks. It was designed to operate with predictable low latency at high throughput with uncompromising reliability – both high availability and ACID guarantees.

MemSQL

MemSQL

MemSQL converges transactions and analytics for sub-second data processing and reporting. Real-time businesses can build robust applications on a simple and scalable infrastructure that complements and extends existing data pipelines.

Apache Ignite

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

SAP HANA

SAP HANA

It is an application that uses in-memory database technology that allows the processing of massive amounts of real-time data in a short time. The in-memory computing engine allows it to process data stored in RAM as opposed to reading it from a disk.

VoltDB

VoltDB

VoltDB is a fundamental redesign of the RDBMS that provides unparalleled performance and scalability on bare-metal, virtualized and cloud infrastructures. VoltDB is a modern in-memory architecture that supports both SQL + Java with data durability and fault tolerance.

Tarantool

Tarantool

It is designed to give you the flexibility, scalability, and performance that you want, as well as the reliability and manageability that you need in mission-critical applications

Azure Redis Cache

Azure Redis Cache

It perfectly complements Azure database services such as Cosmos DB. It provides a cost-effective solution to scale read and write throughput of your data tier. Store and share database query results, session states, static contents, and more using a common cache-aside pattern.

KeyDB

KeyDB

KeyDB is a fully open source database that aims to make use of all hardware resources. KeyDB makes it possible to breach boundaries often dictated by price and complexity.

LokiJS

LokiJS

LokiJS is a document oriented database written in javascript, published under MIT License. Its purpose is to store javascript objects as documents in a nosql fashion and retrieve them with a similar mechanism. Runs in node (including cordova/phonegap and node-webkit), nativescript and the browser.

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