Virtual techdays INDIA │ 22-24 November 2010 AppFabric Cache Jatin Kakkar │ Sr. Program Manager,...
-
Upload
reynard-ray -
Category
Documents
-
view
226 -
download
3
Transcript of Virtual techdays INDIA │ 22-24 November 2010 AppFabric Cache Jatin Kakkar │ Sr. Program Manager,...
virtual techdaysINDIA │ 22-24 November 2010
AppFabric Cache
Jatin Kakkar │ Sr. Program Manager, AppFabric
Overview of AppFabric Cache The Problem To the rescue -- App Fabric Cache Cache Overview Cache availability and Roadmap
Programming Cache API Sample Demo –
Provisioning on Azure Cache API Sample on Azure Cache in Session state:: On-prem and Azure
virtual techdaysINDIA │ 18-20 august 2010
S E S S I O N A G E N D A
virtual techdaysINDIA │ 18-20 august 2010
Typical Web App
Application/ Web Tier
Users
Database
Data Tier
Application
ASP.Net App Session Cart
Hosted in memory
Load BalancerSticky Routing
Catalog sits in Database
Application Application
virtual techdaysINDIA │ 18-20 august 2010
…Web Tier(ASP.Net)
Users
Database
Data Tier
Application Application Application
Web Site’s too slow!!
Servers are
crashingDatabase is
hot!!
Where did my shopping cart
go?
Fast Forward in time
virtual techdaysINDIA │ 18-20 august 2010
Cache to the rescue
Cache described
Unified Cache View
• An explicit, distributed, in-memory application cache for all kinds of data – (CLR objects, rows, XML, Binary data etc.)– Fuse "memory" across machines into a unified cache Caching clients can be
across machines or processes
Clients Access the Cache as if it was a large single
cache
Cache Layer distributes data across the various
cache nodes
virtual techdaysINDIA │ 18-20 august 2010
Cache to the rescue
Where cache fits
… Web Tier(ASP.Net)
Users
Database CloudData Tier
Application Application Application
Caching Access Layer Caching Access Layer Caching Access Layer
Cach
ing
Serv
ice
Cach
ing
Serv
ice
Cach
ing
Serv
ice
Cache Tier
virtual techdaysINDIA │ 18-20 august 2010
Why use AppFabric Caching?
1. Share Data Across ApplicationsNo more sticky routing2. Performance Oper Throughput Latency Bulk Fetch
Read 28, 000/ sec (2k) 1-2ms 200k/sec (512 bytes)
Write 20,000 / sec (2k) 3 ms -
Operation Servers Throughput
Read 2k 1 28,000 ops/ sec
Read 2k 2 52, 500 ops/ sec
Read 2k 3 78, 000 ops/ sec
3. Scale out by adding more boxes
4. High Availability Protect from Web & Cache Server Failure
virtual techdaysINDIA │ 18-20 august 2010
Cache Overview
Key features High Availability Expiry/Cache Invalidation Notifications Local Cache Named Regions/Tag based search Locks
Optimistic/Pessimistic Concurrency Model
Bulk Fetch
Cache Features
virtual techdaysINDIA │ 18-20 august 2010
• Host– Physical processes hosting AppFabric Caching
instance.• Named Caches
– Can span across machines
• Cache Item– Key, Payload (Object ), Tags, TTL, Timestamps, Version
• Regions– Physically co-located Container of Cache Items– May be implicit or explicitly created
Regions Region A
Key Payload Tags Key Payload Tags 121 xxxx “Toy” “Child”
123 yyyy “Toy” “Chair”..
Machine -> Cache Host -> Named Caches -> Regions -> Cache Items -> Objects
Named Cache : Product Catalog
Named Cache : Electronics Inventory
AppFabric Caching Service
AppFabric Caching Service
AppFabric Caching Service
Cache Overview
Cache Logical Hierarchy
virtual techdaysINDIA │ 18-20 august 2010
Cache Overview
Cache Data Distribution
Scale on Data Size - More machines => More memory to cache
Scale on Cache Throughput - More machines => keys distributed across more machines => better
throughput
… Web Tier
Cache TierCa
che
Ser
vice
Cach
e S
ervi
ce
Users
Cach
e S
ervi
ce
A C EDB G IHF
ASP.Net App
Caching Client
ASP.Net App
Caching Client
ASP.Net App
Caching Client
AC ED BGI HF
virtual techdaysINDIA │ 18-20 august 2010
Cache availability and Roadmap
Cache is available both On-premise and on Cloud Windows AppFabric Cache
Availability on Windows Server platform V1.0 RTM’ed in mid 2010
Windows Azure AppFabric Cache CTP October 2010 Commercial launch in the first half of 2011
Based off the proven Windows Server AppFabric Caching capabilities Customers can simply request for cache on demand No overhead of cluster provisioning or management Ability to add/remove capacity as per prevailing conditions Comes with ASP.NET session state and page output caching provider
Overview of AppFabric Cache The Problem To the rescue App Fabric Cache Cache Overview Cache availability and Roadmap
Programming Cache API Sample Demo –
Provisioning on Azure Cache API Sample on Azure Cache in Session state:: On-prem and Azure
virtual techdaysINDIA │ 18-20 august 2010
S E S S I O N A G E N D A
virtual techdaysINDIA │ 18-20 august 2010
Cache API
// Create instance of cachefactory (reads appconfig)DataCacheFactory fac = new DataCacheFactory();
// Get a named cache from the factoryDataCache catalog = fac.GetCache(“default");
// Simple Get/Putcatalog.Put("toy-101", new Toy("Puzzle", .,.));
// From the same or a different clientToy toyObj = (Toy)catalog.Get("toy-101");
<hosts> <host name="BL1CDB8083714“ cachePort="22233" cacheHostName="DistributedCacheService"/> ….. </hosts> <localCache isEnabled=“true" ../><security … />
Typical flow
virtual techdaysINDIA │ 18-20 august 2010
Cache API
Cache Aside (Explicit Caching)// Read from CacheToy toyObj = (Toy) catalog.Get("toy-101");
Application
Cach
ing
Serv
ice
Database
// If Not present in the cacheif (toyObj == null){ // Read from backend.. toyObj = ReadFromDatabase(); // Populate Cache catalog.Put("toy-101", toyObj);
return toyObj;}
Caching Access Layer
virtual techdaysINDIA │ 18-20 august 2010
DEMO: Provisioning a cache on Azure
Jatin Kakkar │ Sr. Program Manager, AppFabric
virtual techdaysINDIA │ 18-20 august 2010
DEMO: Cache API Sample on Azure
Jatin Kakkar │ Sr. Program Manager, AppFabric
virtual techdaysINDIA │ 18-20 august 2010
DEMO: Cache as a session state provider:- On-prem and AzureJatin Kakkar │ Sr. Program Manager, AppFabric
virtual techdaysINDIA │ 18-20 august 2010
RESOURCES
Windows AppFabric Cache Download link -- Benefit/Details
Windows Azure AppFabric Cache CTP link -- https://portal.appfabriclabs.com/ Survey on Cache Service in Azure --
Feedback and Discussion AppFabric Forum link --
virtual techdaysTHANKS│18-20 august 2010