Search code examples
cachingehcachegoogle-guava-cache

Difference between different type of caches and their significance


What is the difference between the Ehcache and Guava Cache? In which scenarios would I use which type of caching?


Solution

  • Note: I am a developer working on Ehcache

    The answer to your question depends on which features your cache needs to have inside your application.

    • Guava caches have all the basic caching features.
    • Ehcache has more advanced features - see 2.x line or upcoming 3.x line
      • Multi tier caching (disk in 2.x, offheap + disk in 3.x)
      • Clustering (2.x for now, soon in 3.x)
      • Refresh ahead or scheduled refresh (2.x for now)
      • JSR-107 API

    So my advice is to look at your needs, play with both and then decide.