Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need to refresh internally cached data

 
Terry Schulting
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two applications servers in a cluster. The applications servers load certain data at startup and cache the data internally. I need to be able to refresh that data nightly. I am thinking perhaps Timers, but am wondering if something else would be better or preferrential...
 
Daniel Chemko
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quartz is a good place to start if you want to approach a Timer solution. Its a very powerful framework for timing.

Another solution is the 'screw the first user' technique and just force the update the first time a new user attempts to access the cache the next day. This can be a good solution if you have a good deal of discrete data that isn't linked together.

I'm not really sure if a single JNDI cache instance or one-per-server instance cache would be better, but it may be worth testing both solutions for performance hits on db updates / user read / user writes?.

Lastly, I'd suggest implementing a 'are there really any changes' query to the db source. You can implement this very cheaply with DB triggers and cache last update tables. This helps to avoid rebuilding a cache daily when there aren't really any differences between yesterday/today/infinity.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!