Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a free Java caching library that provides statistics and preserves state on restart?
    primarykey
    data
    text
    <p><em>[Edited] I am re-re-writing my question, hoping to be this time following the rules good questions and asking about a "narrowed enough" topic. I keep the information I initially provided, in case any reader is interested in details.</em></p> <hr> <p><em><strong>My question:</em></strong></p> <p>I have been investigating free Java caching libraries and I found that all of them provide more or less the same features. But there are 2 tools that stand out over the rest, because they provide a distinctive feature:</p> <ul> <li>EHCache: Provides statistics for the cached elements. At any point you can get the metadata of each element, having access to details, such as the hit count - the number of times the entry was requested while it was in the cache.</li> <li>Infinispan: Provides a persistence-based mechanism to preserve cached data. This allows applications to not lose the cached elements on restart. Several persistence methods are supported, like database and filesystem.</li> </ul> <p>I am wondering if there is another library that combines these 2 great features. Does anyone know about one?</p> <p>Thank you.</p> <hr> <p><em><strong>My original post:</em></strong></p> <p>I am working on a component that <em>provides access to a reporting layer</em>. Reports are generated <strong>on demand</strong>, but when a given report has been run the result (a Java object) <strong>can be cached</strong> and served again later if the same report is requested, without going again to the reporting engine.</p> <p>I need to limit to "<strong>X</strong>" (configurable) the number of cached items. When the cache size has reached "<strong>X</strong>" elements and a new (not cached) report is requested I need to remove the "<strong>least-frequently-used</strong>" entry (LFU).</p> <p>My component is notified when the reporting data changes in the data warehouse. In that case I need to:</p> <ul> <li>Figure out which ones are the "<strong>Y</strong>" "<strong>most-frequently-used</strong>" reports (being <strong>Y &lt; X</strong>).</li> <li>Invalidate the cache.</li> <li>Re-generate those reports through the reporting engine.</li> <li>Re-cache them.</li> </ul> <p>These are all operations typically provided by most of the caching tools/libraries.</p> <p>An additional requirement for me is that the cached reports <strong>must survive JVM restarts</strong>. This is, I cannot lose the information of which ones were the cached entries and I cannot re-generate them every time my application is restarted - because it would be too much load on the reporting engine.</p> <p><strong>My problem:</strong> I <em>cannot find</em> a <strong>free</strong> library that covers all my needs. In summary, these would be the required features:</p> <ul> <li>Free / commercial-friendly license.</li> <li>Persistent storage, saving state on JVM/server restart/crash.</li> <li>Java API, providing element statistics. I need to be able to "select the top X elements in cache" - using the eviction algorithm ranking as ordering.</li> <li>Easy to integrate with an application running on Tomcat.</li> </ul> <p>The closest option I found is EHCache. It exposes the hit count for each element - but not the "real" ranking used by the eviction algorithm. Besides, persistent restartable mechanism is available only for a non-free version - BigMemory, from Terracotta.</p> <p>Other alternative I have seen is Infinispan, but it does not expose entry-level statistics - only cache-level statistics - and requires JMX.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload