Frage

We have a website in Azure and we want to cache the content on the website. The app that will update the content will be outside Azure. We got this scenario working with Shared Cache. Shared caching however is considered a legacy feature and so we wanted to take a look at alternate solutions including using in-role caching. The cached content is very small should not exceed 1 MB and will be consumed by C# code.

We could use co-located cache within the web roles or dedicated cache using a worker role.

The questions we had using in-role cache are:

  • How can the co-located cache be updated from an external app?

  • If there was a way to update co-located cache from an external app, cache notifications could be used to invalidated all co-located cache nodes, correct?

  • We use extra-small web role instances now - do we need to upgrade to small/medium instances?

  • Is dedicated caching better for our scenario?

    Thanks in advance.

War es hilfreich?

Lösung

After doing a bunch of research and guided by Simon's responses in the SO thread he already mentioned, here are my responses:

  • Q: How can the co-located cache be updated from an external app?
  • A: I would expose a public endpoint on your Webrole that would clear cache. And I would call that endpoint from your external apps (this endpoint can be a service, rest URL, etc). Alternatively, throw a message onto a queue and have your Webroles monitor that queue and clear the item from cache when they receive a message in the queue. Either way, you're implementing your own notification mechanism

  • Q: If there was a way to update co-located cache from an external app, cache notifications could be used to invalidated all co-located cache nodes, correct?

  • A: I don't believe so. The endpoints to co-located cache are strictly internal.

  • Q: We use extra-small web role instances now - do we need to upgrade to small/medium instances?

  • A: Yes. I believe colocated cache is supported at Small instance and higher. You will need to try this out to see how much ram you get vs. how much is left over and whether or not that is of any use to your main application

  • Q: Is dedicated caching better for our scenario?

  • A: Dedicated vs. colocated cache is really about the load. Do you have enough load on your cache and on your app servers to justify moving the cache out into a separate Role? Check out this article for Microsoft's recommendation: http://msdn.microsoft.com/en-us/library/windowsazure/hh914129.aspx
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top