Unfortunately scalability often gets lumped in with my last topic,
performance, but it really is a different problem altogether.
It's actually fairly easy to build a really fast site that
doesn't handle more than a handful of users. Unfortunately
I already talked about one of the biggest scalability
improvements, caching, in my discussion of performance... so I
guess I'll have to find something else to talk about here and
amazingly this is actually not that hard, which just goes to
show how much has changed!
First of all the system has been built with a number of features
to improve performance in multi-processor and clustered
environments. For example session state can now be maintained
in a separate process, on a separate machine, or even in a
database allowing for cross server sessions. This allows you to
relatively easily add more web servers as your traffic grows
even if you hadn't thought about it and planned for it during
development. (If you haven't tried migrating to a web farm
ask anyone who has and they'll tell you that this alone more
than makes up for any headaches you might have upgrading!)
There's also something called web gardens that I don't fully
understand yet, but they're supposed to help make multi-processor
machines scale so they can do more work then single processor
machines. I know it's a rather novel idea, but what the
heck... someone thought they'd try and pull it off and
apparently they have.
So you've been given the tools to build a better web farm, but
what about keeping it running? Well processes are now closely
monitored and managed by the ASP.NET runtime. When one leaks or
deadlocks it's automatically shut down, but wait it gets better.
A new one is started in its place to take over the load before
the original is shut down. The runtime then directs new requests
to the new process and drains requests from the old one and shuts
it down. So not only do runaway processes get curbed without you
having actually to do it, the end user never sees any down time
because a replacement is provided! (Now you can't tell me that
that's not cool.)
Oh... and now just so you don't forget... caching. All that
stuff about caching in the last section, well it applies here
too. If you've got a hundred people coming to your site for the
same information, what better way to increase scalability then
only having to get that information once and being able to reuse
it? That's all I'm gonna say... really... well at least on this
page!