Ehcache vs Infinispan
Ehcache: The standard embedded JVM cache, with heap, off-heap and disk tiers and optional Terracotta clustering. Infinispan: Red Hat's open-source distributed cache and key-value store, embeddable or as a RESP-compatible server.
key differences
- Infinispan is built for larger datasets (≤ 10 TB) than Ehcache (≤ 100 GB).
- Horizontal scaling is addon in Ehcache and native in Infinispan.
- Only Infinispan has transactions, secondary indexes, full-text search, vector search, json.
choose ehcache for
- +Hibernate second-level cache
- +Spring @Cacheable method caching
- +Local caching of reference data in JVM services
best at · Cache, Embedded
choose infinispan for
- +Hibernate second-level and Keycloak session caching
- +Clustered HTTP session storage for Java app servers
- +Distributed cache on OpenShift with operator management
best at · Cache, Sessions, Pub/Sub
Ehcache vs Infinispan: FAQ
What is the difference between Ehcache and Infinispan?
Ehcache: The standard embedded JVM cache, with heap, off-heap and disk tiers and optional Terracotta clustering. Infinispan: Red Hat's open-source distributed cache and key-value store, embeddable or as a RESP-compatible server. Infinispan is built for larger datasets (≤ 10 TB) than Ehcache (≤ 100 GB). Horizontal scaling is addon in Ehcache and native in Infinispan. Only Infinispan has transactions, secondary indexes, full-text search, vector search, json.
When should I choose Ehcache over Infinispan?
Choose Ehcache for hibernate second-level cache, spring @Cacheable method caching and local caching of reference data in JVM services. Choose Infinispan for hibernate second-level and Keycloak session caching; clustered HTTP session storage for Java app servers; and distributed cache on OpenShift with operator management.
Is Ehcache or Infinispan more popular?
Infinispan ranks #93 on the WhichDB Score (28.8/100) and Ehcache ranks #188 (17.6/100). Popularity is not fit: check the requirements that matter for your project.
Are Ehcache and Infinispan open source?
Yes. Ehcache is open source. License: Apache License 2.0. Yes. Infinispan is open source. License: Apache License 2.0.