Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 nodes?

share|improve this question

migrated from webapps.stackexchange.com Jun 3 '11 at 11:34

This question came from our site for power users of web applications.

2 ways to do it I think. Either the cache become at the cluster level or you have to broadcast the invalidation of an entry to each server.

I would say there is a 3rd way which could be a centralized database where each invalid key is kept and the server check that database to ensure the key is still valid (but it's a little bit more complex to implement)

So cache level at the cluster is certainly the easiest but it really depends on why you have the cache server in place (if it's just a replication of the main database then this solution is not valid).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.