Last week, we described several criteria to look at to choose a cache. This week, it’s time to list Java cache providers based on these criteria.
Java Caching System
JCS is a distributed caching system written in Java. It is intended to speed up applications by providing a means to manage cached data of various dynamic natures. Like any caching system, JCS is most useful for high read, low put applications. Latency times drop sharply and bottlenecks move away from the database in an effectively cached system.
Name |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Provider |
The Apache Foundation |
||||||||
Source |
|||||||||
License |
|||||||||
Inception date |
2002 |
||||||||
Last commit |
|||||||||
GitHub stars |
76 |
||||||||
Configuration |
File-based ( |
||||||||
cache.ccf
|
|||||||||
Sample code |
|
||||||||
Local/distributed |
Local and distributed |
||||||||
Non-blocking |
|||||||||
JCache |
|||||||||
Spring Cache |
|||||||||
TTL |
|||||||||
Eviction strategies |
LRU |
||||||||
Miscellaneous |
|
Guava
Guava is a set of core Java libraries from Google that includes new collection types (such as multimap and multiset), immutable collections, a graph library, and utilities for concurrency, I/O, hashing, caching, primitives, strings, and more! It is widely used on most Java projects within Google, and widely used by many other companies as well.
Name |
|||||||
---|---|---|---|---|---|---|---|
Provider |
|||||||
Source |
|||||||
License |
|||||||
Inception date |
2010 |
||||||
Last commit |
|||||||
GitHub stars |
42.6k |
||||||
Configuration |
Programmatic |
||||||
|
|||||||
Sample code |
|
||||||
Local/distributed |
Local |
||||||
Non-blocking |
|||||||
JCache |
|||||||
Spring Cache |
|||||||
TTL |
|||||||
Eviction strategies |
|
||||||
Miscellaneous |
Guava is a single JAR that provides cache among many other capabilities |
||||||
A third-party project provides a JCache adapter |
|||||||
The |
|||||||
The API uses soft and weak references in keys and values |
|||||||
Allows you to attach event handlers when entries are evicted |
Caffeine
Caffeine is a high performance, near optimal caching library. For more details, see our user’s guide and browse the API docs for the latest release.
Name |
|||||||
---|---|---|---|---|---|---|---|
Provider |
Ben Manes |
||||||
Source |
|||||||
License |
|||||||
Inception date |
2014 |
||||||
Last commit |
|||||||
GitHub stars |
10.6k |
||||||
Configuration |
Programmatic |
||||||
|
|||||||
Sample code |
|
||||||
Local/distributed |
Local |
||||||
Non-blocking |
|||||||
|
|||||||
JCache |
|||||||
Spring Cache |
|||||||
TTL |
|||||||
Eviction strategies |
|
||||||
Miscellaneous |
Caffeine is rewrite of Guava, inspired by its API, but with non-blocking principles at its core. |
||||||
|
Ehcache
Ehcache is an open source, standards-based cache that boosts performance, offloads your database, and simplifies scalability. It’s the most widely-used Java-based cache because it’s robust, proven, full-featured, and integrates with other popular libraries and frameworks. Ehcache scales from in-process caching, all the way to mixed in-process/out-of-process deployments with terabyte-sized caches.
Name |
|||||||
---|---|---|---|---|---|---|---|
Provider |
Software AG |
||||||
Source |
|||||||
License |
|||||||
Inception date |
2009 |
||||||
Last commit |
|||||||
GitHub stars |
1.7k |
||||||
Configuration |
Programmatic |
||||||
|
|||||||
Sample code |
|
||||||
Local/distributed |
Local |
||||||
Non-blocking |
|||||||
JCache |
|||||||
Spring Cache |
|||||||
TTL |
|||||||
Eviction strategies |
|
||||||
Miscellaneous |
Ehcache 3.x is a complete rewrite from Ehache 2.x |
||||||
Terracota is the Enterprise version of Ehcache. It provides distributed capabilities. |
Infinispan
Infinispan is an open-source in-memory data grid that offers flexible deployment options and robust capabilities for storing, managing, and processing data. Infinispan provides a key/value data store that can hold all types of data, from Java objects to plain text. Infinispan distributes your data across elastically scalable clusters to guarantee high availability and fault tolerance, whether you use Infinispan as a volatile cache or a persistent data store.
Name |
|||||||
---|---|---|---|---|---|---|---|
Provider |
RedHat |
||||||
Source |
|||||||
License |
|||||||
Inception date |
2009 |
||||||
Last commit |
|||||||
GitHub stars |
910 |
||||||
Configuration |
Programmatic |
||||||
|
|||||||
Sample code |
|
||||||
Local/distributed |
Local and distributed |
||||||
Non-blocking |
|||||||
|
|||||||
JCache |
|||||||
Spring Cache |
|||||||
TTL |
|||||||
Eviction strategies |
LFU |
||||||
Miscellaneous |
Infinispan is the successor of JBoss Cache |
||||||
|
Coherence Community Edition
Coherence is scalable, fault-tolerant, cloud-ready, distributed platform for building grid-based applications and reliably storing data. The product is used at scale, for both compute and raw storage, in a vast array of industries such as critical financial trading systems, high performance telecommunication products, and eCommerce applications.
Name |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Provider |
Oracle |
||||||||
Source |
|||||||||
License |
|||||||||
Inception date |
2001 |
||||||||
Last commit |
|||||||||
GitHub stars |
340 |
||||||||
Configuration |
File-based |
||||||||
coherence-cache-config.xml
|
|||||||||
Sample code |
|
||||||||
Local/distributed |
Local and distributed |
||||||||
Non-blocking |
|||||||||
|
|||||||||
JCache |
|||||||||
Spring Cache |
|||||||||
TTL |
|||||||||
Eviction strategies |
|
||||||||
Miscellaneous |
Oracle bought Coherence from Tangsol in 2007 |
||||||||
Commercial versions are available:
|
|||||||||
|
Ignite
Distributed Database For High-Performance Computing With In-Memory Speed
Name |
|||||||
---|---|---|---|---|---|---|---|
Provider |
GridGain |
||||||
Source |
|||||||
License |
|||||||
Inception date |
? |
||||||
Open-Sourced |
2014 |
||||||
Last commit |
|||||||
GitHub stars |
4k |
||||||
Configuration |
Programmatic |
||||||
|
|||||||
Code sample |
|
||||||
Non-blocking |
|||||||
|
|||||||
JCache |
|||||||
Spring Cache |
(provided by Ignite) |
||||||
TTL |
|||||||
Eviction strategies |
|
||||||
Miscellaneous |
|
||||||
GridGrain offers an enterprise version of Ignite named GridGain In-Memory Computing Platform |
Geode
Apache Geode is a data management platform that provides real-time, consistent access to data-intensive applications throughout widely distributed cloud architectures.
Apache Geode pools memory, CPU, network resources, and optionally local disk across multiple processes to manage application objects and behavior. It uses dynamic replication and data partitioning techniques to implement high availability, improved performance, scalability, and fault tolerance. In addition to being a distributed data container, Apache Geode is an in-memory data management system that provides reliable asynchronous event notifications and guaranteed message delivery.
Name |
|||||||
---|---|---|---|---|---|---|---|
Provider |
Pivotal |
||||||
Source |
|||||||
License |
|||||||
Inception date |
2015 |
||||||
Open-Sourced |
2019 |
||||||
Last commit |
|||||||
GitHub stars |
2k |
||||||
Configuration |
File-based and programmatic |
||||||
|
|||||||
Code sample |
|
||||||
Non-blocking |
|||||||
JCache |
|||||||
Spring Cache |
|||||||
TTL |
|||||||
Eviction strategies |
LRU |
||||||
Miscellaneous |
GemStone is the company that initially developed Geode. In 2010, SpringSource acquired GemStone. |
||||||
|
Hazelcast
Disclaimer
I work for Hazelcast at the time of this writing. |
Hazelcast is a streaming and memory-first application platform for fast, stateful, data-intensive workloads on-premises, at the edge or as a fully managed cloud service.
Name |
|||||||
---|---|---|---|---|---|---|---|
Provider |
Hazelcast |
||||||
Source |
|||||||
License |
|||||||
Inception date |
2008 |
||||||
Last commit |
|||||||
GitHub stars |
4.6k |
||||||
Configuration |
File-based and programmatic |
||||||
|
|||||||
Code sample |
|
||||||
Non-blocking |
|||||||
|
|||||||
JCache |
|||||||
Spring Cache |
|||||||
TTL |
|||||||
Eviction strategies |
|
||||||
Miscellaneous |
Hazelcast provides an Enterprise edition with additional features |
||||||
|
For reference, the following Maven project shows a simple key get-put for each cache.
I tried my best to provide accurate, objective information. Please let me know in the comments if something is wrong. |