Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Velocity - NxtGen Oxford
1. The Need For Speed
A Developer’s Guide to Velocity
Phil Pursglove
phil@philippursglove.com
http://diaryofadotnetdeveloper.blogspot.com
http://www.philippursglove.com/Velocity
http://twitter.com/philpursglove
2. About Me
• Senior .NET Developer
• MBCS
• MCSD
• VBUG East Anglia Co-ordinator
• Written for VB Developer and SQL
Server Pro
3. Agenda
• What is Velocity?
• Why a Distributed Cache?
• Configuring a client
• Configuring a server
• Managing a cache
• Concurrency
• High availability / load balancing
4. What is Velocity?
• A distributed cache
– One logical cache shared across a number of
servers
– Already being used by MSDN Forums
– A session state provider
– In .NET 4.0, a cache provider
• CTP3 released April 2009
– CTP4 coming September 2009
– V1 coming who knows when? Q1 2010?
5. Why a Distributed Cache?
• ASP.NET already has a cache
– In .NET 4.0 it’s moving to
System.Data.Cache
• Enterprise Library has a Caching block
• Caching is per-server
6. What Data Can I Cache In
Velocity
• Any .NET object
– Reference Data
• e.g. Product categories
– Activity Data
• e.g. Shopping Cart
– Resource Data
• e.g. Stock data
8. Configuring the Velocity Client
• Four(!) assembly references to add:
– CacheBaseLibrary.dll
– CASBase.dll
– ClientLibrary.dll
– FabricCommon.dll
• Cache hosts can be hard-coded or in
web.config/app.config
9. Using Velocity
• Add/Remove
• Concurrency
– Optimistic
– Pessimistic
• Regions
– Tie a group of cached objects to a specific node
– But adds extra options (Tags) for retrieving the
object
10. Managing A Velocity Cluster
• Powershell integration
– Can start/stop cache hosts in a cluster
– Create new caches
• But not regions
11. What Should I Use It For Now?
• Session state only
– Lack of support for dependencies means it
is not ready for other uses