• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

clustering web servers

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry if this question is in the wrong forum. In my web application I have a page which shows categories and sub-categories. These categories are stored on the database and rarely change, so it makes sense to cache them instead of hitting the database every time they need to be displayed in a web page.

If I cache the categories, and there is a change to the categories (via an admin), then the cache needs to be updated.

I don't understand if I am caching the resultset how this cache could be updated in general, and more importantly, in a cluster.

Could someone shed some light? I read about tomcat clustering and some caching tools, but I can't see the high level design. Would each web server have a cache? How would they syncronize? Do I have to write this cache and syncronization using some servlet listenener?

Thanks,

Billy

 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Billy Vandory wrote: read about tomcat clustering and some caching tools.



Which caching solutions did you look at? Did you see ehcache?

Billy Vandory wrote: Would each web server have a cache?



Depends whether you want an in-process cache (like ehcache) or out of process data store (like Voldemort)

Billy Vandory wrote: How would they syncronize?



A distributed cache like ehcache comes with an inherent synchronization mechanism, you do not have to write code for that.

Billy Vandory wrote: Do I have to write this cache and syncronization using some servlet listenener?



If you use the standard libraries, you just have to write the code to put and get from the cache.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic