# Friday, June 13, 2008

Distributed Caching

I have just finished listened to the Distributed Caching with Microsoft's "Velocity" podcast by Scott Hanselman and it has some interesting points covered from a development, architecture and infrastructure point of view. I have summarised a quick overview of some of the functionality offered together with some initial thoughts around implications and next steps to think about.

Overview

Velocity from and ASP.Net point of view provides the ability to use it as an alternative to using either the out of process or SQL Server session state giving the following benefits:

  • Scalability - The information stored across multiple machines.
  • Failsafe - The state information is recoverable in the event one node fails.
  • Reduce - Load on the SQL Server.
  • Availability - Information cab be retrieved in the event that the SQL Server is not available.
  • Performance - Latency expected to be around 2ms as opposed for 20ms for SQL Server call.
Thinking though the availability scenario, the caching API together with Distributed caching could be used to store information retrieved from the SQL Server. In the event that the SQL server if not available, then return the last cached value. Using this approach however would need to carefully think through a strategy what happens to the information that would have been written to the database and what the user experience would be.

Caches types supported

  • Partitioned Cache - Ability to share key/value pairs across a cluster of machines e.g. 2 computers with 1Gb memory each allowing 2Gb storage.
  • Replicated Cache - Small objects that that are available on each cache node, allow faster read access to the data.
  • Local Cache - Stored in process without need to serialise/deserialise.
Implications

Development implications:
  • New API's
  • Instrumentation to know what information is in cache and how often inserted, updated, expired etc.
  • Strategies to implement failover to to preserve availability.
  • Development best practices for caching information.
  • Serialisation of objects.
  • Local development with components.
Architecture implications:
  • Design for Availability, Reliability etc.
  • Process/Strategies for handing distributed caching/session information and interaction with database & presenters.
Infrastructure implications:
  • Can be on the web server (provided it has enough memory).
  • Possible requirements for separate computers.
  • Network capacity to store and retrieve information between web servers and velocity.
  • Network interfaces to/from the distributed cache.
  • Updates to UAT and Production servers.
  • Updates for maintenance.
Next Steps

Timeframe for the product:
  • CTP is available now.
  • Next CTP should available around PDC Oct 08.
  • Expected release early 09.

Points for further investigation:
  • Follow future version 2 functionality that allows LINQ queries over distributed cache.
  • Compare and contrast with other current frameworks that exist.
  • Look at Setup of Velocity for review of features.
  • Investigate situations that are ideal for Distributed Caching
Comments are closed.