English 中文(简体)
Cache Regions in Velocity/AppFabric using WCF
原标题:

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

最佳回答

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.

问题回答

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

Named caches distribute across participating nodes. Named regions live on a single node. Regions can be HA, but they cannot take full advantage of distributed cache scaling, as their object load does not distribute across participating nodes in the cluster. Also, using named caches with HA requires three nodes minimum, rather than two nodes if you used the "default" cache only.





相关问题
Write-though caching of large data sets in WCF?

We ve got a smart client that talks to a SQL Server database via WCF, displaying the entities in the database, and allowing the user to edit those entities. Some of the WCF calls return a large data ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

how to tell clicking "back" to load cache?

I would like for my site when someone clicks "Back" or "Forward" for the server to tell the browser to load the cache instead of reloading the entire page. I ve tested some headers and done research, ...

java plugin cache and dynamic IP host

I m trying to use Amazon S3 and Amazon Cloudfront CDN to deliver the jar files of my applet application. I m seeing several cache misses of my jars by the java plugin. This is a show-stopper for me, ...

Frequently Used metadata Hashmap

Are there any implementations of a static size hashtable that limits the entries to either the most recently or most frequently used metadata? I would prefer not to keep track of this information ...

PHP - Memcache - HTML Caching

I would like to create a caching system that will bypass some mechanisms in order to improve the performance. I have some examples: 1-) I have a dynamic PHP page that is updated every hour. The page ...

Performance of Sql subqueriesfunctions

I am currently working on a particularly complex use-case. Simplifying below :) First, a client record has a many-to-one relationship with a collection of services, that is, a single client may have ...

热门标签