When Written: June 2010
At the other end of web site development I was following the recent TechEd conference and whilst most of it was about Microsoft’s commitment to Cloud computing which I as one who prefers to have full control of one’s own servers I have yet to be convinced of the business validity of trusting line of business to Cloud computing.
Almost as an aside Microsoft also announced released to Manufacturing of AppFabric. AppFabric, like a lot of similar Microsoft technologies had a very low key announcement but for anyone building large scale enterprise web applications your life might have got and awful lot easier. So what does AppFabric do? With any busy web application the problems of scalability can be an issue, so that after optimising your code the next option is to put it on a bigger and more powerful server. The next step is either a server farm, caching, or both; I mentioned in the last article how Farmville on Facebook, which is possibly the largest web application, uses caching of data to reduce the call-backs to Facebook.
Good luck to you if your web application becomes as popular as Farmville but, even before it attracts that level of users and transactions, problems of performance can arise. Should the solution of simply putting it on a bigger more powerful server prove not to be sufficient then the normally the next step is to balance the load across several servers in a server farm. This can be where things get tricky and tracking session state across a server farm can require code rewrites. What AppFabric does is provide a simple caching technology across a farm of servers enabling a web application to be scaled almost infinitely with no change to the code.
This will work not only where data is simply being read from a data source but it will also handle the more complex scenario where the users are updating a database. So instead of making repeated calls to a database to get the data, AppFabric will, in the background, cache a copy of this data so subsequent requests will not require the database to do any work.
What about when the request is an update of this data? You will need a mechanism to make sure that the relevant data is locked so that more than one request doesn’t try to update a single record and so AppFabric offers both ‘optimistic’ and ‘pessimistic’ concurrency control. The key thing about AppFabric’s form of caching is that it requires no change to your existing asp .net code, session state is maintained across the entire server farm without any of the previous ‘hacks’ of dumping it in a separate data store. AppFabric is a free download and works on server 2008 or server 2010 only. If this ‘floats your boat’ then you can read more about how it all goes together at http://www.appinfrastructure.com.
Article by: Mark Newton
Published in: Mark Newton