Can we put instances of System.Activities.Activity class (WF 4.0) into the Windows Azure Cache? We would like to compile our workflows from XAML, but this is an expensive operation to repeat. Would Windows Azure Cache support the caching of System.Activities.Activity (is that class serializable)?
I don't think you will be able to use Azure cache for this. You could just use a static in-memory cache though. See http://www.neovolve.com/post/2010/07/23/Caching-workflow-activities-to-increase-performance.aspx
Related
We have an environment with a vendor deployed application to several front ends on it. It makes heavy use of the ASP .Net storage (Session, Application, and Cache). Problem is with the load this environment quickly brings IIS to it's knees with the amount of data it's trying to keep in memory.
The solution we are trying to go with is to override the storage mechanism and implement our own. (Specifically a Redis server to manage the storage)
We have implemented their cache interface and set up Microsoft.Web.Redis.RedisSessionStateProvider in the web.config to manage the session. That part all works fine. The problem is that the caching inside the vendor application does not always use their provided interface. Decompiling the dll and examining dump files show that there are several instances of them directly calling (for example):
HttpContext.Current.Cache.Insert(...) and HttpContext.Current.Application[...] = ...
Is there any way we can override the HTTPContext* calls so that they'll use Redis to cache instead of the Asp .Net application storage?
When it is a "3rd" party which uses HttpContext.Current you probably have no chance to change that behavior.
Is this other application running within your context (do you control the app domain). Or is it a standalone application?
I once tried to change HttpContext.Current.Cache for unit testing and ended up mocking the whole HttpContext because it was so very internal somewhere in the Microsoft stack.
All this is pretty hard to do, not really recommended and can lead to all kinds of other errors.
In short, don't use HttpContext.Current.Cache. Use something you can inject.
In general, libraries should never use that static context.
It is much more flexible to have abstractions + DI for those kind of things...
For caching, you could use CacheManager for example.
I have a legacy application that is extensively using HttpContext.Cache...
This application is now suppose to move to Windows Azure (multi-role).
It will of course cause problems with cache going out of sync on different roles.
I was thinking about injecting (I'm using Autofac) my "AzureCacheWrapper" (wrapper on Microsoft.ApplicationServer.Caching.DataCache) into HttpContext.Cache so legacy application continues working but uses Azure cache instead?
Normally we should implement something like ICacheProvider but unfortunately there are some 3rd party DLLs that are using cache that we don't have access to (and don't know when 3rd party library is using Http cache)
I don't think cache provider can be configured through web.config (like OutputCaching) so the only solution seems to me to somehow inject my implementation into Add/Insert/Get methods on Runtime Cache.
Unfortunately because of .NET implementation of System.Web.Caching.Cache (sealed class) I don't think I can override HttpContextBase to return different cache or inject into System.Web.Caching.Cache itself...
Thanks for any help! :)
I think your application needs code/architectural change...
If you had your own class which handles getting and setting the cache, Which may easier now to change your code/architecture in one place.
If you are going to use Single role then no problem exist in your scinario. If possible you can run your webrole in ExtraLarge slot.
We have a webform app that is ready for production. We found that SQL and Azure training kit's session state providers are not recommended for production code on Azure. We had no luck with TableStorageSessionProvider so far. Unfortunately, our client is not willing to pay for AppFabric Cache. Unless I'm misinformed I see no way to use AppFabric.
We do not use the session ourselves (removed all references to it), would you recommend disabling it or simply using the default provider?
Best regards,
Max
if you have no need for session, then it would be best to disable it. Default provider for session state is in memory of a single IIS server and you will likely have 2+ deployed in production. First it takes resources to keep it around, second it leaves an opening for someone in the future to accidentally use it during development w/o realizing overall implications.
HTH
Azure instances are not like any other IIS servers. In memory session data is NOT shared across multiple instances.
If you do not need session state, disable it. If you do, I would recommend checking out AppFabric Cache. We use the AppFabric Session state provider and it works great. If you're interested, this link will help get you started...
http://appfabricdemos.codeplex.com/releases/view/65427
I plan to deploy my Flex Application on the web using MS Azure. Has anyone done this?
If yes, can you please provide pointers, reference links etc?
Regards
Aparna
As far as Azure is concerned, your swfs are just resources so your'e basically looking at a regular though pimped ISP. The interesting possibility is connecting it to Azure backend, possibly with SQL Azure.
As far as I can see. FluorineFX should work there as well.
If it's only the static content, html/swf/... then I suggest you use blob storage to put them in instead of using compute power of several instances as these are not needed. This will cut down on your costs as blob storage is publicly accessible but is very cheap.
If your Flex application needs integration with services then you need to host them in a compute environment like an instance.
I have a situation where information about a user is stored in the web application cache and when that information is updated in one application - I want to notify the other applications (running on the same machine) that the data should be removed from it's cache so it can be refreshed. Basically I need to keep cached data in sync across multiple asp.net applications.
I have started down the path of using a central web service to help coordinate the notifcations but it is turning out to be more complex than I think it needs to be.
Is there a way that one asp.net application can easily reach across to another on the same box to clear an item from the cache?
Is there a better way to achieve shared cached information than using the application cache?
I really want to create a way for apps to communicate in a loosely coupled way - I looked at nservice bus but the dependency on MSMQ scared me away - my client has had bad experiences with MSMQ and does not want to support an app that requires it.
Suggestions?
Michael
I agree with Hogan. Best is to use a shared database. I want to add to that that, when using SQL Server, you can use SQL Cache Dependency. This SQL Server mechanism allows notifications to applications in such a way that used caches can be invalided directly after a change is made to the data.
A shared database is probably going to cause you the least pain.
Edit
Note: ASP.NET allows you to make "cache clearing" triggers on SQL server changes. Should be a quick search in the cache examples on MSDN to find some examples. Thus when the user info stored in the cache changes in the DB the local cache copy will clear and be re-loaded from the DB.
There are commercial distributed caches available for .net other than Microsoft Velocity - NCache, Coherence, etc.
How about Velocity? It's a distributed cache that works between servers as well as between applications. It has PowerShell management and all sorts of documentation to get you going faster and be far more maintainable in the long-term.
What about COM/DCOM, using namespace System.Runtime.Remoting