Como garantir a escalabilidade da sua camada de dados com o Windows Server AppFabricWIN304NunoGodinhoPartner & CTO @ ITech4Allnuno.godinho@itech4all.com@NunoGodinho
Session abstractSession title
Speaker Bio and PhotoSpeaker Name
Nuno Filipe GodinhoPartner & CTO @ ITech4allMail: 	Nuno.Godinho@itech4all.comNuno.Godinho@sapo.ptBlogs:	http://pontonetpt.com/blogs/nunogodinhohttp://xamlpt.com/blogs/nunogodinhohttp://weblogs.asp.net/nunogodinhohttp://msmvps.org/blogs/nunogodinhoTwitter: @NunoGodinhoAbout Me
The Problem!Caching with the Windows Server AppFabricOverview and Programming ModelCaching FuturesSummaryQ&AAgenda
The Problem
Online Pharmacy
Typical Web Architecture
Typical ArchitectureUsersLoad BalancerSticky RoutingApplication/ Web Tier Application Application ApplicationASP.Net App Session Cart Hosted in memoryCatalog sits in DatabaseData TierDatabase
And then… Flu Hits!
You become a popular Pharmacy!Web Site’s too slow!!UsersWhere did my shopping cart go?Web Tier(ASP.Net)… Application Application ApplicationServers are crashingDatabase is hot!!Data TierDatabase
Possible Solution
Data Near ProcessingCacheCacheBrowserSmart ClientCacheWeb ServiceASP.NETCacheCacheDatabase
Cache is scoped to machine  / processMachines dieProcesses recycleCache memory is limitedGood but…
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?1Some features may require certain editions of Windows Server What if?
Caching with the Windows Server AppFabric
What Is It?
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 cacheWhat is AppFabric Caching?Caching clients can be across machines or processesClients Access the Cache as if it was a large single cacheUnified Cache ViewCache Layer distributes data across the various cache nodes
Where does it fit?UsersCaching Access LayerCaching Access LayerCaching Access Layer…Web Tier(ASP.Net) Application Application ApplicationCaching ServiceCaching ServiceCaching ServiceCache TierData TierDatabaseCloud
AppFabric Cache
Why AppFabric Caching
1. Share Data Across ApplicationsNo more sticky routing2. Performance3. Scale out by adding more boxes4. High Availability  Protect from Web & Cache Server FailureWhy use AppFabric Caching?
5. Proven Technology - Associated Press Custom News live on CTP3Why 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.5. Proven Technology Contd..Dell.com uses AppFabric caching!Channel Partner Portal uses AppFabric cachingProvides 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 productionWhy AppFabric Caching?
6. Do all this at low cost!Why AppFabric Caching? – Best yetUse 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.AppFabricMONITORINGWORKFLOW HOSTINGCACHINGACCESS CONTROLSERVICE HOSTINGSERVICE BUSMANAGEMENTMULTI-TENANT SCALE OUTHIGH AVAILABILITY
What Stage Is It In?
When Can I Get Windows Server AppFabric ?Azure CTPPost RTMRTM2010 Wave 1* CY10CTP2PDC ‘08CTP1June ‘08CTP3Mar ‘09BetaPDC
Nov ‘09(Formerly Called “Velocity”)
Installation
Overview and Programming AppFabric Caching
Deployment and Access API
DeploymentUsersUpdate Web.configCopy Client DLLs Application Application Application…Caching Access LayerCaching Access LayerCaching Access Layer<hosts>      <host name="BL1CDB8083714“cachePort="22233" cacheHostName="DistributedCacheService"/>     …..   </hosts> <localCacheisEnabled=“true"  ../><security … />.NET 3.5 SP1 OR .NET 4Caching ServiceCaching  ServiceCaching  Service.NET 4Configure AppFabricInstall AppFabricConfiguration Store
AppFabric Caching CodePlex Toolhttp://mdcadmintool.codeplex.com/
Domain Based Security OptionDomain Account / Local Account based AuthenticationOnly authorized servers can join the clusterOnly authorized clients can connect to the clusterTransport Level SecurityTurn on/off Signing or EncryptionCan turn off Cache SecurityUse Firewalls, IPSec,  VLANs to protect cacheSecurity (new since Beta) grant-cacheallowedclientaccount  RedDomain\Machine1$  grant-cacheallowedclientaccount  RedDomain\John
Centralized administration through powershellPerfmon to monitor the cache (new in Beta)Logging Default ETW, support for file logs Administration & Monitoring
// Create instance of cachefactory (reads appconfig)DataCacheFactoryfac = 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");
AppFabric Caching Logical HierarchyAppFabric Caching ServiceAppFabric Caching ServiceAppFabric Caching ServiceAppFabric Caching ServiceNamed Cache :                    Product CatalogNamed Cache :                    Electronics InventoryRegions Key   Payload     Tags     Region A121  xxxx    “Toy” “Child”123 yyyy   “Toy” “Chair”.. Machine -> Cache Host -> Named Caches -> Regions -> Cache Items -> ObjectsHostPhysical processes hosting AppFabric Caching instance.Named CachesCan span across machinesDefined in the configuration fileCache ItemKey, Payload (Object ), Tags,  TTL, Timestamps, VersionRegionsPhysically co-located Container of Cache ItemsMay be implicit or explicitly created
Add Tags to ItemsTag Search on Default Regions (New in Beta)Access APIs – Tagging ItemsTag 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);
Usage Pattern – Cache Aside  (Explicit Caching)//  Read from CacheToy toyObj = (Toy)catalog.Get("toy-101"); ApplicationCaching Access Layer// If Not present in the cacheif (toyObj == null){   // Read from backend..   toyObj = ReadFromDatabase();   // Populate Cachecatalog.Put("toy-101", toyObj);    return toyObj;}Caching ServiceDatabase
How does it Scale?
Data Distribution - Partitioned CacheUsers…GHIDEFABCWeb TierASP.Net AppASP.Net AppASP.Net AppCaching ClientCaching ClientCaching ClientEGBDHAICFCache  ServiceCache  ServiceCache TierCache  ServiceScale on Data Size -More machines => More memory to cacheScale on Cache Throughput  -More machines => keys distributed across more machines => better throughput
Scale Test OutputLoad1 Cache ServerAs load increases, throughput fails to scale latency increasesCaching TierThroughputLatency
Add Second Cache ServerLoadLoad MaxThroughput increasesLatency decreasesCaching TierThroughputLatency
Add Third Cache ServerLoadCaching TierThroughputLatency
GridDynamics Blog Engine TestsMore info at  http://blogs.msdn.com/velocity/ orhttp://www.griddynamics.com/velocity
Features
Classify your data Reference or Activity or Resource DataExamine RequirementsPerformance - Throughput & Latency	Consistency – Tolerable stalenessEviction  - Is the data evictable?Security - Is there any secure data?Availability – Survive node or cluster failures?Use the right features!
Types of DataGrocery Shop Web Tier     Shopping CartPharmacy InventoryDistributed CachePharmacy Catalog
Catalog data doesn’t change oftenUnnecessary network cost to access from different machinesSolution – Local CacheApplicationApplicationReference Data – PerformanceGet(K2)Get(K2)Put(K2, v3)AppFabric Caching ClientAppFabric Caching ClientLocal CacheRouting TableRouting TableK2, V2K2, V2Cache2Cache3Cache1Primary for K1,V1Primary for K3,V3Primary for K2,V2K1, V1K2, V3K3, V3
Enumerate all items in RegionBulk Fetch from region (New in Beta)200-300k ops per secondReference Data – Bulk GetCatalog.BulkGet(      new List<string>(){“toy-101”, “toy-102”} ,      “toyRegion”);
ApplicationPUTApplicationGet(K2)AppFabric Caching ClientAppFabric Caching ClientRouting TableRouting TableCache1Cache2Cache3Activity Data - AvailabilityPrimary forPrimary forPrimary for Replication Agent(K2, V2)K3, V3K2, V2K1, V1K2, V2K2, V2Secondary forSecondary for Secondary forK3, V3K1, V1
GetCacheItem returns a version objectEvery update to an object internally increments it's versionSupply the version obtained along with the Put/RemovePut/Remove will succeed only if the passed in version matches the version in the cache Resource Data - Optimistic LockingTwo clients access the same item Both update the itemSecond Client gets in first; put succeeds because item version matches; atomically increments the versionFirst client tries put;Fails because the versions don’t match
Resource Data - Pessimistic LockingClient1: GetAndLock ("k1")Client3: Get ("k1")Client2: GetAndLock ("k1")GetAndLock gets lock handleRegular Get succeeds Other GetAndLock on same item failsNew in Beta – Take locks on non-existent keysAllows you to co-ordinate creating new object amongst multiple clientsK1
Cache Event notificationsRegister on any client to notify changesBatched Notifications – (New in Beta)Resource/Activity Data – Tracking ChangesDataCache.RegisterCacheLevelCallback(int filter, DataCacheChangeCallback delegate); DataCache.RegisterRegionLevelCallback(      String region, int filter, DataCacheChangeCallback delegate); DataCache.RegisterKeyLevelCallback(      String region, String key, int filter, DataCacheChangeCallback delegate);
Register Notification for Key “K3"Call DelegateStore Last LSN Map Keys to Partition (say P2)ApplicationAppFabric Caching ClientPartition: P2Last LSN: 19Routing TablePoll Required NodesNodes Return List of ChangesLSN OrderCache2Cache3Cache1K2, V2Primary forPrimary forPrimary forChange Log (Partition P2)Del  K32Del  K43Change LogPartition P1Add K2Del  K32Change Log33 Add K134 Del  K22K1, V1K3, V3Scalable Notifications
Programming Model
AppFabric Caching Futures
AppFabric Caching and Azure Platform
You are a popular Online Pharmacy!!Lots of Users!Irregular & Elastic DemandsSolution - Move to the Services World!Application on-premise with data on SQL AzureApplication on Windows Azure with data on SQL AzureApplication on Windows Azure with on-premise database connected by AppFabric Service BusApplication Growth
App on-premise; Data on SQLAzure…ASP.Net Web Tier Application Application ApplicationAppFabric Caching Access LayerAppFabric Caching Access LayerAppFabric Caching Access LayerApplication & AppFabric Caching deployed On-premiseCaching  ServiceCaching  ServiceCaching  ServiceCaching Worker RoleData on SQL Azure
App on Windows Azure; Data on SQL AzureWeb Role… Application Application ApplicationAppFabric Caching Access LayerAppFabric Caching Access LayerAppFabric Caching Access LayerApplication & AppFabric Caching on Windows AzureCaching  ServiceCaching  ServiceCaching  ServiceCaching Worker RoleAppFabric Caching Worker RoleData on SQL Azure
App on Windows Azure; Data on-premiseWeb Role… Application Application ApplicationAppFabric Caching Access LayerAppFabric Caching Access LayerAppFabric Caching Access LayerAppFabric Service BusApplication & AppFabric Caching on Windows AzureCaching  ServiceCaching  ServiceCaching  ServiceCaching Worker RoleAppFabric Caching Worker RoleData on-premises
ASP.NET and Persistence
ASP.Net extends cache surface .Net 4.0Integrate with the Application CacheSystem.Runtime.Caching namespaceAppFabric Caching will be a provider for this namespaceGranular Session UpdatesIPartialSessionState lists keys changedExtensible Output Cache ProviderOutput Caching not limited to single nodeIntegration with ASP.Net
Callback for read-through, write-behind Specified at Named Cache LevelRead-ThroughCalled when item not present in cacheCallback returns the object/serialized bytesWrite-BehindWrites to cache are queued Callback called asynchronously in batchesRe-tries upon failureBulk Access APIsFuture – Cache Through
HPC IntegrationFinal Results StoreAppFabric CachingMarket DataCentral Market Data Store(~1 TB Tick Data)FinalResultsAppFabric CachingIntermediateStoreMarket DataScratchJob InputRollupOperationSplitMethodScratchKeysCalculationOperationGridDynamics testing    on CTP1   50 times improvement   in some cases

TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9

  • 1.
    Como garantir aescalabilidade da sua camada de dados com o Windows Server AppFabricWIN304NunoGodinhoPartner & CTO @ ITech4Allnuno.godinho@itech4all.com@NunoGodinho
  • 2.
  • 3.
    Speaker Bio andPhotoSpeaker Name
  • 4.
    Nuno Filipe GodinhoPartner& CTO @ ITech4allMail: Nuno.Godinho@itech4all.comNuno.Godinho@sapo.ptBlogs: http://pontonetpt.com/blogs/nunogodinhohttp://xamlpt.com/blogs/nunogodinhohttp://weblogs.asp.net/nunogodinhohttp://msmvps.org/blogs/nunogodinhoTwitter: @NunoGodinhoAbout Me
  • 5.
    The Problem!Caching withthe Windows Server AppFabricOverview and Programming ModelCaching FuturesSummaryQ&AAgenda
  • 6.
  • 7.
  • 8.
  • 9.
    Typical ArchitectureUsersLoad BalancerStickyRoutingApplication/ Web Tier Application Application ApplicationASP.Net App Session Cart Hosted in memoryCatalog sits in DatabaseData TierDatabase
  • 10.
  • 11.
    You become apopular Pharmacy!Web Site’s too slow!!UsersWhere did my shopping cart go?Web Tier(ASP.Net)… Application Application ApplicationServers are crashingDatabase is hot!!Data TierDatabase
  • 12.
  • 13.
    Data Near ProcessingCacheCacheBrowserSmartClientCacheWeb ServiceASP.NETCacheCacheDatabase
  • 14.
    Cache is scopedto machine / processMachines dieProcesses recycleCache memory is limitedGood but…
  • 15.
    You could haveas 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?1Some features may require certain editions of Windows Server What if?
  • 16.
    Caching with theWindows Server AppFabric
  • 17.
  • 18.
    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 cacheWhat is AppFabric Caching?Caching clients can be across machines or processesClients Access the Cache as if it was a large single cacheUnified Cache ViewCache Layer distributes data across the various cache nodes
  • 19.
    Where does itfit?UsersCaching Access LayerCaching Access LayerCaching Access Layer…Web Tier(ASP.Net) Application Application ApplicationCaching ServiceCaching ServiceCaching ServiceCache TierData TierDatabaseCloud
  • 20.
  • 21.
  • 22.
    1. Share DataAcross ApplicationsNo more sticky routing2. Performance3. Scale out by adding more boxes4. High Availability Protect from Web & Cache Server FailureWhy use AppFabric Caching?
  • 23.
    5. Proven Technology- Associated Press Custom News live on CTP3Why use AppFabric Caching?AppFabric caching capabilities caches metadata and news for widgets
  • 24.
    Serves 16 millionhits per day
  • 25.
    Increased the amountof cached data 6 times.5. Proven Technology Contd..Dell.com uses AppFabric caching!Channel Partner Portal uses AppFabric cachingProvides 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 productionWhy AppFabric Caching?
  • 26.
    6. Do allthis at low cost!Why AppFabric Caching? – Best yetUse inexpensive commodity hardware
  • 27.
    Ships as partof Windows Server AppFabric 2010 Wave 1 * Different Features of the cache might require higher level SKUs of Windows Server.AppFabricMONITORINGWORKFLOW HOSTINGCACHINGACCESS CONTROLSERVICE HOSTINGSERVICE BUSMANAGEMENTMULTI-TENANT SCALE OUTHIGH AVAILABILITY
  • 28.
  • 29.
    When Can IGet Windows Server AppFabric ?Azure CTPPost RTMRTM2010 Wave 1* CY10CTP2PDC ‘08CTP1June ‘08CTP3Mar ‘09BetaPDC
  • 30.
  • 31.
  • 32.
    Overview and ProgrammingAppFabric Caching
  • 33.
  • 34.
    DeploymentUsersUpdate Web.configCopy ClientDLLs Application Application Application…Caching Access LayerCaching Access LayerCaching Access Layer<hosts> <host name="BL1CDB8083714“cachePort="22233" cacheHostName="DistributedCacheService"/> ….. </hosts> <localCacheisEnabled=“true" ../><security … />.NET 3.5 SP1 OR .NET 4Caching ServiceCaching ServiceCaching Service.NET 4Configure AppFabricInstall AppFabricConfiguration Store
  • 35.
    AppFabric Caching CodePlexToolhttp://mdcadmintool.codeplex.com/
  • 36.
    Domain Based SecurityOptionDomain Account / Local Account based AuthenticationOnly authorized servers can join the clusterOnly authorized clients can connect to the clusterTransport Level SecurityTurn on/off Signing or EncryptionCan turn off Cache SecurityUse Firewalls, IPSec, VLANs to protect cacheSecurity (new since Beta) grant-cacheallowedclientaccount  RedDomain\Machine1$ grant-cacheallowedclientaccount  RedDomain\John
  • 37.
    Centralized administration throughpowershellPerfmon to monitor the cache (new in Beta)Logging Default ETW, support for file logs Administration & Monitoring
  • 38.
    // Create instanceof cachefactory (reads appconfig)DataCacheFactoryfac = 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");
  • 39.
    AppFabric Caching LogicalHierarchyAppFabric Caching ServiceAppFabric Caching ServiceAppFabric Caching ServiceAppFabric Caching ServiceNamed Cache : Product CatalogNamed Cache : Electronics InventoryRegions Key Payload Tags Region A121 xxxx “Toy” “Child”123 yyyy “Toy” “Chair”.. Machine -> Cache Host -> Named Caches -> Regions -> Cache Items -> ObjectsHostPhysical processes hosting AppFabric Caching instance.Named CachesCan span across machinesDefined in the configuration fileCache ItemKey, Payload (Object ), Tags, TTL, Timestamps, VersionRegionsPhysically co-located Container of Cache ItemsMay be implicit or explicitly created
  • 40.
    Add Tags toItemsTag Search on Default Regions (New in Beta)Access APIs – Tagging ItemsTag 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);
  • 41.
    Usage Pattern –Cache Aside (Explicit Caching)// Read from CacheToy toyObj = (Toy)catalog.Get("toy-101"); ApplicationCaching Access Layer// If Not present in the cacheif (toyObj == null){ // Read from backend.. toyObj = ReadFromDatabase(); // Populate Cachecatalog.Put("toy-101", toyObj); return toyObj;}Caching ServiceDatabase
  • 42.
  • 43.
    Data Distribution -Partitioned CacheUsers…GHIDEFABCWeb TierASP.Net AppASP.Net AppASP.Net AppCaching ClientCaching ClientCaching ClientEGBDHAICFCache ServiceCache ServiceCache TierCache ServiceScale on Data Size -More machines => More memory to cacheScale on Cache Throughput -More machines => keys distributed across more machines => better throughput
  • 44.
    Scale Test OutputLoad1Cache ServerAs load increases, throughput fails to scale latency increasesCaching TierThroughputLatency
  • 45.
    Add Second CacheServerLoadLoad MaxThroughput increasesLatency decreasesCaching TierThroughputLatency
  • 46.
    Add Third CacheServerLoadCaching TierThroughputLatency
  • 47.
    GridDynamics Blog EngineTestsMore info at http://blogs.msdn.com/velocity/ orhttp://www.griddynamics.com/velocity
  • 48.
  • 49.
    Classify your dataReference or Activity or Resource DataExamine RequirementsPerformance - Throughput & Latency Consistency – Tolerable stalenessEviction - Is the data evictable?Security - Is there any secure data?Availability – Survive node or cluster failures?Use the right features!
  • 50.
    Types of DataGroceryShop Web Tier Shopping CartPharmacy InventoryDistributed CachePharmacy Catalog
  • 51.
    Catalog data doesn’tchange oftenUnnecessary network cost to access from different machinesSolution – Local CacheApplicationApplicationReference Data – PerformanceGet(K2)Get(K2)Put(K2, v3)AppFabric Caching ClientAppFabric Caching ClientLocal CacheRouting TableRouting TableK2, V2K2, V2Cache2Cache3Cache1Primary for K1,V1Primary for K3,V3Primary for K2,V2K1, V1K2, V3K3, V3
  • 52.
    Enumerate all itemsin RegionBulk Fetch from region (New in Beta)200-300k ops per secondReference Data – Bulk GetCatalog.BulkGet( new List<string>(){“toy-101”, “toy-102”} , “toyRegion”);
  • 53.
    ApplicationPUTApplicationGet(K2)AppFabric Caching ClientAppFabricCaching ClientRouting TableRouting TableCache1Cache2Cache3Activity Data - AvailabilityPrimary forPrimary forPrimary for Replication Agent(K2, V2)K3, V3K2, V2K1, V1K2, V2K2, V2Secondary forSecondary for Secondary forK3, V3K1, V1
  • 54.
    GetCacheItem returns aversion objectEvery update to an object internally increments it's versionSupply the version obtained along with the Put/RemovePut/Remove will succeed only if the passed in version matches the version in the cache Resource Data - Optimistic LockingTwo clients access the same item Both update the itemSecond Client gets in first; put succeeds because item version matches; atomically increments the versionFirst client tries put;Fails because the versions don’t match
  • 55.
    Resource Data -Pessimistic LockingClient1: GetAndLock ("k1")Client3: Get ("k1")Client2: GetAndLock ("k1")GetAndLock gets lock handleRegular Get succeeds Other GetAndLock on same item failsNew in Beta – Take locks on non-existent keysAllows you to co-ordinate creating new object amongst multiple clientsK1
  • 56.
    Cache Event notificationsRegisteron any client to notify changesBatched Notifications – (New in Beta)Resource/Activity Data – Tracking ChangesDataCache.RegisterCacheLevelCallback(int filter, DataCacheChangeCallback delegate); DataCache.RegisterRegionLevelCallback( String region, int filter, DataCacheChangeCallback delegate); DataCache.RegisterKeyLevelCallback( String region, String key, int filter, DataCacheChangeCallback delegate);
  • 57.
    Register Notification forKey “K3"Call DelegateStore Last LSN Map Keys to Partition (say P2)ApplicationAppFabric Caching ClientPartition: P2Last LSN: 19Routing TablePoll Required NodesNodes Return List of ChangesLSN OrderCache2Cache3Cache1K2, V2Primary forPrimary forPrimary forChange Log (Partition P2)Del K32Del K43Change LogPartition P1Add K2Del K32Change Log33 Add K134 Del K22K1, V1K3, V3Scalable Notifications
  • 58.
  • 59.
  • 60.
    AppFabric Caching andAzure Platform
  • 61.
    You are apopular Online Pharmacy!!Lots of Users!Irregular & Elastic DemandsSolution - Move to the Services World!Application on-premise with data on SQL AzureApplication on Windows Azure with data on SQL AzureApplication on Windows Azure with on-premise database connected by AppFabric Service BusApplication Growth
  • 62.
    App on-premise; Dataon SQLAzure…ASP.Net Web Tier Application Application ApplicationAppFabric Caching Access LayerAppFabric Caching Access LayerAppFabric Caching Access LayerApplication & AppFabric Caching deployed On-premiseCaching ServiceCaching ServiceCaching ServiceCaching Worker RoleData on SQL Azure
  • 63.
    App on WindowsAzure; Data on SQL AzureWeb Role… Application Application ApplicationAppFabric Caching Access LayerAppFabric Caching Access LayerAppFabric Caching Access LayerApplication & AppFabric Caching on Windows AzureCaching ServiceCaching ServiceCaching ServiceCaching Worker RoleAppFabric Caching Worker RoleData on SQL Azure
  • 64.
    App on WindowsAzure; Data on-premiseWeb Role… Application Application ApplicationAppFabric Caching Access LayerAppFabric Caching Access LayerAppFabric Caching Access LayerAppFabric Service BusApplication & AppFabric Caching on Windows AzureCaching ServiceCaching ServiceCaching ServiceCaching Worker RoleAppFabric Caching Worker RoleData on-premises
  • 65.
  • 66.
    ASP.Net extends cachesurface .Net 4.0Integrate with the Application CacheSystem.Runtime.Caching namespaceAppFabric Caching will be a provider for this namespaceGranular Session UpdatesIPartialSessionState lists keys changedExtensible Output Cache ProviderOutput Caching not limited to single nodeIntegration with ASP.Net
  • 67.
    Callback for read-through,write-behind Specified at Named Cache LevelRead-ThroughCalled when item not present in cacheCallback returns the object/serialized bytesWrite-BehindWrites to cache are queued Callback called asynchronously in batchesRe-tries upon failureBulk Access APIsFuture – Cache Through
  • 68.
    HPC IntegrationFinal ResultsStoreAppFabric CachingMarket DataCentral Market Data Store(~1 TB Tick Data)FinalResultsAppFabric CachingIntermediateStoreMarket DataScratchJob InputRollupOperationSplitMethodScratchKeysCalculationOperationGridDynamics testing on CTP1 50 times improvement in some cases
  • 69.
  • 70.
    AppFabric Caching Vision– Cache for all your data
  • 71.

Editor's Notes

  • #29 MSCUIBusiness Application Template
  • #33 MSCUIBusiness Application Template
  • #56 MSCUIBusiness Application Template