views:

17

answers:

1

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.

A: 

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.

Daniel Dyson