Analysis updated 2026-06-24
Cache expensive database query results in a Spring Boot service.
Add a size-bounded in-memory cache to a Java REST API.
Replace Google Guava's cache with a near-optimal eviction policy.
Wrap a slow third-party API call with time-based expiration.
| ben-manes/caffeine | tencent/tinker | infinilabs/analysis-ik | |
|---|---|---|---|
| Stars | 17,649 | 17,631 | 17,448 |
| Language | Java | Java | Java |
| Setup difficulty | easy | hard | moderate |
| Complexity | 2/5 | 4/5 | 3/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Java 11+ required for the 3.x line, older JVMs must stay on 2.x.
Caffeine is a Java library that provides high-performance in-memory caching. Caching means storing the results of expensive operations, like database queries or complex calculations, in fast memory so that future requests for the same data can be served immediately instead of recomputing from scratch. Caffeine is designed to be both fast and smart about which items to keep and which to discard when the cache fills up. The library lets you configure a cache with several useful behaviors: you can set a maximum number of items it holds, have entries automatically expire after a set time since they were last written or accessed, have stale entries refreshed in the background without blocking your application, and get notified when an item is removed. Caffeine uses an eviction strategy (deciding what to throw away when full) based on how frequently and how recently items have been used, which research papers show is close to theoretically optimal for real-world workloads. It is built in Java and available through Maven Central (a standard package registry for Java projects). Integration with many popular Java frameworks is available, including Spring, Quarkus, and Micronaut, and it is also used by large infrastructure projects like Kafka, Cassandra, and Apache Solr. You would use Caffeine when you have a Java application that repeatedly fetches or computes the same expensive results and you want to speed it up by keeping those results in memory, with fine-grained control over how long to keep them and what to do when memory runs low.
Caffeine is a Java in-memory caching library with size and time-based eviction, async refresh, and removal notifications. Used by Spring, Kafka, Cassandra.
Mainly Java. The stack also includes Java, Maven, Gradle.
Apache 2.0 lets you use, modify, and ship this in commercial products freely as long as you keep the license notice.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.