Consider a typical webapplication which runs on an
application or web server in clustering mode. Let us say we have 3
nodes in the cluster and the application is running on these 3 nodes
and serving all the user requests. There are some property values that
are stored in database and instead of going to database every single
time this application maintains a cache at server side, at node level,
and stores these property values in the cache and serves the values
from the cache.
Now we update on of the property value in the database. How do we
ensure that this updated value gets reflected in cache across all the
Use a caching implementation that supports expiring objects from the cache (e.g ehcache).
If you set your expires to, say 10 mins, then the objects will get expired every 10 mins meaning they get reloaded at least every 10 mins.