Ehcache vs Infinispan
Ehcache
ehcache.orgInfinispan
infinispan.orgSide by side
| Figure | Ehcache | Infinispan |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | Yes | — |
| Linux | — | Yes |
| API | Yes | Yes |
| Self-hosted | Yes | Yes |
| Plans published | 3 | 1 |
| Spec score · Caching Software | 8.5 (#4) | 7.6 (#12) |
| Transactions | Ehcache supports caches within JTA-managed XA transactions, including two-phase commit and crash recovery. | Infinispan supports distributed transactions with optimistic or pessimistic locking, configurable isolation levels, and XA recovery. |
Plans
In their own words
Ehcache
Ehcache is a free, open-source Java caching library for keeping application data, database results, and web pages available to applications. It is designed to improve performance, reduce database work, and support scaling. It can run inside an application or in mixed in-process and out-of-process deployments, including terabyte-sized caches. Ehcache 3 supports off-heap storage, including configurations that rely on it exclusively, and is compatible with the JCache API defined by JSR-107. The project describes Spring Caching and Hibernate integration through javax.cache support. Configuration is available through XML or the Java API, and data can be shared between application instances using Terracotta clustered storage. Ehcache 3.11 also allows caches to share resources. It supports JTA-managed XA transactions, including two-phase commit and crash recovery, but documents Read-Committed as the only supported isolation level and Bitronix 2.1.4 as the only tested transaction manager. Ehcache 3.11 requires Java 8 or later and is the last release line to support Java 8. The license is Apache 2.0.
Infinispan
Infinispan is a free, open-source distributed in-memory database that combines caching with full-text and vector search. Its search capabilities include distributed vector indexes, kNN similarity queries, semantic search, retrieval-augmented generation, and semantic caching. Applications can connect through Hot Rod, REST, Redis, or Memcached, with listed client libraries for Java, Go, JavaScript, C++, .NET, and Python. It can run as an embedded library, standalone server, or container image. Deployment options include a Kubernetes Operator and container images on OpenShift, AWS EC2, Azure, and GCP. Listed cache stores include filesystem, JDBC, SQL, RocksDB, and remote Infinispan clusters. Security features include role- and permission-based access control, security realms, and encryption for inter-cluster traffic and remote endpoints. It supports distributed transactions with optimistic or pessimistic locking, configurable isolation levels, and XA recovery. Native integrations listed include Spring AI, LangChain4j, LangChain, and Quarkus LangChain4j. Infinispan is released under the Apache 2.0 license. Its support policy covers only the latest minor release of a major version, with full, limited, and limited-client support distinctions.