![Page 1: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/1.jpg)
Como garantir a escalabilidade da sua camada de dados com o Windows Server AppFabric
WIN304
Nuno Godinho
Partner & CTO @ ITech4All
@NunoGodinho
![Page 2: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/2.jpg)
Nuno Filipe GodinhoPartner & CTO @ ITech4all
Mail: [email protected]@sapo.pt
Blogs: http://pontonetpt.com/blogs/nunogodinhohttp://xamlpt.com/blogs/nunogodinhohttp://weblogs.asp.net/nunogodinhohttp://msmvps.org/blogs/nunogodinho
Twitter: @NunoGodinho
About Me
![Page 3: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/3.jpg)
• The Problem!• Caching with the Windows
Server AppFabric• Overview and Programming
Model• Caching Futures• Summary• Q&A
Agenda
![Page 4: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/4.jpg)
The Problem
![Page 5: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/5.jpg)
Online Pharmacy
![Page 6: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/6.jpg)
Typical Web Architecture
• Need to get routed to same machine (i.e. sticky sessions)
Users
• Each machine round trips for data
• Data that is cached is stored in the memory of one server
Web Tier
• CPU and disk can get saturated due to traffic
• Service access is slow
Data
Tier
![Page 7: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/7.jpg)
And then…
• Flu Hits!
![Page 8: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/8.jpg)
You become a popular Pharmacy!
…Web Tier(ASP.Net)
Users
Database Data Tier
Application
Application
Application
Web Site’s too
slow!!
Servers are crashing
Database is hot!!
Where did my
shopping cart go?
![Page 9: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/9.jpg)
Possible Solution
![Page 10: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/10.jpg)
Data Near Processing
ASP.NET
Web ServiceDatabas
e
Smart Client Browser
Cache
CacheCache
CacheCache
![Page 11: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/11.jpg)
• Cache is scoped to machine / process• Machines die• Processes recycle
• Cache memory is limited
Good but…
![Page 12: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/12.jpg)
1Some features may require certain editions of Windows Server
• You could have as much cache as you wanted?
• You could share a giant cache across servers, services and even clients?
• What if this was something you could simply add to the platform for 1free?
What if?
![Page 13: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/13.jpg)
Caching with the Windows Server AppFabric
![Page 14: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/14.jpg)
What Is It?
![Page 15: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/15.jpg)
• 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
What is AppFabric Caching?
Unified Cache View
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
![Page 16: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/16.jpg)
Where does it fit?
… Web Tier(ASP.Net)
Users
Database
Cloud Data Tier
Application
Application
ApplicationCaching
Access LayerCaching
Access Layer
Cach
ing
Serv
ice
Cach
ing
Serv
ice
Cach
ing
Serv
ice
Cache Tier
Caching Access Layer
![Page 17: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/17.jpg)
AppFabric Cache
• No need for sticky sessionsUsers
• Cached data available to all serversWeb
Tier
• Multiple machines means scale and high-availability
• Lots of cache memory
Caching Tier
• Reduces load on database
• Duplicate Service Calls eliminated
Data Tier
![Page 18: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/18.jpg)
Why AppFabric Caching
![Page 19: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/19.jpg)
• 1. Share Data Across Applications• No more sticky routing
• 2. Performance
• 3. Scale out by adding more boxes
• 4. High Availability Protect from Web & Cache Server Failure
Why use AppFabric Caching?
Operation 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
![Page 20: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/20.jpg)
• 5. Proven Technology - Associated Press Custom News live on CTP3
Why use AppFabric Caching?
• AppFabric caching capabilities caches metadata and news for widgets
• Serves 16 million hits per day
• Increased the amount of cached data 6 times.
![Page 21: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/21.jpg)
• 5. Proven Technology Contd..• Dell.com uses AppFabric caching!• Channel Partner Portal uses AppFabric
caching• Provides targeted content and search results • Tracks customer browse history and downloads.
• Next Generation Sales Platform Solutions to use AppFabric caching (currently under construction)
• Just two of the many TAP customers in line for production
Why AppFabric Caching?
![Page 22: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/22.jpg)
• 6. Do all this at low cost!
Why AppFabric Caching? – Best yet
AppFabric
CACHINGSERVICE BUS ACCESS
CONTROL
MONITORINGWORKFLOW HOSTING
SERVICE HOSTING
SCALE OUTHIGH AVAILABILITY
MULTI-TENANT
MANAGEMENT
• Use inexpensive commodity hardware
• Ships as part of Windows Server AppFabric 2010 Wave 1
* Different Features of the cache might require higher level SKUs of Windows Server.
![Page 23: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/23.jpg)
What Stage Is It In?
![Page 24: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/24.jpg)
When Can I Get Windows Server AppFabric ?
CTP1June ‘08
CTP2PDC ‘08
CTP3Mar
‘09
Beta• PDC• Nov ‘09
RTM2010 Wave 1
* CY10
Azure CTPPost RTM
(Formerly Called “Velocity”)
![Page 25: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/25.jpg)
DemoInstallation
![Page 26: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/26.jpg)
Overview and Programming AppFabric Caching
![Page 27: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/27.jpg)
Deployment and Access API
![Page 28: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/28.jpg)
Deployment
Cach
ing
Serv
ice
Cach
ing S
erv
ice
Cach
ing
Serv
ice
Configuration Store
Install AppFabric
… Application Application Application
<hosts> <host name="BL1CDB8083714“ cachePort="22233" cacheHostName="DistributedCacheService"/> ….. </hosts> <localCache isEnabled=“true" ../><security … />
Caching Access Layer
Caching Access Layer
Caching Access Layer
.NET 3.5 SP1 OR .NET 4
Configure AppFabric
.NET 4
Update Web.config
Users
Copy Client DLLs
![Page 29: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/29.jpg)
DemoAppFabric Caching CodePlex Tool
http://mdcadmintool.codeplex.com/
![Page 30: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/30.jpg)
• Domain Based Security Option• 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• Use Firewalls, IPSec, VLANs to protect cache
Security (new since Beta)
grant-cacheallowedclientaccount RedDomain\Machine1$ grant-cacheallowedclientaccount RedDomain\John
![Page 31: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/31.jpg)
• Centralized administration through powershell
• Perfmon to monitor the cache (new in Beta)
• Logging • Default ETW, support for file logs
Administration & Monitoring
![Page 32: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/32.jpg)
// Create instance of cachefactory (reads appconfig)DataCacheFactory fac = new DataCacheFactory();
// Get a named cache from the factoryDataCache catalog = fac.GetCache("catalogcache");
AppFabric Caching API
// Simple Get/Putcatalog.Put("toy-101", new Toy("Puzzle", .,.));
// From the same or a different clientToy toyObj = (Toy)catalog.Get("toy-101");
// Region based Get/Putcatalog.CreateRegion("toyRegion");
// Both toy and toyparts are put in the same region catalog.Put("toy-101", new Toy( .,.), “toyRegion”);Catalog.Put("toypart-100", new ToyParts(…), “toyRegion”);
Toy toyObj = (Toy)catalog.Get("toy-101“,"toyRegion");
![Page 33: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/33.jpg)
• Host• Physical processes hosting
AppFabric Caching instance.• Named Caches
• Can span across machines• Defined in the configuration file
AppFabric Caching Logical Hierarchy
• 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
AppFabric Caching Service
Named Cache : Product Catalog
Named Cache : Electronics Inventory
AppFabric Caching Service
AppFabric Caching Service
AppFabric Caching Service
![Page 34: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/34.jpg)
• Add Tags to Items• Tag Search on Default Regions (New
in Beta)
Access APIs – Tagging Items
Tag hotItem = new Tag("hotItem");
catalog.Put("toy-101", new Toy("Puzzle"), new Tag[]{hotItem}, “toyRegion”);
catalog.Put("toy-102", new Toy("Bridge"), “toyRegion”);
// From the same or a different clientList<KeyValuePair<string, object>> toys = catalog.GetAnyMatchingTag("toyRegion", hotItem);
![Page 35: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/35.jpg)
Usage Pattern – 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
![Page 36: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/36.jpg)
How does it Scale?
![Page 37: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/37.jpg)
Data Distribution - Partitioned Cache
… Web Tier
Cache TierC
ach
e Serv
ice
Cach
e Serv
ice
Users
Cach
e
Serv
ice
A C EDB G IHF
Scale on Data Size - More machines => More memory to
cache
Scale on Cache Throughput - More machines => keys
distributed across more machines => better throughput
ASP.Net App
Caching Client
ASP.Net App
Caching Client
ASP.Net App
Caching Client
AC ED BGI HF
![Page 38: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/38.jpg)
Scale Test Output
Load
Throughput
Latency
1 Cache ServerAs load increases, throughput fails
to scale latency increases
Caching Tier
![Page 39: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/39.jpg)
Add Second Cache Server
ThroughputLoad Max
Throughput increasesLatency
decreases
Caching Tier
Load
Latency
![Page 40: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/40.jpg)
Add Third Cache Server
Load
Throughput
Latency
Caching Tier
![Page 41: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/41.jpg)
GridDynamics Blog Engine Tests
00:00 05:00 10:00 15:00 20:000
1000
2000
3000
4000
5000Throughput Test
Increase Load vs Requests / sec
Time
More info at http://blogs.msdn.com/velocity/ or http://www.griddynamics.com/velocity
0 1000 2000 3000 40000
0.1
0.2
0.3
0.4
0.5
16 KB objects, Response Time,
sec
Requests / sec1 2 3 4 5 6 8
0
1000
2000
3000
4000
5000Scale Test
# of Nodes vs Throughput
Nodes
![Page 42: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/42.jpg)
Features
![Page 43: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/43.jpg)
• Classify your data • Reference or Activity or Resource Data
• Examine Requirements• Performance - Throughput & Latency• Consistency – Tolerable staleness• Eviction - Is the data evictable?• Security - Is there any secure data?• Availability – Survive node or cluster
failures?
Use the right features!
![Page 44: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/44.jpg)
Types of Data
Reference Activity Resource
Primary Read Only Read-Write Not shared
Read-Write, Shared
Catalog Data Shopping Cart Auction Data/Seat Assignment
Web Tier
Distributed Cache
Shopping Cart
Pharmacy Catalog
Pharmacy Inventory
Grocery Shop
![Page 45: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/45.jpg)
ApplicationApplication
AppFabric Caching Client
• Catalog data doesn’t change often• Unnecessary network cost to access from different
machines• Solution – Local Cache
Reference Data – Performance
Put(K2, v3)
Routing Table
Cache2Cache1
Primary for K2,V2
K2, V2
Primary for K1,V1
K1, V1
Cache3
Primary for K3,V3
K3, V3
AppFabric Caching Client
Local CacheRouting Table
K2, V2
Get(K2)Get(K2)
K2, V3
![Page 46: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/46.jpg)
• Enumerate all items in Region• Bulk Fetch from region (New in
Beta)• 200-300k ops per second
Reference Data – Bulk Get
Catalog.BulkGet( new List<string>(){“toy-101”, “toy-102”} ,
“toyRegion”);
![Page 47: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/47.jpg)
ApplicationApplication
(K2, V2)
Cache2Cache1 Cache3
Primary for
Activity Data - Availability
Get(K2)
Primary for Primary for
K3, V3
AppFabric Caching ClientRouting Table
K2
, V2
PUT
Secondary for
K2, V2
K1, V1
Secondary for
K3, V3
Secondary for
K1, V1
AppFabric Caching ClientRouting Table
K2, V2
Replication Agent
![Page 48: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/48.jpg)
• GetCacheItem returns a version object• Every update to an object internally increments it's version• Supply the version obtained along with the Put/Remove• Put/Remove will succeed only if the passed in version matches the
version in the cache
Resource Data - Optimistic Locking
Version Based Update
Time Client1 Client2 (Different Thread or process)
T0 CacheItem item = catalog.GetCacheItem(“PlayerRegion”, ”Zune”);
CacheItem item = catalog.GetCacheItem(“PlayerRegion”, ”Zune”);
T1 ((ZuneObject)item.Object).inventory --;
((ZuneObject)item.Object).inventory--;
T2 catalog.Put(“PlayerRegion”, “Zune”, item.Object, item.Version);
T3 catalog.Put(“PlayerRegion”, “Zune”, item.Object, item.Version);// Version mismatch// Client must retry again
Two clients access the same item
Both update the item
Second Client gets in first; put succeeds because item version matches;
atomically increments the version
First client tries put;Fails because the versions
don’t match
![Page 49: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/49.jpg)
K1
• New in Beta – Take locks on non-existent keys• Allows you to co-ordinate creating new object
amongst multiple clients
Resource Data - Pessimistic Locking
Client1: GetAndLock ("k1")
Client2: GetAndLock ("k1")
Client3: Get ("k1")
Regular Get succeeds
GetAndLock gets lock handle
Other GetAndLock on same item fails
![Page 50: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/50.jpg)
• Cache Event notifications• Register on any client to notify
changes• Batched Notifications – (New in
Beta)
Resource/Activity Data – Tracking Changes
DataCache.RegisterCacheLevelCallback( int filter, DataCacheChangeCallback delegate);
DataCache.RegisterRegionLevelCallback( String region, int filter, DataCacheChangeCallback delegate);
DataCache.RegisterKeyLevelCallback( String region, String key, int filter, DataCacheChangeCallback delegate);
![Page 51: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/51.jpg)
Application
Cache2Cache1
Primary for
K2, V2
Primary for
K1, V1
Cache3
Primary for
K3, V3
Scalable Notifications
AppFabric Caching ClientRouting Table
Register Notification for
Key “K3"
Map Keys to Partition
(say P2)
Poll Required
Nodes
Nodes Return List of
ChangesLSN Order
Partition: P2
Last LSN: 19
Call DelegateStore Last LSN
Change Log
Partition P1
Add K2Del K32
Change Log (Partition P2)
Del K32Del K43
Change Log
33 Add K134 Del
K22
![Page 52: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/52.jpg)
DemoProgramming Model
![Page 53: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/53.jpg)
AppFabric Caching Futures
![Page 54: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/54.jpg)
AppFabric Caching and Azure Platform
![Page 55: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/55.jpg)
• You are a popular Online Pharmacy!!• Lots of Users!
• Irregular & Elastic Demands
• Solution - Move to the Services World!• Application on-premise with data on SQL Azure• Application on Windows Azure with data on
SQL Azure• Application on Windows Azure with on-premise
database connected by AppFabric Service Bus
Application Growth
![Page 56: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/56.jpg)
App on-premise; Data on SQLAzure
… ASP.Net Web Tier Application Application Application
AppFabric Caching Access
Layer
AppFabric Caching Access Layer
AppFabric Caching Access
Layer
Cach
ing
Work
er
Role
Cach
ing
Serv
ice
Cach
ing
Serv
ice
Cach
ing
Serv
ice Application &
AppFabric Caching
deployed On-premise
Data on SQL Azure
![Page 57: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/57.jpg)
App on Windows Azure; Data on SQL Azure
…Web Role
Application Application ApplicationAppFabric
Caching Access Layer
AppFabric Caching Access Layer
AppFabric Caching Access
Layer
Cach
ing
Work
er
Role
Cach
ing
Serv
ice
Cach
ing
Serv
ice
Application & AppFabric
Caching on Windows Azure
Data on SQL Azure
AppFabric Caching Worker
Role
Cach
ing
Serv
ice
![Page 58: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/58.jpg)
App on Windows Azure; Data on-premise
…Web Role
Application Application ApplicationAppFabric
Caching Access Layer
AppFabric Caching Access Layer
AppFabric Caching Access
Layer
Cach
ing
Work
er
Role
Cach
ing
Serv
ice
Cach
ing
Serv
ice
Application & AppFabric
Caching on Windows Azure
AppFabric Caching Worker
Role
Cach
ing
Serv
ice
Data on-premises
AppFabric Service
Bus
![Page 59: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/59.jpg)
ASP.NET and Persistence
![Page 60: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/60.jpg)
• ASP.Net extends cache surface .Net 4.0
• Integrate with the Application Cache• System.Runtime.Caching namespace• AppFabric Caching will be a provider for
this namespace
• Granular Session Updates• IPartialSessionState lists keys changed
• Extensible Output Cache Provider• Output Caching not limited to single node
Integration with ASP.Net
![Page 61: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/61.jpg)
• Callback for read-through, write-behind • Specified at Named Cache Level• Read-Through• Called when item not present in cache• Callback returns the object/serialized bytes
• Write-Behind• Writes to cache are queued • Callback called asynchronously in batches• Re-tries upon failure
• Bulk Access APIs
Future – Cache Through
![Page 62: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/62.jpg)
GridDynamics testing on CTP1
50 times improvement in some cases
HPC Integration
Scratch
AppFabric Caching
Intermediate
Store
RollupOperation
Final
Resu
lts
Keys
SplitMethod
Mark
et
Data
Central Market Data Store(~1 TB Tick
Data)
Final Results Store
Job Input
ScratchCalculationOperation
AppFabric Caching
Market Data
![Page 63: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/63.jpg)
Summary
![Page 64: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/64.jpg)
Web Scenarios
• Distributed/Global object cache• Low latency
access• High scale• Availability
• Cache for reference and activity data
• Scale IIS/ASP.Net applications
Enterprise / HPC
Scenarios
• Persistence• LINQ
enabled cache• Integrate with
HPC server• Heterogeneous
client support• Co-locate
compute and data
Software + Services
Scenarios
• Application Cache for Windows Azure
• More data services• BI, Streaming,
Reporting• OData (REST API)
AppFabric Caching Vision – Cache for all your data
![Page 65: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/65.jpg)
http://msdn.microsoft.com/AppFabric
AppFabric on MSDN
![Page 66: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/66.jpg)
Q & A
![Page 67: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/67.jpg)
A sua opinião é importante!Complete o questionário de avaliação e devolva-o à saida.
![Page 68: TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9](https://reader035.vdocuments.net/reader035/viewer/2022070315/554f6c68b4c905bb178b4ebf/html5/thumbnails/68.jpg)