velocity - nxtgen oxford

Post on 17-Dec-2014

305 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

The Need For Speed

A Developer’s Guide to Velocity

Phil Pursglovephil@philippursglove.comhttp://diaryofadotnetdeveloper.blogspot.comhttp://www.philippursglove.com/Velocityhttp://twitter.com/philpursglove

About Me

• Senior .NET Developer• MBCS• MCSD• VBUG East Anglia Co-ordinator• Written for VB Developer and SQL

Server Pro

Agenda• What is Velocity?• Why a Distributed Cache?• Configuring a client• Configuring a server• Managing a cache• Concurrency• High availability / load balancing

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?

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 �

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

Configuring the Velocity Server

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

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 �

Managing A Velocity Cluster

• Powershell integration– Can start/stop cache hosts in a cluster– Create new caches

• But not regions �

What Should I Use It For Now?

• Session state only– Lack of support for dependencies means it

is not ready for other uses

Velocity vNext

• Read-from/write-through• Dependencies

• Support for output caching

Summary

• Velocity is going to be great… in v2 �

• v1 is worth looking at as a session state provider– The end of sticky load-balancing �

Questions?

phil@philippursglove.comhttp://diaryofadotnetdeveloper.blogspot.comhttp://www.philippursglove.com/Velocityhttp://twitter.com/philpursglove

References• Velocity team blog

– http://blogs.msdn.com/velocity• TechEd videos

– http://tinyurl.com/velocityteched• Mix 09 video

– http://tinyurl.com/velocitymixvideo• ARCCast Video

– http://tinyurl.com/velocityscotthavideo• ScottHa on Velocity

– http://tinyurl.com/velocityhanselminutes• Velocity coverage on StackOverflow (beware, here be Java!)

– http://tinyurl.com/velocitystackoverflow

• Other .NET distributed caches– NCache - http://tinyurl.com/ncache– Memcached - http://tinyurl.com/smoe

top related