Skip to content
SPECIFICTION
Get listed

cache2k vs Infinispan

cache2k

cache2k.org

Infinispan

infinispan.org

Side by side

Figurecache2kInfinispan
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
LinuxYesYes
AndroidYes—
APIYesYes
Self-hostedYesYes
Plans published11
Spec score · Caching Software8.1 (#6)7.6 (#12)
IntegrationsThe site lists Spring Framework, Scala Cache, DataNucleus through JCache, and Hibernate through JCache integrations.The features page lists native integrations with Spring AI, LangChain4j, LangChain, and Quarkus LangChain4j.
LicenseThe project says its code is released under the Apache license.Infinispan is released under the Apache 2.0 open-source license.

Plans

cache2k

  • cache2kFree

cache2k pricing →

Infinispan

  • Community EditionFree

Infinispan pricing →

In their own words

cache2k

cache2k is an Apache-licensed, open-source library that keeps Java application objects in memory. Its project describes a JAR smaller than 400 KB with no external dependencies, and the implementation is written in pure Java without sun.misc.Unsafe. Cache behavior includes automatic expiry, refresh, refresh ahead, read-through loading, and event listeners. Cache loaders can suppress exceptions or retry them according to configuration. Integrations listed include Spring Framework, Scala Cache, DataNucleus through JCache, and Hibernate through JCache. cache2k supports JCache / JSR 107, while its guide notes extra overhead for that API compared with the native interface. Monitoring options include low-overhead statistics, JMX, and documented Micrometer metrics. Version 2 requires Java 8 or later and is described as compatible with Android API level 26. The library is free, available from Maven Central, self-hosted, and does not persist data.

Visit cache2k.org

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.

Visit infinispan.org