开发者

Potential problems with using ASP.NET App cache on mirror?

I've 2 servers mirror with a load balancer. I'd like to know the pros and cons of sticking with app cache versus going with something like memcache? I'm very interested in various solutions and especially the types of errors that I could get or limitations by not synchronizing them.

开发者_开发问答

To start the discussion, I'd hazard that using ASP.NET cache would be faster and simpler.


You are best advised to abstract the caching into an interface, implement the interface in a number of ways and Test the different implementations.

As in many cases, it is a matter of looking at the data and how much it is shared between different users.

ASP.NET cache would not necessarily be faster or simpler. It depends on how much you are caching and whether the webservers have the resources to handle it. In most reasonable size apps, the answer to that is often No.

The main downside to not synchronizing between cache servers would be that in a load balanced environment, subsequent requests for the same data might go to different servers. This would just mean that the database gets hit twice some of the time. A way to mitigate this is to implement sticky sessions, where a given user is always sent to the same server and the load balancer only makes a balancing decision at the start of a user session.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜