Ehcache vs Ristretto
Ehcache
ehcache.orgRistretto
github.comSide by side
| Figure | Ehcache | Ristretto |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | Yes | — |
| Windows | — | Yes |
| macOS | — | Yes |
| Linux | — | Yes |
| API | Yes | — |
| Self-hosted | Yes | Yes |
| Plans published | 3 | 1 |
| Spec score · Caching Software | 8.5 (#4) | 7.5 (#13) |
| Purpose | Ehcache is an open-source, standards-based Java cache that boosts performance, offloads databases, and simplifies scalability. | Ristretto is a fast, concurrent, memory-bound Go cache library focused on performance and correctness. |
Plans
In their own words
Ehcache
Ehcache is a free, open-source Java caching library for keeping application data, database results, and web pages available to applications. It is designed to improve performance, reduce database work, and support scaling. It can run inside an application or in mixed in-process and out-of-process deployments, including terabyte-sized caches. Ehcache 3 supports off-heap storage, including configurations that rely on it exclusively, and is compatible with the JCache API defined by JSR-107. The project describes Spring Caching and Hibernate integration through javax.cache support. Configuration is available through XML or the Java API, and data can be shared between application instances using Terracotta clustered storage. Ehcache 3.11 also allows caches to share resources. It supports JTA-managed XA transactions, including two-phase commit and crash recovery, but documents Read-Committed as the only supported isolation level and Bitronix 2.1.4 as the only tested transaction manager. Ehcache 3.11 requires Java 8 or later and is the last release line to support Java 8. The license is Apache 2.0.
Ristretto
Ristretto is a free, open-source Go library for an in-process cache of key-value data, designed for concurrent use, performance and correctness. It keeps data in memory in a single process rather than operating as a distributed cache. TinyLFU admission and SampledLFU eviction are paired to target high hit ratios; applications define item cost, allowing a valuable large item to displace several smaller ones. The project attributes throughput to contention management, batching and eventual consistency. Goroutines can use the cache concurrently with little throughput degradation, according to the project, and optional metrics cover throughput, hit ratios and other statistics. A Set for a new item may be dropped in the Set buffer or admission policy, while updates are guaranteed. Ristretto requires Go 1.21 or later and Go modules. Version 2 supports generics, which the project recommends for new programs. The repository is licensed under Apache License, Version 2.0, and describes the library as production-ready. Its README names Badger and Dgraph as projects using it.