Introduction to JCache JSR 107

Caching libraries such as Ehcache, Hazelcast, Infinispan, GridGain, Apache Ignite in the Java ecosystem are common and indeed is needed in many different kinds of solutions to optimize the application in various ways. The simplest libraries are just in-memory object maps with simple evict rules, while the most advanced caching libraries have efficient cross-JVM features and configurable options to write the cache state to disk, and a good basis for memory heavy computation.

What is JCache

JCache is JSR 107 specification.

JCache is the Java standard API for caching on the Java platform.

JCache provides an API for applications to be able to create and work with in-memory cache of objects.

JCache provides a very simple to use, but yet very powerful API for data access.

JCache allows vendors enough freedom in their own implementations.

Benefits of JCache

In-Memory Key Value Store

Basic Cache Operations

ConcurrentMap APIs

Collocated Processing (EntryProcessor)

Events and Metrics

Pluggable Persistence

JCache components

The specification itself defines high level components (interfaces) and some of them are listed below:

Caching Provider – used to control Caching Managers and can deal with several of them