*
The moose likes Distributed Java and the fly likes clustering web servers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "clustering web servers" Watch "clustering web servers" New topic
Author

clustering web servers

Billy Vandory
Ranch Hand

Joined: Mar 23, 2010
Posts: 57
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

Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

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.


apigee, a better way to API!
 
wood burning stoves
 
subject: clustering web servers
 
Similar Threads
Design issue: caching hierarchical tree of data, read-mostly
Distributed Caching
Transactional Non-Replicated Database Cache
Caching Data
Image is not reloading on JSP page refresh