Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding clustering

 
Raj chiru
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi....
I'm new to Hibernate framework, can anybody explain me what is cluster-based caching(SwarmCache is cluster-based caching)?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
raj chiru wrote:Hi....
I'm new to Hibernate framework, can anybody explain me what is cluster-based caching(SwarmCache is cluster-based caching)?


So lets take a cluster of servers. In some scenarios, you can't guarantee that multiple requests form the same user will hit the same server. So you load some data in one server for the user, then the next request from the user, he hits another server. Well guess what, his data is not on that other server. Unless you have clustering where that data is replicated. That is basic clustering replication of data.

Now lets say you cache your data. Meaning one user queries to get a List of countries from the database and you want to cache it, so that other requests by anyone from then on don't have to hit the database. So you cache it. Well if that first request was on one machine, then it is only cached on that machine. So having a cluster based cache, you can have the cache replicated across all servers in your cluster. So that first request on one machine loads the data and it is cached, and the cluster based cache replicates itself to all the other servers. So now if another user requests the same data on another machine, it will return the data that is in the cache on that machine, which got populated not by the database query but the data replication.

Mark
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic