Question

Looking into Azure Caching I came across this article which states

When Co-located Role caching is specified, the cache size is determined by taking the specified percentage of the virtual machine memory. When Dedicated Role caching is specified, all of the available memory of the virtual machine is used for caching. If two role instances are configured, the combined memory of the virtual machines is used.

but, is the co-located cache instance specific (can be accessed, read-write, only by the instance on which it's running) or role specific (can be accessed, read-write, by any instance in the role)?

I could not find a clear answer to this... I did found out that if you want to have two or more roles accessing the same cache, this "cache" has to be a dedicated role itself...

EDIT 1
Example Scenario: 3 instances (i1, i2 and i3) of a single role using co-located cache, each one with lets say 100mb cache. If i1 write to the cache, so, can i2 read it? Can i3 change the cached info?

Was it helpful?

Solution

Co-located Cache is available to any instances in the deployment. It just means that the instance runs the Cache on the same host as the web/worker roles. You just need to know the Role Name to access the cache.

The difference between Dedicated and Co-located is the memory available for Caching and Processing Power available to keep the cache maintained. It is cheaper to use co-located, but dedicated would be a step up in performance (and potentially cost) since its only job is to manage the cache. There is also flexibility if you use a dedicated cache role since you can use larger VM size for your worker/web role, but a smaller VM size for your cache role (or vice versa depending on your needs).

When you configure your cache, you just need to know which role is hosting the cache cluster - more specifically the role name.

<dataCacheClients>
  <dataCacheClient name="default">
    <autoDiscover isEnabled="true" identifier="[cache cluster role name]" />
  </dataCacheClient>
</dataCacheClients>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top