views:

324

answers:

3

I am looking into caching solutions, for a multi webserver configuration. Thought of memcached as being cheap (free) and proven over the years. Microsoft is also developing a caching solution for webfarms, called Velocity, but this is still in CTP2.

+2  A: 

There is a distributed caching model used in the configuration service that is part of the .NET Stocktrader sample application. This is a framework that allows you to run multiple nodes with centralised configuration management, load balancing and distributed caching. You can implement the configuration service as is or look through the code and grab what suits you. Worth a look.

Rob West
I've just downloaded the sample app, will look at it.
Gidon
A: 

When I listened to Scott Hanselman's podcast interview with the StackOverflow team, I was left with the impressions that a. they did use some kind of caching and b. they knew almost nothing about what they were doing in this respect and had fiddled with a few options and then written a blog post or two.

They currently seem to use client-side caching rather half-heartedly (short expiry times on images, for example), and I think they use a lot of ASP.NET user-mode caching, and I can't tell if they use IIS kernel-mode caching. (They didn't seem to be able to tell Scott that, either.)

However, the podcast was a while back, and I was driving at the time, so my memory might be wrong and/or out of date.

Will Dean
Standard user-mode caching is not distributed, is it? Since they have two webservers, it means that this is not an optimal solution.
Gidon
A: 

You should think HARD before bringing in something like memcached.

  • Caching can hide performance issues from you ("got a slow running query? just cache it and dont worry about fixing it!")
  • Invalidating stale data out is a nightmare.
  • You may spend days chasing bugs that get cleared up when you clear the cache, and it pollutes your code base.

I'm not saying don't do it, but think HARD before you do.

If you can get enough performance by adding a couple* of extra machines (which I think stackoverflow can) then do that and don't worry about caching. It'll be much cheaper in the long run.

*note I don't say 100 machines.

mcintyre321