vs

Ehcache vs Redis

Ehcache: The standard embedded JVM cache, with heap, off-heap and disk tiers and optional Terracotta clustering. Redis: The in-memory data structure server that became the default cache, now with search, JSON and vectors built in.

key differences

  • Licensing: Ehcache is open source (permissive) (Apache License 2.0); Redis is open source (copyleft) (Tri-license: AGPLv3, RSALv2 or SSPLv1 (Redis 8+)).
  • Redis is built for larger datasets (≤ 10 TB) than Ehcache (≤ 100 GB).
  • Horizontal scaling is addon in Ehcache and native in Redis.
  • Only Redis has transactions, secondary indexes, full-text search, vector search, geospatial.
  • Ehcache can run embedded in your application process.

choose ehcache for

  • +Hibernate second-level cache
  • +Spring @Cacheable method caching
  • +Local caching of reference data in JVM services

best at · Cache, Embedded

choose redis for

  • +Application and database query caching
  • +Session storage and user tokens
  • +Rate limiting and distributed locks
  • +Leaderboards and counters

best at · Cache, Sessions, Queue

overview
Primary model
Key-Value
Key-Value
Also supports
–
Document, Vector, Time-Series, Search Engine
Type
Embedded library
Database engine
Status
Active
Active
Developer
Terracotta (IBM)
Redis Ltd.
First release
2003
2009
Latest version
3.12.0 (Apr 3, 2026)
8.10.3 (Oct 26, 2026)
License
Open source (permissive)Apache License 2.0
Open source (copyleft)Tri-license: AGPLv3, RSALv2 or SSPLv1 (Redis 8+)
Free tier
✓
✓
popularity
WhichDB Score
17.6
84.3
Rank
#188
#2
GitHub stars
2.1K
77.1K
Stack Overflow questions
2.4K
25.4K
scale & guarantees
Comfortable data size
Small (≤ 100 GB)
Medium (≤ 10 TB)
Horizontal scaling
Addon
Native
Multi-region
None
Active active
ACID
Limited
Limited
Consistency
Strong, Eventual
Eventual
Schema
Schemaless
Schemaless
Architecture
Embedded, In memory
In memory, Single node, Primary replica, Distributed, Client server
deployment
Self-hosted
✓
✓
Vendor-managed cloud
—
✓
Serverless
—
—
Embedded
✓
—
Edge
—
—
Clouds
–
AWS, Google Cloud, Azure, DigitalOcean, Heroku, Render
capabilities
Transactions
—
✓
Joins
—
—
Secondary indexes
—
✓
Full-text search
—
✓
Vector search
—
✓
Geospatial
—
✓
JSON
—
✓
Change data capture
—
—
Triggers
—
—
Stored procedures
—
✓
Materialized views
—
—
TTL / expiry
✓
✓
Pub/Sub
—
✓
Columnar storage
—
—
In-memory
✓
✓
Durable persistence
✓
✓
Compression
—
—
Encryption at rest
—
—
Role-based access
—
✓
Time travel
—
—
Branching
—
—
Online schema changes
—
—
Streaming ingest
—
✓
Offline sync
—
—
Runs in WebAssembly
—
—
interfaces
Query languages
Java API
Redis commands (RESP), Lua, Redis Query Engine (FT.*)
Client languages
Java
Python, Java, JavaScript, Go, C#, Rust, Ruby, PHP
Best for
Cache, Embedded
Cache, Sessions, Queue, Pub/Sub

Ehcache vs Redis: FAQ

What is the difference between Ehcache and Redis?

Ehcache: The standard embedded JVM cache, with heap, off-heap and disk tiers and optional Terracotta clustering. Redis: The in-memory data structure server that became the default cache, now with search, JSON and vectors built in. Licensing: Ehcache is open source (permissive) (Apache License 2.0); Redis is open source (copyleft) (Tri-license: AGPLv3, RSALv2 or SSPLv1 (Redis 8+)). Redis is built for larger datasets (≤ 10 TB) than Ehcache (≤ 100 GB). Horizontal scaling is addon in Ehcache and native in Redis.

When should I choose Ehcache over Redis?

Choose Ehcache for hibernate second-level cache, spring @Cacheable method caching and local caching of reference data in JVM services. Choose Redis for application and database query caching; session storage and user tokens; and rate limiting and distributed locks.

Is Ehcache or Redis more popular?

Redis ranks #2 on the WhichDB Score (84.3/100) and Ehcache ranks #188 (17.6/100). Popularity is not fit: check the requirements that matter for your project.

Are Ehcache and Redis open source?

Yes. Ehcache is open source. License: Apache License 2.0. Yes. Redis is open source. License: Tri-license: AGPLv3, RSALv2 or SSPLv1 (Redis 8+).