Windows Server AppFabric Cache

Slides:



Advertisements
Similar presentations
Not like the State of Virginia. What is State in ASP.NET? Services (like web services) are Stateless. This means if you make a second request to a server,
Advertisements

Mark Simms Principal Program Manager Windows Azure Customer Advisory Team.
Caching MacDonald Ch. 26 MIS 424 MIS 424 Professor Sandvig Professor Sandvig.
Distributed Systems Fall 2010 Transactions and concurrency control.
Wade Wegner Windows Azure Technical Evangelist Microsoft Corporation Windows Azure AppFabric Caching.
Programming the Cache API. namespace Microsoft.ApplicationServer.Caching { public sealed class DataCacheFactory : IDisposable { public DataCacheFactory();
Working with Regions and Tags. var dcf = new DataCacheFactory(); //get the cache named "TestCache" var cache = dcf.GetCache("TestCache"); //Add a region.
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
Ingo Rammer thinktecture.
Microsoft ASP.NET: An Overview of Caching Holly Mazerolle Developer Support Engineer Microsoft Developer Support Microsoft Corporation.
 Muralidhar Krishnaprasad Principal Architect Microsoft Corporation TL14.
 Sergey Barskiy  Principal consultant at Magenic Technologies  
Software Architecture for ColdFusion Developers Unit 4: Application Events and Global Variables.
Session Tracking - 2 Lec 32. Last Lecture Review  Session Tracking – why?  Need to store state – typical solutions Cookies – already learned URL Rewriting.
Web Application Development * These slides have been adapted and modified from CoreServlets course material (Marty Hall) and LUMS cs391 (Umair Javed).
Connect with life Janakiram MSV Sr. Technology Strategist | MS India Development Center Siddharth Jagtiani Sr. Program Manager.
Chapter 6 Server-side Programming: Java Servlets
Dr. Azeddine Chikh IS444: Modern tools for applications development.
ASP.NET State Management. Slide 2 Lecture Overview Client state management options Cookies Server state management options Application state Session state.
WEB PROGRAMMING – ASP.NET Presented By – Kiran Kumar Gunna.
ASP.NET Caching - Pradeepa Chandramohan. What is Caching? Storing data in memory for quick access. In Web Application environment, data that is cached.
Locking In CFML. Locking in CFML - Why - How - What - When } to lock? Understand Locking.
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
Virtual techdays INDIA │ November 2010 AppFabric Cache Jatin Kakkar │ Sr. Program Manager, AppFabric.
CSCI 6962: Server-side Design and Programming Java Server Faces Scoping and Session Handling.
Windows Azure Conference 2014 Caching Data in the Cloud with Windows Azure.
Virtual techdays INDIA │ 9-11 February 2011 Caching Enhancement in ASP.NET 4.0 Abhijit Jana │ Consultant, Microsoft
HTTP evolution - TCP/IP issues Lecture 4 CM David De Roure
Designing and Delivering Scalable and Resilient Web Services Ron Jacobs Sr. Technical Evangelist, Microsoft
Ingo Rammer thinktecture
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
SharePoint Saturday Quito Marzo 7, 2015 SharePoint 2013 Performance Improvements COMUNIDAD SHAREPOINT DE COLOMBIA.
TAP into async programming
Advance Caching Techniques Keen Haynes MKAD SCCFUG Winter 2002 Conference.
Locking In CFML. Locking in CFML - Why - How - What - When } to lock? Understand Locking.
Visual Studio 2010 and.NET Framework 4 Training Workshop.
Session, TempData, Cache Andres Käver, IT Kolledž
Unit-6 Handling Sessions and Cookies. Concept of Session Session values are store in server side not in user’s machine. A session is available as long.
JQuery form submission CIS 136 Building Mobile Apps 1.
ARCHITECTING APPLICATIONS FOR HIGH SCALABILITY Leveraging the Windows Azure Platform Scott Densmore Sr. Software Development Engineer Microsoft patterns.
Lesson 5: Managing Catalog (NWCG/Cache System Administrators )
Java Servlets References: Karen Anewalt, Mary Washington College.
Top 10 Entity Framework Features Every Developer Should Know
Managing State Chapter 13.
NetApp Online Ordering User Tutorial
CSE 486/586 Distributed Systems Case Study: Amazon Dynamo
State Management.
Chapter 6: The Stack Abstract Data Type
Distributed Cache Dipl.-Ing. Damir Dobric Lead Architect daenet
.NET Performance Solutions
Client-server Programming
ASP.NET Caching.
Pre-assessment Questions
Whether you decide to use hidden frames or XMLHttp, there are several things you'll need to consider when building an Ajax application. Expanding the role.
CIS 136 Building Mobile Apps
Database Performance Tuning and Query Optimization
Web Programming– UFCFB Lecture 17
The Active Object Pattern
SESSION CODE: ASI313 Windows Server AppFabric Caching: What It Is and When You Should Use It Jon Flanders.
Module 1–Windows AppFabric Cache
JULIE McLAIN-HARPER LINKEDIN: JM HARPER
jQuery form submission
Building ASP.NET Applications
Chapter 11 Database Performance Tuning and Query Optimization
Pre-assessment Questions
CSE 486/586 Distributed Systems Case Study: Amazon Dynamo
Servlet Session Tracking: Session API
Module 2 - Xtrata Pro Product Overview Module 2 – Product Overview
INTEGRATION WITH CornerStone LMS
Presentation transcript:

Windows Server AppFabric Cache Patterns of use

Outline Reference data Activity data Resource data Priming Batching

Classify your data When using the cache Classification can help organize Caches Regions Remember that availability, expiration, and eviction are set on a per cache basis Reference Activity Resource Primary Read Only Read-Write Not shared Read-Write, Shared Catalog Data Shopping Cart Auction Data/Seat Assignment

Reference data Data that doesn’t change often (or at all) List of countries, catalog items, descriptions, images Excellent candidate for caching Since it doesn’t change frequently also a good candidate for using with local cache Think about turning off expiration and eviction

Activity Data Typically data relating to one client Important data Shopping cart Important data Configure high availability (HA) Can also use Session provider from ASP.NET

Resource data Data that is contentious Need to use locking Seating assignment for flights or concerts Need to use locking Optimistic Pessimistic

Using Optimistic concurrency Clients must retrieve DataCacheItemVersion Pass to overload of DataCache.Put If newer version is already in the cache Put throws an exception Use DataCache.GetCacheItem to retreive the DataCacheItemVersion DataCache.Get does have overload with an out param DataCache.GetIfNewer to avoid full round trip

Concurrency APIs public DataCacheItemVersion Put(string key, object value, DataCacheItemVersion oldVersion); public DataCacheItemVersion Put(string key, object value, DataCacheItemVersion oldVersion, string region); public DataCacheItemVersion Put(string key, object value, DataCacheItemVersion oldVersion, TimeSpan timeout); public DataCacheItemVersion Put(string key, object value, DataCacheItemVersion oldVersion, TimeSpan timeout, string region); Parameter description key Key of item in the distributed cache value Value of object stored in the cache (serialized) timeout How long before the item should expire oldVersion DataCacheItemVersion held by client region Region to place item

Using optimistic concurrency var version = cache.Add("NewKey", "NewValue"); try { cache.Put("NewKey", "OtherValue", version); } catch (DataCacheException ex) Console.WriteLine(ex.ToString()); //some other process or thread cache.Put("NewKey", "ChangedValue");

On demand This is the most typical pattern of cache usage Application looks for cached data If not found pulls from real data source Puts the data in the cache AKA Cache-aside pattern

On demand object data = null; var key = "DataKey"; data = cache.Get(key); if (data == null) { data = GetData(); cache.Add(key, data); }

Priming Priming is a pattern where you pull data into the cache before the first request for it Typically done on application start Priming is especially useful with Reference data

Batching Batching in general is always more effective Best used with reference data Used with Tags or Regions in AppFabric Cache DataCache.BulkGet List<string> keys = GetKeys(); var batchItems = cache.BulkGet(keys, "BulkRegion");

Summary You need to classify the data you are storing in the cache to be able to choose the correct features DataCacheVersion enables optimistic concurrency pattern (resource data)

Questions?