Package io.github.oberhoff.distributedcaffeine

This package contains the main classes and interfaces for configuring, constructing and using Distributed Caffeine cache instances.

Distributed Caffeine is a Caffeine-based distributed cache using MongoDB change streams for near real-time synchronization between multiple cache instances, especially across different machines.

Cache instances can be configured and constructed using a builder returned by DistributedCaffeine.newBuilder(MongoCollection). A cache instance can be of type DistributedCache (extends Cache) or of type DistributedLoadingCache (extends LoadingCache).

Attention: To ensure the integrity of distributed synchronization between cache instances, the following minor restrictions apply:

  • Reference-based eviction using Caffeine's weak or soft references for keys or values is not supported. Even for the use of Caffeine (stand-alone), it is advised to use the more predictable size- or time-based eviction instead.