views:

569

answers:

2

I have a service based architecture where a web farm full of asp clients hit application server farm of WCF services. Obviously all the database access is done by the WCF services. Now I would like to cache my frequently used database retrieved objects using Velocity at the service tier level. I am considering to make each physical application server also part of the cache cluster.

According to Velocity documentation, if I use regions, objects are stored only at a single host. I actually wouldn't have any problem if each host kept it's own cache provided that I could somehow synchronize them.

So my questions are

  1. If I create one region on one host is it also created on another one?
  2. When I clear a cache region, is it cleared on one host only?
  3. If I subscribe to a region level notification on all the hosts, can I catch events of one host on another one?
  4. In this scenario should I use regions at all or stay away from them?

I hope my questions are clear. Actually I am more interested in a solution to my problem than answers to my questions

+1  A: 

Yes you are right in reading the doc that the region will exists only in one host.

" I actually wouldn't have any problem if each host kept it's own cache provided that I could somehow synchronize them."

When you say synchronize, you mean when HA in enabled ? Velocity would actually take care of that if thats what you meant.

For the questions: 1. No. 2. Yes 3. Notifications will be sent to the client. So i am not sure if there is anyway to send notifications to other host. 4. Regions gives Search capabilities and takes away HA from you. In your case, you could use the advantages of HA.

sanjay
A: 

Having regions not necessarily means that you don't have HA. if your create your own cache (and don't use the 'default' one) you can create it with Secondarys = 1 (HA on) now let’s say you have 4 cache hosts; when you define a region , it will have both primary and secondary hosts. so each action on the region will result it being applied in both.

Shany

shanyp