SESSION CODE: ASI313 Windows Server AppFabric Caching: What It Is and When You Should Use It Jon Flanders.

Slides:



Advertisements
Similar presentations
Faith Allington Program Manager Microsoft Corporation Session Code: WSV304.
Advertisements

Chandrika Shankarnarayan Senior Program Manager Microsoft Corporation SESSION CODE: ASI301.
What’s New with IIS 8: Open Web Platform for Cloud
Tech Ed North America /27/ :46 PM SESSION CODE: ASI203
Running Reporting Services in SharePoint Integrated Mode: How and Why
Tech·Ed  North America /11/ :01 AM SESSION CODE: DEV405
2010 Microsoft BI Conference
Julie Strauss Senior Program Manager Microsoft
9/11/2018 5:53 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
MDOP: Advanced Group Policy Management 4.0
Tech Ed North America /13/ :13 AM Required Slide
Tech·Ed North America /15/2018 3:31 AM
Excel Services Deployment and Administration
Overview of Social Computing in Microsoft SharePoint 2010
Customer Experiences With Business Intelligence
Implementing RESTful Services Using the Microsoft .NET Framework
Windows PowerShell Remoting: Definitely NOT Just for Servers
TechEd /14/2018 6:05 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
TechEd /14/2018 6:26 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
T-SQL Power! The OVER Clause: Your Key to No-Sweat Problem Solving
Architecture of Master Data Services in Microsoft SQL Server 2008 R2
TechEd /21/2018 5:20 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
What’s New In ASP.NET MVC 2
Module 1–Windows AppFabric Cache
TechEd /23/ :44 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Advanced Dashboard Creation Using Microsoft SharePoint Server 2010
Jason Zander Unplugged
Tech Ed North America /27/ :47 PM Required Slide
Tech Ed North America /1/2018 4:27 PM Required Slide
High Availability: A Contrarian View
Business Intelligence Overview: Decisions, Decisions, Decisions
TechEd /4/2018 3:19 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Manage Your Enterprise from a Single Seat: Windows PowerShell Remoting
Tech·Ed North America /5/2018 6:43 PM
Best Practices: Creating OData Services using WCF Data Services
Tech·Ed North America /7/2018 9:06 AM
Team Foundation Server 2010 for Everyone
12/9/2018 Desktop Virtualization Corey Hynes Kyle Rosenthal President Technical Lead HynesITe Inc Spider Consulting @windowspcguy.
Introducing Microsoft SQL Server 2008 R2 Master Data Services
Authoring for Microsoft Silverlight 4 with Microsoft Expression Blend
Tech Ed North America /1/ :36 AM Required Slide
Tech Ed North America /1/2019 2:58 AM Required Slide
Intro to Workflow Services and Windows Server AppFabric
TechEd /11/ :54 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Microsoft Visual Studio 2010 for Web Deployment
TechEd /15/2019 8:08 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Microsoft SharePoint Conference 2009 Jon Flanders
Vittorio Bertocci Principal Technical Evangelist Microsoft
Building Silverlight Apps with RIA Services
Developing Advanced Applications with Windows Azure
MDC-B203 Deploying Applications in Microsoft System Center Virtual Machine Manager Using Services John Messec Program Manager Microsoft.
Building Business Applications in LightSwitch
Sayed Ibrahim Hashimi Program Manager Microsoft Corporation
Tech Ed North America /12/2019 6:45 AM Required Slide
TechEd /11/ :25 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
A Lap Around Internet Explorer 9 For Developers
TechEd /23/2019 9:23 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
2010 Microsoft BI Conference
Service Template Creation from the Ground Up
Hack-proofing your Clients using Windows 7 Security!
Service Template Creation from the Ground Up
Lap Around the Windows Azure Platform
Code First Development in Microsoft ADO.NET Entity Framework 4.1
Building BI applications using PowerPivot for Excel
Day 2, Session 2 Connecting System Center to the Public Cloud
TechEd /7/2019 1:38 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Making Windows Azure Relevant to IT Professionals
Tech Ed North America /6/2019 2:07 PM Required Slide
TechEd /5/2019 2:08 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Presentation transcript:

SESSION CODE: ASI313 Windows Server AppFabric Caching: What It Is and When You Should Use It Jon Flanders

Outline Why caching? Introduction to Windows Server AppFabric Cache Overview of Cache features

Typical Web Architecture Need to route users to same machine (i.e. sticky sessions) Users Each machine round trips for data Some data might be expensive to retrieve Cached data is typically stored in the memory of one (each) server Web Tier CPU and disk can get saturated due with an increase traffic Database

Why use caching? Most applications end up needing Robustness Speed Scalability This is especially true in the web world Need to scale can sneak up quickly Almost any web application can benefit from caching Services can benefit as well

Core caching concepts Caching Storing a copy of data closer to application logic, away from its source Distributed Caching A set of nodes in a farm that coordinate to create a unified view of a cache to a caching client Expiration When an object is removed from the cache because of staleness Eviction When an object is removed from the cache due to low memory conditions

What is the AppFabric Cache? A Distributed cache for “data” In-memory cache Uses an explicit API The “Data” can be CLR Object XML Binary data Optimized for the cache-aside pattern in this version Programming against the cache is explicit Changing the cache doesn’t update the original data store

What is Windows Server AppFabric? A set of technologies and capabilities integrated into Windows Server and IIIS Designed to make building, managing, and scaling IIS applications easier Ships as part of Windows Server AppFabric 2010 Wave 1 Part of Windows Server HA requires Windows Server 2008 Enterprise or DataCenter Editions. Requires .NET 4.0 WORKFLOW HOSTING MONITORING CACHING SERVICE HOSTING ACCESS CONTROL High Availability Scale Out Multi-Tenant Management

AppFabric architecture Cache runs on N nodes Nodes that share configuration are part of a single Cache Cluster Runs as a Windows Service (one service per server node) Typically not the same servers as the client (web) tier More memory is better In-memory copy cache is optional setting (“Local Cache”) All the cache nodes in a cluster are part of a fabric Share configuration Communicate Cooperate Same algorithms that support Windows Azure’s fabric

Stripped memory across server nodes CacheServer#1 CacheServer#2 CacheServer#3 Cache Cluster obj#4 obj#3 obj#2 obj#1 Objects in memory

AppFabric Cache Users Web Tier Caching Tier Database No stick load balancing needed – all servers have copy of cached data Users Easy access to cache cluster Web Tier Multiple machines means scale and potential for high-availability More machines == more memory for cache objects Caching Tier Reduces load on database Database

Demo

AppFabric Cache advantages Native .NET API Scalability Performance Typically linear as more nodes are added LocalCache increases raw performance High Availability Distributed nature safe guards against cache client and server failures

Installation and configuration Installs as part of Windows Server AppFabric Not dependent on other AppFabric features (e.g. service and workflow management) First node creates cluster configuration Other nodes are configured to just join existing cluster Nodes can be added to or removed from the cluster at any time – cluster automatically reconfigures itself

Cache Cluster configuration Configuration abstracted behind a provider model OOB providers SQL Server Database Network share (XML file) Configuration Provider model open

Cache size configuration You must configure “projected” size 1-5 nodes (small) 6-15 nodes (medium) > 15 nodes (large) Cache optimizes itself based on this setting Setting not affected by actual number of nodes added to cluster You can change this (and other) configuration settings on a stopped cluster

Remember – PowerShell can also be called from .NET Code! Administration PowerShell cmdlets are used to administer the cache cluster Remember – PowerShell can also be called from .NET Code!

Cache creation Caches are named constructs Multiple items can live in one named cache Key for each item must be unique Partition design based on High availability requirements Grouping based on logic New-Cache cmdlet Each named Cache can have its own settings for Availability Expiration Eviction

Cache Clients Rich API Can be .NET 4.0 or .NET 3.5 SP1 Centers around the DataCache type Can be .NET 4.0 or .NET 3.5 SP1 WCF NetTcpBinding used under client API Can be configured in code or config Simple configuration – server name and port Can configure N servers Configuring max N is recommended Client is “smart” Requests routes to cache node where data lives automatically Routing table updated on a constant basis by cache cluster Client essentially becomes part of the cluster fabric Local cache configured at client Local cache automatically updated (no guaranteed speed)

Programming the cache //create DataCacheFactory based on config file var dcf = new DataCacheFactory(); //get the cache named "TestCache" var cache = dcf.GetCache("TestCache"); //Add an item called "Test" - throws if exists cache.Add("Test", new Data { TheData = "Test" }); //Put an item called "Test2" - overwrites if exists cache.Add("Test2", new Data {TheData = "Test2" }); //Get "Test3" - add if not in cache (cache-aside) var test3 = cache.Get("Test3") as Data; if (test3 == null) { test3 = new Data {TheData = "Test3" }; cache.Add("Test3", test3); }

Client API Clients can specific named Regions for items Regions are stored on one cache host only Created implicitly if not specified Cache Items can be tagged Tagging enables items to be retrieved without specific knowledge of the item Client can register for notification of cache events Bulk API available as well

Security grant-cacheallowedclientaccount MyDomain\Machine1$ Domain Based Security Option On by default Domain Account / Local Account based Authentication Only authorized servers can join the cluster Only authorized clients can connect to the cluster Transport Level Security Turn on/off Signing or Encryption Can turn off Cache Security Security always has a performance implication Use Firewalls, IPSec, VLANs to protect cache grant-cacheallowedclientaccount  MyDomain\Machine1$ grant-cacheallowedclientaccount  MyDomain\Jon

Management PowerShell enables configuration and some monitoring Logging Cache participates in ETW tracing Logging available on both client and server Rich set of performance monitor counters for monitoring both cache and host performance

ASP.NET Session Provider Custom Session Provider included with Cache Just a configuration change enables session state to be cached across a cluster You may want to enable HA on the cache used <sessionState mode="Custom" customProvider="SessionStoreProvider"> <providers> <add name="SessionStoreProvider" type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider, Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" cacheName="BlueYonderSession"/> </providers> </sessionState>

Caching Patterns It is extremely useful to classify the type of data you are going to cache as either: Resource, Activity, or Reference Data Classification will inform what features to use Use the correct feature for the correct type of data Will help you to design the property number of caches i.e. No need for HA for Reference data

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

Questions?

ASI Track Resources Website – www.Microsoft.com/WindowsAzure/AppFabric Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Tech Ed North America 2010 11/21/2018 6:41 AM ASI Track Resources Website – www.Microsoft.com/WindowsAzure/AppFabric MSDN Developer Center – http://msdn.microsoft.com/en-us/azure/netservices.aspx Blog – http://blogs.msdn.com/b/netservices/ Twitter – http://twitter.com/azure_appfabric Website – http://www.microsoft.com/biztalk/ Website – http://msdn.microsoft.com/biztalk/ Blog – http://blogs.msdn.com/biztalk_server_team_blog Blog – http://www.biztalkblogs.com/ Application Infrastructure Virtual Launch Event – www.appinfrastructure.com AppFabric on Microsoft.com – http://www.microsoft.com/appfabric Developer Center – http://msdn.microsoft.com/appfabric © 2010 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.

Resources Learning Required Slide www.microsoft.com/teched Tech Ed North America 2010 11/21/2018 6:41 AM Required Slide Resources 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/technet http://microsoft.com/msdn © 2010 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.

Complete an evaluation on CommNet and enter to win! Tech Ed North America 2010 11/21/2018 6:41 AM Required Slide Complete an evaluation on CommNet and enter to win! © 2010 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.

Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st http://northamerica.msteched.com/registration   You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year

Tech Ed North America 2010 11/21/2018 6:41 AM © 2010 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. © 2010 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.