June 5th, 2008

Give Your ASP.NET Applications Velocity

Scaling ASP.NET Application just got easier with a new technology that Microsoft has just released that they have dubbed codename “Velocity”. This product is still in the early stages of development, but it is meant as a direct competitor against memcached. If you are not familiar with memcached, here is how it is described in Wikipedia:

memcached (pronunciation: mem-cache-dee) is a general-purpose distributed memory caching system that was originally developed by Danga Interactive for LiveJournal, but is now used by many other sites. It is often used to speed up dynamic database-driven websites by caching data and objects in memory to reduce the number of times the database must be read. Memcached is distributed under a permissive free software license.

So basically it allows you to create a distributed memory cache across your server farm, that allows any computer in the server farm to access the data in the cache. So there is no more issues with storing session data on server farms, or worrying about setting up common SQL stores of temporary data. This is also very practical for reducing database stress on Web 2.0 sites, many of the top Web 2.0 sites use this to reduce reads on the database.   The biggest user of memcached to date is Facebook.  This diagram below gives a basic idea of how distributed caching works.

Diagram of Velocity

There have been many Open Source projects for getting memcached working on C#, and most have been pretty successful, but because memcached was designed for the UNIX environment, porting memcached to a Windows Service has always lagged behind the actual releases of the required libraries to get memcached working. Enter Velocity, as the Velocity team describes:

Velocity is intended to provide distributed caching (in memory) for all .NET applications – from enterprise scale to web-scale. We believe that there are many applications that need a distributed caching mechanism, and that there is, therefore, a need for distributed caching as a core part of the .NET platform. We expect to have more integrated support for this functionality with other parts of the .NET platform in our upcoming releases.

There is also a pretty nice Velocity writeup on MSDN that goes in depth about how Velocity works as well as providing some basic code examples on how to get data into and out of your Velocity Cache. The current set of features looks pretty nice, and I can’t wait for Velocity to become more stable so I can introduce it in to the IdeaPipe mix.

Here is a breif overview of the Current Features:

  1. Support for different cache types, partitioned and local
  2. Support for different client types, simple and routing
  3. Load Balancing & Dynamic Scaling
  4. ASP.Net Integration, currently there is only a Session Provider
  5. Key and Tag based Access

And Beyond

  1. Availability – support for Failover when machines go down
  2. Replicated Cache – another cache type
  3. Embedded Topology – run the cache embedded within you application instead of as a cache service
  4. Notifications – Get notified when a object in the cache is updated
  5. Consistency Models – Support for both weak and strong consistency when doing reads/writes
  6. Native client access to the cache service (E.g – PHP, C++ etc)
  7. Manageability & Administration

Tags: , , , , ,

Social: kick it on DotNetKicks.com

This entry was posted on Thursday, June 5th, 2008 at 7:04 am and is filed under ASP.NET, C#, Review. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

6 Responses to “Give Your ASP.NET Applications Velocity”

  1. DotNetKicks.com Says:

    Give Your ASP.NET Applications Velocity…

    You’ve been kicked (a good thing) – Trackback from DotNetKicks.com…

  2. Dew Drop – June 6, 2008 | Alvin Ashcraft's Morning Dew Says:

    [...] Give Your ASP.NET Applications Velocity (Nick Berardi) [...]

  3. Wöchentliche Rundablage: Silverlight 2, WPF, ASP.NET MVC, jQuery… | Code-Inside Blog Says:

    [...] Give Your ASP.NET Applications Velocity [...]

  4. Weekly Links: Silverlight 2, WPF, ASP.NET MVC, jQuery… | Code-Inside Blog International Says:

    [...] Give Your ASP.NET Applications Velocity [...]

  5. Bill Says:

    I know that the guys at Server Intellect will help you implement this on your Dedicated or VPS server if you ask them too. It is beta but they can help with it. I had them install on my VPS works great!

  6. Paul Jones Says:

    We at alachisoft are really happy that Microsoft has decided to enter this arena. For years we have been trying to spread awareness about distributed caching on our own. Now that Microsoft has announced its arrival, things will undoubtedly become much more interesting.

Leave a Reply