Ehcache

Ehcache is an open-source, Java-based distributed cache that has dominated the in-process caching space since 2003.

Reviewed by 7wData

On this page

Publisher review

Ehcache is an open-source, Java-based distributed cache that has dominated the in-process caching space since 2003. Maintained by Terracotta (a Software AG company), it offers flexible deployment ranging from single-JVM caching to hybrid in-process and out-of-process configurations that scale to terabyte-sized datasets. The platform implements JSR-107 (JCache) API standard and integrates natively with Hibernate and Spring Cache abstractions, making it a natural choice for Java applications that need low-latency data access without complex external infrastructure.

Ehcache 3.x introduced a modernized generics-based API and improved off-heap storage capabilities; the legacy 2.x line reached end-of-life support in September 2023 but remains available. The core project is freely available under Apache 2.0, though Terracotta sells Enterprise Ehcache with advanced features (Fast Restartability, additional off-heap configuration, clustering enhancements) for organizations requiring commercial support. The distinction matters: newer distributed-cache features are locked to commercial products. Ehcache occupies a middle ground in 2026—it is mature and trusted in enterprise Java shops but faces increasing pressure from lightweight alternatives like Caffeine (local-only, simpler) and specialized distributed options like Redis (cross-language, richer data structures, persistence, observable uptick in adoption for microservices).

Get the AI & data signal, daily.

48k+ subscribers read this every morning. One email, both newsletters. Unsubscribe anytime.

How it works

  1. JSR-107 JCache API compliance

    Full standard Java caching API implementation, enabling portable cache code across implementations without vendor lock-in.

  2. Tiered storage (on-heap, off-heap, disk)

    Configurable memory tiers including off-heap storage up to 6TB per JVM, reducing garbage collection pressure and maximizing cache density.

  3. Distributed clustering via Terracotta

    Scales cache coherence across hundreds of clustered JVM nodes using Terracotta server array, maintaining consistency without application-level coordination.

  4. Hibernate second-level cache integration

    Native provider for Hibernate L2 cache, transparently intercepting entity and query caches without code changes.

  5. Cache loaders, writers, and expiration strategies

    Pluggable read-through, write-through, and write-behind patterns; TTL, idle-time, and custom eviction policies.

  6. Spring Cache Abstraction support

    Full compatibility with Spring's @Cacheable, @CacheEvict annotations for declarative caching in Spring applications.

  7. Off-heap-only and blocking cache variants

    Specialized cache implementations including blocking caches for synchronization and memory-optimized off-heap-only caches for high-volume scenarios.

Strengths and trade-offs

Strengths

  • Proven stability in production Java environments since 2003; trusted by major financial services and e-commerce platforms.
  • Minimal dependencies (only SLF4J required) and small footprint, simplifying deployment and reducing bloat in Java applications.
  • Seamless Hibernate and Spring integration without boilerplate; works as drop-in replacement for many legacy Ehcache 2.x codebases.

Trade-offs

  • Open-source 3.x lacks advanced clustering features now reserved for commercial Enterprise Ehcache, fragmenting the roadmap and creating upgrade friction.
  • Java-only ecosystem limits cross-language development; does not support non-JVM clients, unlike Redis or Memcached, constraining modern polyglot architectures.
  • Lightweight single-node alternatives (Caffeine) increasingly favored for local caching; growth slowed by microservices shift toward external Redis/Memcached for shared cache layers.

Pricing context

Ehcache open-source is free under Apache 2.0 license with no licensing costs, but commercial support and advanced features come through Terracotta's Enterprise Ehcache product. Specific Enterprise pricing is not publicly listed; Terracotta/Software AG typically requires direct contact for quotes, and organizations report that minimum engagement thresholds can be high. The split model creates a decision point: open-source Ehcache remains viable for in-process caching in Java monoliths, but organizations adopting modern distributed caching for microservices or needing commercial SLA often transition to Redis or other solutions rather than paying Enterprise Ehcache premiums.

Alternatives

User reviews

No user reviews yet. Be the first to write one.

Sources

Reporting on this tool draws on these publicly available sources.

  1. www.ehcache.org — Core product definition, features, version information, and Apache 2.0 licensing.
  2. www.ehcache.org — Detailed feature list including off-heap storage, tiered architecture, JSR-107 compliance, and integration capabilities.
  3. github.com — Active repository maintenance, recent commit history as of May 2026, community engagement, and open-source governance.
  4. www.javacodegeeks.com — Competitive landscape analysis, comparison with Caffeine and Hazelcast, trade-offs in 2025–2026.
  5. www.saashub.com — Feature comparison with Redis, including persistence, data structures, scalability, and architectural differences.
  6. hazelcast.com — Market positioning, commercial vs. open-source divide, and why organizations consider alternatives to Enterprise Ehcache.