• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Windows Server AppFabric Caching - What it is & when you should use it?
 

Windows Server AppFabric Caching - What it is & when you should use it?

on

  • 5,955 views

This is from my Tech-Ed Africa 2010 talk. For more information see: http://www.sadev.co.za/content/teched-africa-2010-slides-scripts-and-demos-my-talks ...

This is from my Tech-Ed Africa 2010 talk. For more information see: http://www.sadev.co.za/content/teched-africa-2010-slides-scripts-and-demos-my-talks

This session looks at what AppFabric Caching is from start to deep dive.

Statistics

Views

Total Views
5,955
Views on SlideShare
5,343
Embed Views
612

Actions

Likes
1
Downloads
70
Comments
0

2 Embeds 612

http://www.sadev.co.za 611
http://sadev.co.za 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Windows Server AppFabric Caching - What it is & when you should use it? Windows Server AppFabric Caching - What it is & when you should use it? Presentation Transcript

    • Robert MacLean
      Technology Specialist
      BB&D
      Windows Server AppFabric Caching: What it is & When you should use it?
    • Who am I?
      Robert MacLean
      Microsoft ALM MVP
      Microsoft ALM Ranger
      Proud Community Lead
      Information Worker
      S.A. Architect
      www.sadev.co.za
      @rmaclean
    • Overture
      Level 300
      State of play
      Briefly what is AppFabric?
      What do we get from AppFabric Caching and how to use it!
    • Advert Time
      AppFabric:
      Wed, 11:15pm - WCF Made Easy with .NET 4 and Windows Server AppFabric
      Other:
      Wed, 8:30pm - Tales From the field – Best practices and guidance on implementing TFS2010
    • State of play
      .NET prior to 4
      ASP.NET Caching
      Enterprise Library Caching
      .NET 4 brings us
      .NET 4 Caching
      All are local in-memory caches!
    • .NET 4 Caching
      Demo
    • What is the issue with these?
      Limited to memory of current machine
      Limited to current process
      Imagine if I need 50Gb of cache?
      What about load balancing?
    • A rose by any other name…
      Windows Server AppFabric contains two key components
      Hosting
      EndPoint, Windows App Server Extensions, Dublin
      Caching
      Velocity
      Not to be confused with Azure AppFabric
    • N.B. AppFabric
      Requires .NET 4 on Server
      Not all applications need .NET 4, depends on features used
      Standalone download or Web Platform Installer
      High Availability is only in Windows Server 2008 Enterprise & Data Centre
    • What is AppFabric Cache?
      An in-memory distributed cache which you can call from any .NET application
      Optimised for the cache-aside pattern
      Programming against the cache is explicit
      Changing the cache doesn’t update the original data store
    • AppFabric Cache Single View
      Cache Server
      Single view from code
      Services
      Cache Server
      Data 1
      Data 2
      Data 3
      Data 4
      Cache Server
      Cache Server
    • AppFabric Caching Info
      Common Configuration Store
      XML
      Database
      Runs as Windows Service
      Communication Between Nodes
      WCF net.tcp
      Self Adjusting
    • AppFabric Server Types
      Dedicated Cache Server
      All it does is AppFabric caching – good for lots of memory and great performation
      Hybrid Cache Server
      Runs AppFabric caching & other tools.
      SQL + AppFabric
      Web + AppFabric
      Local Cache Server
      Runs AppFabric per application locally
      Used in conjunction with hybrid and/or dedicated
    • What can I cache?
      Anything that can be serialised
      XML
      POCO
      Binary Data
    • Data Cache Planning
      Reference Data
      Cities, provinces, product info, etc…
      Activity Data
      Session, per user etc..
      Resource Data
      Data with contention
      We will look at this more later…
      NB: Plan, plan and plan some more
    • Management
      All Configuration and Administration is done via PowerShell
      From the MVP’s: http://mdcadmintool.codeplex.com/
    • AppFabric from IT Pro to Developer
      Demo
    • Cache Structure Review
      Server
      Server
      Server
      Named Cache: Default
      Named Cache: Products
      Named Cache: Users
      Region: Male
      Region: Female
      Items & Tags
    • Expiration of cache items
      Put & Add
      Timeout
      Notification
      Polling
      Default: 300 secs
      Expiration timeout defaults can be controlled on a cache level
    • Eviction
      @ Low watermark
      Expired items removed
      @ High watermark
      Items, expired or not, can be removed or allocated to another server
      Items picked by using LRU
      Can disable if needed
    • ORM’s
      Some ORM’s implement second level caching
      It is possible to change the second level to AppFabric
      Examples: NHibernate & Entity Framework
    • A Problem with Caching
      AppFabric Cache
      Name : Robert
      Balance: 1500
      Write
      DB
      Name : Robert
      Balance: 15
      ATM
      ATM
      ORM
      UI
      ORM
      UI
      Name : Robert
      Balance: 15
    • Solution
      .GetAndLock
      .PutAndUnlock
      .Unlock
      Supports locking timeout
      Locked items can survive expiration
      Unlock can prolong expiration
    • Data Cache Planning
      Reference Data
      Cities, provinces, product info, etc…
      Activity Data
      Session, per user etc..
      Resource Data
      Data with contention
      NB: Plan, plan and plan some more
      Great with defaults
      Region per user
      Locking per item
    • Cluster Configuration
      First node initialises cluster
      Other nodes join
      During install you must configure projected size
      Small: 1 – 5 nodes
      Medium: 6 – 15 nodes
      Large: > 15 nodes
      Performance based on this setting – adding/removing nodes does not effect this
    • Security
      Domain:
      Authentication in AD, Authorisation in AppFabric
      Only authorised servers join clusters
      Only authorised clients connect to clusters
      Workgroup
      Authentication in network share, Authorisation in AppFabric
      Transport Level Security
      Signing and Encryption
    • Typical Web Architecture
      Users
      Web Servers
      Load Balancer
      State
      State
      State
      DB
    • ASP.NET
      Out of the box caching
      InProc (Default)
      StateServer
      SQLServer
      All can be enabled by via config change
      Now AppFabric support also just a config change
    • ASP.NET AppFabricConfig
      <configSections>
      <sectionname="dataCacheClient“type="Microsoft.Data.Caching.DataCacheClientSection, CacheBaseLibrary" allowLocation="true"allowDefinition="Everywhere"/>
      <sectionname="fabric“type="System.Data.Fabric.Common.ConfigFile, FabricCommon“ allowLocation="true"allowDefinition="Everywhere"/>
      </configSections>
      <dataCacheClientdeployment="routing">
      <localCacheisEnabled="false"/>
      <hosts>
      <hostname="localhost"cachePort="22233“ cacheHostName="DistributedCacheService"/>
      </hosts>
      </dataCacheClient>
      <fabric>
      <sectionname="logging"path="">
      <collectionname="sinks"collectionType="list">
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.ConsoleSink,FabricCommon"sinkParam=""defaultLevel="-1"/>
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.FileEventSink,FabricCommon"sinkParam="DcacheLog/dd-hh-mm"defaultLevel="-1"/>
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon“ sinkName="Microsoft.Data.Caching.ETWSink, CacheBaseLibrary“ sinkParam=""defaultLevel="-1"/>
      </collection>
      </section>
      </fabric>
      <system.web>
      <sessionStatemode="Custom"customProvider="Velocity">
      <providers>
      <addname="Velocity"type="Microsoft.Data.Caching.DataCacheSessionStoreProvider, ClientLibrary"cacheName="session"/>
      </providers>
      </sessionState>
      </system.web>
    • ASP.NET AppFabricConfig
      <configSections>
      <sectionname="dataCacheClient“type="Microsoft.Data.Caching.DataCacheClientSection, CacheBaseLibrary" allowLocation="true"allowDefinition="Everywhere"/>
      <sectionname="fabric“type="System.Data.Fabric.Common.ConfigFile, FabricCommon“ allowLocation="true"allowDefinition="Everywhere"/>
      </configSections>
      <dataCacheClientdeployment="routing">
      <localCacheisEnabled="false"/>
      <hosts>
      <hostname="localhost"cachePort="22233“ cacheHostName="DistributedCacheService"/>
      </hosts>
      </dataCacheClient>
      <fabric>
      <sectionname="logging"path="">
      <collectionname="sinks"collectionType="list">
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.ConsoleSink,FabricCommon"sinkParam=""defaultLevel="-1"/>
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.FileEventSink,FabricCommon"sinkParam="DcacheLog/dd-hh-mm"defaultLevel="-1"/>
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon“ sinkName="Microsoft.Data.Caching.ETWSink, CacheBaseLibrary“ sinkParam=""defaultLevel="-1"/>
      </collection>
      </section>
      </fabric>
      <system.web>
      <sessionStatemode="Custom"customProvider="Velocity">
      <providers>
      <addname="Velocity"type="Microsoft.Data.Caching.DataCacheSessionStoreProvider, ClientLibrary"cacheName="session"/>
      </providers>
      </sessionState>
      </system.web>
      <configSections>
      <sectionname="dataCacheClient“type="Microsoft.Data.Caching.DataCacheClientSection, CacheBaseLibrary" allowLocation="true"allowDefinition="Everywhere"/>
      <sectionname="fabric“type="System.Data.Fabric.Common.ConfigFile, FabricCommon“ allowLocation="true"allowDefinition="Everywhere"/>
      </configSections>
    • ASP.NET AppFabricConfig
      <configSections>
      <sectionname="dataCacheClient“type="Microsoft.Data.Caching.DataCacheClientSection, CacheBaseLibrary" allowLocation="true"allowDefinition="Everywhere"/>
      <sectionname="fabric“type="System.Data.Fabric.Common.ConfigFile, FabricCommon“ allowLocation="true"allowDefinition="Everywhere"/>
      </configSections>
      <dataCacheClientdeployment="routing">
      <localCacheisEnabled="false"/>
      <hosts>
      <hostname="localhost"cachePort="22233“ cacheHostName="DistributedCacheService"/>
      </hosts>
      </dataCacheClient>
      <fabric>
      <sectionname="logging"path="">
      <collectionname="sinks"collectionType="list">
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.ConsoleSink,FabricCommon"sinkParam=""defaultLevel="-1"/>
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.FileEventSink,FabricCommon"sinkParam="DcacheLog/dd-hh-mm"defaultLevel="-1"/>
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon“ sinkName="Microsoft.Data.Caching.ETWSink, CacheBaseLibrary“ sinkParam=""defaultLevel="-1"/>
      </collection>
      </section>
      </fabric>
      <system.web>
      <sessionStatemode="Custom"customProvider="Velocity">
      <providers>
      <addname="Velocity"type="Microsoft.Data.Caching.DataCacheSessionStoreProvider, ClientLibrary"cacheName="session"/>
      </providers>
      </sessionState>
      </system.web>
      <dataCacheClientdeployment="routing">
      <localCacheisEnabled="false"/>
      <hosts>
      <hostname="localhost"cachePort="22233“ cacheHostName="DistributedCacheService"/>
      </hosts>
      </dataCacheClient>
    • ASP.NET AppFabricConfig
      <fabric>
      <sectionname="logging"path="">
      <collectionname="sinks"collectionType="list">
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.ConsoleSink,FabricCommon"sinkParam=""defaultLevel="-1"/>

      </collection>
      </section>
      </fabric>
      <configSections>
      <sectionname="dataCacheClient“type="Microsoft.Data.Caching.DataCacheClientSection, CacheBaseLibrary" allowLocation="true"allowDefinition="Everywhere"/>
      <sectionname="fabric“type="System.Data.Fabric.Common.ConfigFile, FabricCommon“ allowLocation="true"allowDefinition="Everywhere"/>
      </configSections>
      <dataCacheClientdeployment="routing">
      <localCacheisEnabled="false"/>
      <hosts>
      <hostname="localhost"cachePort="22233“ cacheHostName="DistributedCacheService"/>
      </hosts>
      </dataCacheClient>
      <fabric>
      <sectionname="logging"path="">
      <collectionname="sinks"collectionType="list">
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.ConsoleSink,FabricCommon"sinkParam=""defaultLevel="-1"/>
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.FileEventSink,FabricCommon"sinkParam="DcacheLog/dd-hh-mm"defaultLevel="-1"/>
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon“ sinkName="Microsoft.Data.Caching.ETWSink, CacheBaseLibrary“ sinkParam=""defaultLevel="-1"/>
      </collection>
      </section>
      </fabric>
      <system.web>
      <sessionStatemode="Custom"customProvider="Velocity">
      <providers>
      <addname="Velocity"type="Microsoft.Data.Caching.DataCacheSessionStoreProvider, ClientLibrary"cacheName="session"/>
      </providers>
      </sessionState>
      </system.web>
    • ASP.NET AppFabricConfig
      <configSections>
      <sectionname="dataCacheClient“type="Microsoft.Data.Caching.DataCacheClientSection, CacheBaseLibrary" allowLocation="true"allowDefinition="Everywhere"/>
      <sectionname="fabric“type="System.Data.Fabric.Common.ConfigFile, FabricCommon“ allowLocation="true"allowDefinition="Everywhere"/>
      </configSections>
      <dataCacheClientdeployment="routing">
      <localCacheisEnabled="false"/>
      <hosts>
      <hostname="localhost"cachePort="22233“ cacheHostName="DistributedCacheService"/>
      </hosts>
      </dataCacheClient>
      <fabric>
      <sectionname="logging"path="">
      <collectionname="sinks"collectionType="list">
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.ConsoleSink,FabricCommon"sinkParam=""defaultLevel="-1"/>
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon"sinkName="System.Data.Fabric.Common.FileEventSink,FabricCommon"sinkParam="DcacheLog/dd-hh-mm"defaultLevel="-1"/>
      <customTypeclassName="System.Data.Fabric.Common.EventLogger,FabricCommon“ sinkName="Microsoft.Data.Caching.ETWSink, CacheBaseLibrary“ sinkParam=""defaultLevel="-1"/>
      </collection>
      </section>
      </fabric>
      <system.web>
      <sessionStatemode="Custom"customProvider="Velocity">
      <providers>
      <addname="Velocity"type="Microsoft.Data.Caching.DataCacheSessionStoreProvider, ClientLibrary"cacheName="session"/>
      </providers>
      </sessionState>
      </system.web>
      <system.web>
      <sessionStatemode="Custom"customProvider="Velocity">
      <providers>
      <addname="Velocity"type="Microsoft.Data.Caching.DataCacheSessionStoreProvider, ClientLibrary"cacheName="session"/>
      </providers>
      </sessionState>
      </system.web>
    • Summary
      Windows Server AppFabric Cache is a distributed application cache
      Caching is important to application scalability
      Explicit caching API available to .NET 3.5 SP1 and .NET 4.0
      ASP.NET Session provider an implicit way to take advantage of the Cache’s capabilities
      Plan, plan and plan some more
    • Questions
      robert@sadev.co.za
      @rmaclean
      Meet me at the community lounge
    • Resources
      Required Slide
      Learning
      Sessions On-Demand & Community
      Microsoft Certification & Training Resources
      www.microsoft.com/teched
      www.microsoft.com/learning
      Resources for IT Professionals
      Resources for Developers
      http://microsoft.com/msdn
      http://microsoft.com/technet
      Need more Information?
      SMS [ Your Name ] and the word “AppServer” to 41491
    • Complete an evaluation via CommNet and Tag to win amazing prizes!
    • © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
      The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
    • Notes – Hide slide
    • AgendaAgenda Subtitle
      Agenda item 1
      Agenda subheading
      Agenda Item 2
      Agenda subheading
      Agenda item 3
      Agenda subheading
      Etc…
    • Name
      Title
      Company
      Title of Presentation
      SESSION CODE: #####
    • PowerPoint TemplateSubtitle color
      Example of a slide with a subhead
      Set the slide header to “Title Case”
      Set subheads in “sentence case”
      Generally set subhead to 36pt or smaller so it will fit on asingle line
      The subhead color is defined for this template but mustbe selected
    • Sample Fill
      Sample Fill
      PowerPoint Guidelines
      Font, size, and color for text have been formatted for you in the Slide Master
      Use the color palette shown below
      Hyperlink color: www.microsoft.com
      Sample Fill
      Sample Fill
      Sample Fill
      Sample Fill
    • Slide for Showing Software Code
      Use this layout to show software code
      The font is Consolas, a monospace font
      The slide doesn’t use bullets but levels can be indented using the “Increase List Level” icon on the Home menu
      To use straight quotes " instead of smart quotes ”, do this:
      Click on the Office Button in the upper left corner
      At the bottom of the menu, choose PowerPoint Options
      From the left pane, select Proofing
      Click on the AutoCorrect Options button
      Select the AutoFormat As You Type tab, and deselect “Straight quotes” with “smart quotes”. Then Click OK.
    • Table Format
    • Bar Chart Example
    • Pie Chart Example
    • Breakout sessions
      Breakout sessions
      Breakout sessions
      Breakout sessions
      Related Content