velocity - nxtgen oxford

15
The Need For Speed A Developer’s Guide to Velocity Phil Pursglove [email protected] http://diaryofadotnetdeveloper.blogspot.com http://www.philippursglove.com/Velocity http://twitter.com/philpursglove

Upload: phil-pursglove

Post on 17-Dec-2014

305 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Velocity - NxtGen Oxford

The Need For Speed

A Developer’s Guide to Velocity

Phil [email protected]://diaryofadotnetdeveloper.blogspot.comhttp://www.philippursglove.com/Velocityhttp://twitter.com/philpursglove

Page 2: Velocity - NxtGen Oxford

About Me

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

Server Pro

Page 3: Velocity - NxtGen Oxford

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

Page 4: Velocity - NxtGen Oxford

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?

Page 5: Velocity - NxtGen Oxford

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 �

Page 6: Velocity - NxtGen Oxford

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

Page 7: Velocity - NxtGen Oxford

Configuring the Velocity Server

Page 8: Velocity - NxtGen Oxford

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

Page 9: Velocity - NxtGen Oxford

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 �

Page 10: Velocity - NxtGen Oxford

Managing A Velocity Cluster

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

• But not regions �

Page 11: Velocity - NxtGen Oxford

What Should I Use It For Now?

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

is not ready for other uses

Page 12: Velocity - NxtGen Oxford

Velocity vNext

• Read-from/write-through• Dependencies

• Support for output caching

Page 13: Velocity - NxtGen Oxford

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 �

Page 14: Velocity - NxtGen Oxford

Questions?

[email protected]://diaryofadotnetdeveloper.blogspot.comhttp://www.philippursglove.com/Velocityhttp://twitter.com/philpursglove

Page 15: Velocity - NxtGen Oxford

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