The Need For Speed             A Developer’s Guide to             Distributed Caching with                Velocity AppFabr...
Agenda•   What is AppFabric?•   Why a Distributed Cache?•   Configuring a client•   Configuring a server•   Managing a cac...
Caching Review• .NET 1.1  – ASP.NET Cache• .NET 2.0  – SqlCacheDependency  – Enterprise Library Caching Application    Blo...
Cache-Aside• The cache-aside pattern  – See if the item you want is in the cache  – If it isn’t (a cache miss),      • Go ...
What is AppFabric?• A combination of two projects:   – A distributed cache       • One logical cache shared across a numbe...
How Do I Get AppFabric?• For Devs:   – Web Platform Installer, under the Products tab   – Requires SQL Express       • If ...
Why a Distributed Cache?• Bigger cache  – Many physical servers contribute to one    logical cache• High availability  – M...
Terminology• Cluster  – A number of servers running Velocity  – Not related to Windows clustering• Cache  – A named cache ...
What Data Can I Cache In         AppFabric?• Any serializable .NET object  – Reference Data (Shared Read)     • e.g. Produ...
Configuring the AppFabric           Client• Two assembly references to add:  – Microsoft.ApplicationServer.Caching.Client....
Using AppFabric 1• Add/Remove• Concurrency  – Optimistic     • Version based  – Pessimistic     • Lock based
Using AppFabric 2• Regions  – Live inside a cache  – Tie a group of cached objects to a specific node      – But adds ext...
Configuring an AppFabric            Server• Cluster configuration can be held:  – On a network share (XML Provider)  – In ...
Managing An AppFabric         Cluster• Powershell integration  – Can start/stop a whole cluster or    individual servers  ...
AppFabric 1.1• CTP 1 released Aug 2011• New session state and output cache  providers• Read-through/write behind cache  – ...
Summary• v1 is worth looking at as a session  state provider  – The end of sticky load-balancing • v1.1’s new model makes...
Questions?phil@philippursglove.comhttp://philpursglove.blogspot.comhttp://www.philippursglove.com/Velocity@philpursgloveht...
References•   Documentation on MSDN     – http://tinyurl.com/msdnappfabric•   Velocity team blog     – http://blogs.msdn.c...
References• AppFabric coverage on StackOverflow   – http://tinyurl.com/stackoverflowvelocity   – http://tinyurl.com/stacko...
Upcoming SlideShare
Loading in …5
×

The Need For Speed - NxtGen Cambridge

793 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
793
On SlideShare
0
From Embeds
0
Number of Embeds
20
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

The Need For Speed - NxtGen Cambridge

  1. 1. The Need For Speed A Developer’s Guide to Distributed Caching with Velocity AppFabricPhil Pursglove@philpursglovehttp://philpursglove.blogspot.comhttp://www.philippursglove.com/Velocity
  2. 2. Agenda• What is AppFabric?• Why a Distributed Cache?• Configuring a client• Configuring a server• Managing a cache• Concurrency• High availability / load balancing
  3. 3. Caching Review• .NET 1.1 – ASP.NET Cache• .NET 2.0 – SqlCacheDependency – Enterprise Library Caching Application Block• .NET 4.0 – System.Runtime.Caching assembly – AppFabric
  4. 4. Cache-Aside• The cache-aside pattern – See if the item you want is in the cache – If it isn’t (a cache miss), • Go and get it i.e. from the DB • Put it in the cache – If it is, • Cast it to the desired type and return it
  5. 5. What is AppFabric?• A combination of two projects: – A distributed cache • One logical cache shared across a number of physical servers • Already being used by: – MSDN Forums – Xbox Live – MSN • A session state provider • In .NET 4.0, a cache provider – A workflow host• v1 released June 2010
  6. 6. How Do I Get AppFabric?• For Devs: – Web Platform Installer, under the Products tab – Requires SQL Express • If you want to use SQL Server, download the installer• For IT Pros: – Download the installer from http://tinyurl.com/appfabric10installer
  7. 7. Why a Distributed Cache?• Bigger cache – Many physical servers contribute to one logical cache• High availability – Multiple servers = fault tolerance• Increased throughput – Many servers available to fulfil requests
  8. 8. Terminology• Cluster – A number of servers running Velocity – Not related to Windows clustering• Cache – A named cache on a cluster• Region – A named part of a cache associated to a single server
  9. 9. What Data Can I Cache In AppFabric?• Any serializable .NET object – Reference Data (Shared Read) • e.g. Product categories – Activity Data (Exclusive Write) • e.g. Shopping Basket – Resource Data (Read and Write) • e.g. product stock data
  10. 10. Configuring the AppFabric Client• Two assembly references to add: – Microsoft.ApplicationServer.Caching.Client.dll – Microsoft.ApplicationServer.Caching.Core.dll• Cache hosts can be hard-coded or in web.config/app.config• Clients – Routing vs Simple – Local caches
  11. 11. Using AppFabric 1• Add/Remove• Concurrency – Optimistic • Version based – Pessimistic • Lock based
  12. 12. Using AppFabric 2• Regions – Live inside a cache – Tie a group of cached objects to a specific node  – But adds extra options (Tags) for retrieving the object 
  13. 13. Configuring an AppFabric Server• Cluster configuration can be held: – On a network share (XML Provider) – In a SQL Server DB (SQL Provider)• Integrated Security only  – AppFabric servers must be inside a domain
  14. 14. Managing An AppFabric Cluster• Powershell integration – Can start/stop a whole cluster or individual servers – Create new named caches • But not regions  – Get cache statistics• MDCAdmin tool – WPF app sitting on top of Powershell
  15. 15. AppFabric 1.1• CTP 1 released Aug 2011• New session state and output cache providers• Read-through/write behind cache – Inherit from DataCacheStoreProvider
  16. 16. Summary• v1 is worth looking at as a session state provider – The end of sticky load-balancing • v1.1’s new model makes it much more usable
  17. 17. Questions?phil@philippursglove.comhttp://philpursglove.blogspot.comhttp://www.philippursglove.com/Velocity@philpursglovehttp://slideshare.net/philpursglove
  18. 18. References• Documentation on MSDN – http://tinyurl.com/msdnappfabric• Velocity team blog – http://blogs.msdn.com/velocity – http://blogs.msdn.com/endpoint• AppFabric blog for IT Pros – http://blogs.technet.com/appfabric/• TechEd videos – http://tinyurl.com/velocityteched• Mix 09 video – http://tinyurl.com/velocitymixvideo• Mix 10 video – http://tinyurl.com/velocitymix10video• ARCCast Video – http://tinyurl.com/velocityscotthavideo• ScottHa on Velocity – http://tinyurl.com/velocityhanselminutes• Deep Fried Bytes on AppFabric – http://tinyurl.com/deepfriedappfabric
  19. 19. References• AppFabric coverage on StackOverflow – http://tinyurl.com/stackoverflowvelocity – http://tinyurl.com/stackoverflowappfabric• DotNetRocks – http://tinyurl.com/dotnetrocksappfabric• Other .NET distributed caches – NCache - http://tinyurl.com/ncache – Memcached - http://tinyurl.com/smoe – Oracle Coherence – http://tinyurl.com/oraclecoherence – SharedCache – http://codeplex.com/sharedcache• Extensions Project – http://tinyurl.com/mscacheext• Admin Tool – http://mdcadmintool.codeplex.com/

×