Search code examples
ehcache

Evaluation of ehcache in web application


Is it a good practice to store your data in ehcache to improve the performance of a web application when lots of update operation on data regularly?


Solution

  • It all depends on how much reads you have over writes. Your updates will be costlier. So the time gain by reading should offset that.

    Ehcache handles concurrent access. However, it is atomic, not transactional. So if you are getting multiple values from different caches, you can get updates in-between. But that's the same for a database. Also, you can use XA to make sure your writes are in sync with the database.