SlideShare a Scribd company logo
1 of 68
Como garantir a escalabilidade da sua camada de dados com o Windows Server AppFabric WIN304 NunoGodinho Partner & CTO @ ITech4All nuno.godinho@itech4all.com @NunoGodinho
Session abstract Session title
Speaker Bio and Photo Speaker Name
Nuno Filipe Godinho Partner & CTO @ ITech4all Mail: 	Nuno.Godinho@itech4all.com Nuno.Godinho@sapo.pt Blogs:	http://pontonetpt.com/blogs/nunogodinho http://xamlpt.com/blogs/nunogodinho http://weblogs.asp.net/nunogodinho http://msmvps.org/blogs/nunogodinho Twitter: @NunoGodinho About Me
The Problem! Caching with the Windows Server AppFabric Overview and Programming Model Caching Futures Summary Q&A Agenda
The Problem
Online Pharmacy
Typical Web Architecture
Typical Architecture Users Load Balancer Sticky Routing Application / Web Tier  Application  Application  Application ASP.Net App  Session Cart Hosted in memory Catalog sits in Database Data Tier Database
And then…  Flu Hits!
You become a popular Pharmacy! Web Site’s too slow!! Users Where did my shopping cart go? Web Tier (ASP.Net) …  Application  Application  Application Servers are crashing Database is hot!! Data Tier Database
Possible Solution
Data Near Processing Cache Cache Browser Smart Client Cache Web Service ASP.NET Cache Cache Database
Cache is scoped to machine  / process Machines die Processes recycle Cache memory is limited Good 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 cache What is AppFabric Caching? Caching clients can be across machines or processes Clients Access the Cache as if it was a large single cache Unified Cache View Cache Layer distributes data across the various cache nodes
Where does it fit? Users Caching Access Layer Caching Access Layer Caching Access Layer … Web Tier (ASP.Net)  Application  Application  Application Caching Service Caching Service Caching Service Cache Tier Data Tier Database Cloud
AppFabric Cache
Why AppFabric Caching
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?
5. Proven Technology - Associated Press Custom News live on CTP3 Why use AppFabric Caching? ,[object Object]
Serves 16 million hits per day
Increased the amount of cached data 6 times.,[object Object]
6. Do all this at low cost! Why AppFabric Caching? – Best yet ,[object Object]
Ships as part of Windows Server AppFabric 2010 Wave 1 * Different Features of the cache might require higher level SKUs of Windows Server. AppFabric MONITORING WORKFLOW HOSTING CACHING ACCESS CONTROL SERVICE HOSTING SERVICE BUS MANAGEMENT MULTI-TENANT  SCALE OUT HIGH AVAILABILITY
What Stage Is It In?
When Can I Get Windows Server AppFabric ? Azure CTP Post RTM RTM 2010 Wave 1 * CY10 CTP2 PDC ‘08 CTP1 June ‘08 CTP3 Mar ‘09 Beta ,[object Object]
Nov ‘09(Formerly Called “Velocity”)
Installation
Overview and Programming AppFabric Caching
Deployment and Access API
Deployment Users Update Web.config Copy Client DLLs  Application  Application  Application … Caching Access Layer Caching Access Layer Caching Access Layer <hosts>       <host name="BL1CDB8083714“ cachePort="22233"  cacheHostName="DistributedCacheService"/>      …..    </hosts>  <localCacheisEnabled=“true"  ../> <security … /> .NET 3.5 SP1 OR .NET 4 Caching Service Caching  Service Caching  Service .NET 4 Configure AppFabric Install AppFabric Configuration Store
AppFabric Caching CodePlex Tool http://mdcadmintool.codeplex.com/
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  RedDomainachine1$   grant-cacheallowedclientaccount  RedDomainohn
Centralized administration through powershell Perfmon 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 factory DataCache catalog = fac.GetCache("catalogcache"); AppFabric Caching API // Simple Get/Put catalog.Put("toy-101", new Toy("Puzzle", .,.)); // From the same or a different client Toy toyObj = (Toy)catalog.Get("toy-101"); // Region based Get/Put catalog.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 Hierarchy AppFabric Caching Service AppFabric Caching Service AppFabric Caching Service AppFabric Caching Service Named Cache :                    Product Catalog Named Cache :                    Electronics Inventory Regions  Key   Payload     Tags      Region A 121  xxxx    “Toy” “Child” 123 yyyy   “Toy” “Chair”..  Machine -> Cache Host -> Named Caches -> Regions -> Cache Items -> Objects Host Physical processes hosting AppFabric Caching instance. Named Caches Can span across machines Defined in the configuration file Cache Item Key, Payload (Object ), Tags,  TTL, Timestamps, Version Regions Physically co-located Container of Cache Items May be implicit or explicitly created
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 client List<KeyValuePair<string, object>> toys =  catalog.GetAnyMatchingTag("toyRegion", hotItem);
Usage Pattern – Cache Aside  (Explicit Caching) //  Read from Cache Toy toyObj = (Toy) catalog.Get("toy-101");  Application Caching Access Layer // If Not present in the cache if (toyObj == null) {    // Read from backend..    toyObj = ReadFromDatabase();    // Populate Cache catalog.Put("toy-101", toyObj);     return toyObj; } Caching Service Database
How does it Scale?
Data Distribution - Partitioned Cache Users … G H I D E F A B C Web Tier ASP.Net App ASP.Net App ASP.Net App Caching Client Caching Client Caching Client E G B D H A I C F Cache  Service Cache  Service Cache Tier Cache  Service Scale on Data Size -More machines => More memory to cache Scale on Cache Throughput  -More machines => keys distributed across more machines => better throughput
Scale Test Output Load 1 Cache Server As load increases,  throughput fails  to scale  latency increases Caching Tier Throughput Latency
Add Second Cache Server Load Load Max Throughput increases Latency decreases Caching Tier Throughput Latency
Add Third Cache Server Load Caching Tier Throughput Latency
GridDynamics Blog Engine Tests More info at  http://blogs.msdn.com/velocity/ or http://www.griddynamics.com/velocity
Features
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!
Types of Data Grocery Shop  Web Tier      Shopping Cart Pharmacy Inventory Distributed Cache Pharmacy Catalog
Catalog data doesn’t change often Unnecessary network cost to access from different machines Solution – Local Cache Application Application Reference Data – Performance Get(K2) Get(K2) Put(K2, v3) AppFabric Caching Client AppFabric Caching Client Local Cache Routing Table Routing Table K2, V2 K2, V2 Cache2 Cache3 Cache1 Primary for K1,V1 Primary for K3,V3 Primary for K2,V2 K1, V1 K2, V3 K3, V3
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”);
Application PUT Application Get(K2) AppFabric Caching Client AppFabric Caching Client Routing Table Routing Table Cache1 Cache2 Cache3 Activity Data - Availability Primary for Primary for Primary for  Replication Agent (K2, V2) K3, V3 K2, V2 K1, V1 K2, V2 K2, V2 Secondary for Secondary for  Secondary for K3, V3 K1, V1
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 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
Resource Data - Pessimistic Locking Client1:  GetAndLock ("k1") Client3:  Get ("k1") Client2:  GetAndLock ("k1") GetAndLock gets lock handle Regular Get succeeds  Other GetAndLock on same item fails New in Beta – Take locks on non-existent keys Allows you to co-ordinate creating new object amongst multiple clients K1
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);
Register Notification for Key “K3" Call Delegate Store Last LSN  Map Keys to Partition (say P2) Application AppFabric Caching Client Partition: P2 Last LSN: 19 Routing Table Poll Required Nodes Nodes Return List of Changes LSN Order Cache2 Cache3 Cache1 K2, V2 Primary for Primary for Primary for Change Log (Partition P2) Del  K32 Del  K43 Change Log Partition P1 Add K2 Del  K32 Change Log 33 Add K1 34 Del  K22 K1, V1 K3, V3 Scalable Notifications
Programming Model
AppFabric Caching Futures
AppFabric Caching and Azure Platform
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
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 Application & AppFabric Caching deployed On-premise Caching  Service Caching  Service Caching  Service Caching Worker Role Data on SQL Azure
App on Windows Azure; Data on SQL Azure Web Role …  Application  Application  Application AppFabric Caching Access Layer AppFabric Caching Access Layer AppFabric Caching Access Layer Application & AppFabric Caching on Windows Azure Caching  Service Caching  Service Caching  Service Caching Worker Role AppFabric Caching Worker Role Data on SQL Azure
App on Windows Azure; Data on-premise Web Role …  Application  Application  Application AppFabric Caching Access Layer AppFabric Caching Access Layer AppFabric Caching Access Layer AppFabric Service Bus Application & AppFabric Caching on Windows Azure Caching  Service Caching  Service Caching  Service Caching Worker Role AppFabric Caching Worker Role Data on-premises
ASP.NET and Persistence
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
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
HPC Integration Final Results Store AppFabric Caching Market Data Central Market Data Store (~1 TB Tick Data) Final Results AppFabric Caching Intermediate Store Market Data Scratch Job  Input Rollup Operation Split Method Scratch Keys Calculation Operation GridDynamics testing     on CTP1    50 times improvement    in some cases

More Related Content

Viewers also liked

Deepening relationship with god PDYD presentation
Deepening relationship with god PDYD presentationDeepening relationship with god PDYD presentation
Deepening relationship with god PDYD presentationrameshv2801
 
Tips & Tricks On Architecting Windows Azure For Costs
Tips & Tricks On Architecting Windows Azure For CostsTips & Tricks On Architecting Windows Azure For Costs
Tips & Tricks On Architecting Windows Azure For CostsNuno Godinho
 
Extensibility with sl4 and mef (en)
Extensibility with sl4 and mef (en)Extensibility with sl4 and mef (en)
Extensibility with sl4 and mef (en)Nuno Godinho
 
TechDays 2010 Portugal - Introduction to Silverlight 4.0 16x9
TechDays 2010 Portugal - Introduction to Silverlight 4.0 16x9TechDays 2010 Portugal - Introduction to Silverlight 4.0 16x9
TechDays 2010 Portugal - Introduction to Silverlight 4.0 16x9Nuno Godinho
 
TechDays 2010 Portugal - WCF RIA Services 16x9
TechDays 2010 Portugal - WCF RIA Services 16x9TechDays 2010 Portugal - WCF RIA Services 16x9
TechDays 2010 Portugal - WCF RIA Services 16x9Nuno Godinho
 
TechDays 2010 Portugal - Entity Framework 4.0 and Beyond
TechDays 2010 Portugal - Entity Framework 4.0 and BeyondTechDays 2010 Portugal - Entity Framework 4.0 and Beyond
TechDays 2010 Portugal - Entity Framework 4.0 and BeyondNuno Godinho
 
TechDays 2010 Portugal - Event Driven Architectures - 16x9
TechDays 2010 Portugal - Event Driven Architectures - 16x9TechDays 2010 Portugal - Event Driven Architectures - 16x9
TechDays 2010 Portugal - Event Driven Architectures - 16x9Nuno Godinho
 
Leadership Of Christ
Leadership Of ChristLeadership Of Christ
Leadership Of Christrameshv2801
 
Architecture Best Practices on Windows Azure
Architecture Best Practices on Windows AzureArchitecture Best Practices on Windows Azure
Architecture Best Practices on Windows AzureNuno Godinho
 
Windows Azure Security & Compliance
Windows Azure Security & ComplianceWindows Azure Security & Compliance
Windows Azure Security & ComplianceNuno Godinho
 
Youth Retreat Youth Gift To Community
Youth Retreat Youth Gift To CommunityYouth Retreat Youth Gift To Community
Youth Retreat Youth Gift To Communityrameshv2801
 
Youth Leadership Responsibility To Church & Youth
Youth Leadership Responsibility To Church & YouthYouth Leadership Responsibility To Church & Youth
Youth Leadership Responsibility To Church & Youthrameshv2801
 

Viewers also liked (12)

Deepening relationship with god PDYD presentation
Deepening relationship with god PDYD presentationDeepening relationship with god PDYD presentation
Deepening relationship with god PDYD presentation
 
Tips & Tricks On Architecting Windows Azure For Costs
Tips & Tricks On Architecting Windows Azure For CostsTips & Tricks On Architecting Windows Azure For Costs
Tips & Tricks On Architecting Windows Azure For Costs
 
Extensibility with sl4 and mef (en)
Extensibility with sl4 and mef (en)Extensibility with sl4 and mef (en)
Extensibility with sl4 and mef (en)
 
TechDays 2010 Portugal - Introduction to Silverlight 4.0 16x9
TechDays 2010 Portugal - Introduction to Silverlight 4.0 16x9TechDays 2010 Portugal - Introduction to Silverlight 4.0 16x9
TechDays 2010 Portugal - Introduction to Silverlight 4.0 16x9
 
TechDays 2010 Portugal - WCF RIA Services 16x9
TechDays 2010 Portugal - WCF RIA Services 16x9TechDays 2010 Portugal - WCF RIA Services 16x9
TechDays 2010 Portugal - WCF RIA Services 16x9
 
TechDays 2010 Portugal - Entity Framework 4.0 and Beyond
TechDays 2010 Portugal - Entity Framework 4.0 and BeyondTechDays 2010 Portugal - Entity Framework 4.0 and Beyond
TechDays 2010 Portugal - Entity Framework 4.0 and Beyond
 
TechDays 2010 Portugal - Event Driven Architectures - 16x9
TechDays 2010 Portugal - Event Driven Architectures - 16x9TechDays 2010 Portugal - Event Driven Architectures - 16x9
TechDays 2010 Portugal - Event Driven Architectures - 16x9
 
Leadership Of Christ
Leadership Of ChristLeadership Of Christ
Leadership Of Christ
 
Architecture Best Practices on Windows Azure
Architecture Best Practices on Windows AzureArchitecture Best Practices on Windows Azure
Architecture Best Practices on Windows Azure
 
Windows Azure Security & Compliance
Windows Azure Security & ComplianceWindows Azure Security & Compliance
Windows Azure Security & Compliance
 
Youth Retreat Youth Gift To Community
Youth Retreat Youth Gift To CommunityYouth Retreat Youth Gift To Community
Youth Retreat Youth Gift To Community
 
Youth Leadership Responsibility To Church & Youth
Youth Leadership Responsibility To Church & YouthYouth Leadership Responsibility To Church & Youth
Youth Leadership Responsibility To Church & Youth
 

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

Microsoft Windows Server AppFabric
Microsoft Windows Server AppFabricMicrosoft Windows Server AppFabric
Microsoft Windows Server AppFabricMark Ginnebaugh
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricWim Van den Broeck
 
Scale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App FabricScale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App FabricChris Dufour
 
Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?Robert MacLean
 
NCache 3.8 SP3
NCache 3.8 SP3NCache 3.8 SP3
NCache 3.8 SP3wesnoor
 
ASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache ExtensibilityASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache Extensibilityakrakovetsky
 
Enterprise Library 2.0
Enterprise Library 2.0Enterprise Library 2.0
Enterprise Library 2.0Raju Permandla
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platformrajdeep
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...ColdFusionConference
 
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Shailendra Prasad
 
Super-NetOps Source of Truth
Super-NetOps Source of TruthSuper-NetOps Source of Truth
Super-NetOps Source of TruthJoel W. King
 
Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Web Directions
 
Instrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaInstrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaMark Leith
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And ScalabilityJason Ragsdale
 
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...Docker, Inc.
 
Infrastructure as Code in your CD pipelines - London Microsoft DevOps 0423
Infrastructure as Code in your CD pipelines - London Microsoft DevOps 0423Infrastructure as Code in your CD pipelines - London Microsoft DevOps 0423
Infrastructure as Code in your CD pipelines - London Microsoft DevOps 0423Giulio Vian
 
Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...
Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...
Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...Acquia
 

Similar to TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9 (20)

Microsoft Windows Server AppFabric
Microsoft Windows Server AppFabricMicrosoft Windows Server AppFabric
Microsoft Windows Server AppFabric
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabric
 
Scale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App FabricScale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App Fabric
 
Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?
 
NCache 3.8 SP3
NCache 3.8 SP3NCache 3.8 SP3
NCache 3.8 SP3
 
ASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache ExtensibilityASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache Extensibility
 
Enterprise Library 2.0
Enterprise Library 2.0Enterprise Library 2.0
Enterprise Library 2.0
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platform
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...
 
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
 
Super-NetOps Source of Truth
Super-NetOps Source of TruthSuper-NetOps Source of Truth
Super-NetOps Source of Truth
 
Sql Portfolio
Sql PortfolioSql Portfolio
Sql Portfolio
 
Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5
 
Instrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaInstrumenting plugins for Performance Schema
Instrumenting plugins for Performance Schema
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
 
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...
 
Infrastructure as Code in your CD pipelines - London Microsoft DevOps 0423
Infrastructure as Code in your CD pipelines - London Microsoft DevOps 0423Infrastructure as Code in your CD pipelines - London Microsoft DevOps 0423
Infrastructure as Code in your CD pipelines - London Microsoft DevOps 0423
 
Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...
Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...
Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...
 

Recently uploaded

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

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

  • 1. Como garantir a escalabilidade da sua camada de dados com o Windows Server AppFabric WIN304 NunoGodinho Partner & CTO @ ITech4All nuno.godinho@itech4all.com @NunoGodinho
  • 3. Speaker Bio and Photo Speaker Name
  • 4. Nuno Filipe Godinho Partner & CTO @ ITech4all Mail: Nuno.Godinho@itech4all.com Nuno.Godinho@sapo.pt Blogs: http://pontonetpt.com/blogs/nunogodinho http://xamlpt.com/blogs/nunogodinho http://weblogs.asp.net/nunogodinho http://msmvps.org/blogs/nunogodinho Twitter: @NunoGodinho About Me
  • 5. The Problem! Caching with the Windows Server AppFabric Overview and Programming Model Caching Futures Summary Q&A Agenda
  • 9. Typical Architecture Users Load Balancer Sticky Routing Application / Web Tier Application Application Application ASP.Net App Session Cart Hosted in memory Catalog sits in Database Data Tier Database
  • 10. And then… Flu Hits!
  • 11. You become a popular Pharmacy! Web Site’s too slow!! Users Where did my shopping cart go? Web Tier (ASP.Net) … Application Application Application Servers are crashing Database is hot!! Data Tier Database
  • 13. Data Near Processing Cache Cache Browser Smart Client Cache Web Service ASP.NET Cache Cache Database
  • 14. Cache is scoped to machine / process Machines die Processes recycle Cache memory is limited Good but…
  • 15. 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?
  • 16. Caching with the Windows Server AppFabric
  • 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 cache What is AppFabric Caching? Caching clients can be across machines or processes Clients Access the Cache as if it was a large single cache Unified Cache View Cache Layer distributes data across the various cache nodes
  • 19. Where does it fit? Users Caching Access Layer Caching Access Layer Caching Access Layer … Web Tier (ASP.Net) Application Application Application Caching Service Caching Service Caching Service Cache Tier Data Tier Database Cloud
  • 22. 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?
  • 23.
  • 24. Serves 16 million hits per day
  • 25.
  • 26.
  • 27. Ships as part of Windows Server AppFabric 2010 Wave 1 * Different Features of the cache might require higher level SKUs of Windows Server. AppFabric MONITORING WORKFLOW HOSTING CACHING ACCESS CONTROL SERVICE HOSTING SERVICE BUS MANAGEMENT MULTI-TENANT SCALE OUT HIGH AVAILABILITY
  • 28. What Stage Is It In?
  • 29.
  • 30. Nov ‘09(Formerly Called “Velocity”)
  • 32. Overview and Programming AppFabric Caching
  • 34. Deployment Users Update Web.config Copy Client DLLs Application Application Application … Caching Access Layer Caching Access Layer Caching Access Layer <hosts> <host name="BL1CDB8083714“ cachePort="22233" cacheHostName="DistributedCacheService"/> ….. </hosts> <localCacheisEnabled=“true" ../> <security … /> .NET 3.5 SP1 OR .NET 4 Caching Service Caching Service Caching Service .NET 4 Configure AppFabric Install AppFabric Configuration Store
  • 35. AppFabric Caching CodePlex Tool http://mdcadmintool.codeplex.com/
  • 36. 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  RedDomainachine1$ grant-cacheallowedclientaccount  RedDomainohn
  • 37. Centralized administration through powershell Perfmon to monitor the cache (new in Beta) Logging Default ETW, support for file logs Administration & Monitoring
  • 38. // Create instance of cachefactory (reads appconfig) DataCacheFactoryfac = new DataCacheFactory(); // Get a named cache from the factory DataCache catalog = fac.GetCache("catalogcache"); AppFabric Caching API // Simple Get/Put catalog.Put("toy-101", new Toy("Puzzle", .,.)); // From the same or a different client Toy toyObj = (Toy)catalog.Get("toy-101"); // Region based Get/Put catalog.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 Logical Hierarchy AppFabric Caching Service AppFabric Caching Service AppFabric Caching Service AppFabric Caching Service Named Cache : Product Catalog Named Cache : Electronics Inventory Regions Key Payload Tags Region A 121 xxxx “Toy” “Child” 123 yyyy “Toy” “Chair”.. Machine -> Cache Host -> Named Caches -> Regions -> Cache Items -> Objects Host Physical processes hosting AppFabric Caching instance. Named Caches Can span across machines Defined in the configuration file Cache Item Key, Payload (Object ), Tags, TTL, Timestamps, Version Regions Physically co-located Container of Cache Items May be implicit or explicitly created
  • 40. 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 client List<KeyValuePair<string, object>> toys = catalog.GetAnyMatchingTag("toyRegion", hotItem);
  • 41. Usage Pattern – Cache Aside (Explicit Caching) // Read from Cache Toy toyObj = (Toy) catalog.Get("toy-101"); Application Caching Access Layer // If Not present in the cache if (toyObj == null) { // Read from backend.. toyObj = ReadFromDatabase(); // Populate Cache catalog.Put("toy-101", toyObj); return toyObj; } Caching Service Database
  • 42. How does it Scale?
  • 43. Data Distribution - Partitioned Cache Users … G H I D E F A B C Web Tier ASP.Net App ASP.Net App ASP.Net App Caching Client Caching Client Caching Client E G B D H A I C F Cache Service Cache Service Cache Tier Cache Service Scale on Data Size -More machines => More memory to cache Scale on Cache Throughput -More machines => keys distributed across more machines => better throughput
  • 44. Scale Test Output Load 1 Cache Server As load increases, throughput fails to scale latency increases Caching Tier Throughput Latency
  • 45. Add Second Cache Server Load Load Max Throughput increases Latency decreases Caching Tier Throughput Latency
  • 46. Add Third Cache Server Load Caching Tier Throughput Latency
  • 47. GridDynamics Blog Engine Tests More info at http://blogs.msdn.com/velocity/ or http://www.griddynamics.com/velocity
  • 49. 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!
  • 50. Types of Data Grocery Shop Web Tier Shopping Cart Pharmacy Inventory Distributed Cache Pharmacy Catalog
  • 51. Catalog data doesn’t change often Unnecessary network cost to access from different machines Solution – Local Cache Application Application Reference Data – Performance Get(K2) Get(K2) Put(K2, v3) AppFabric Caching Client AppFabric Caching Client Local Cache Routing Table Routing Table K2, V2 K2, V2 Cache2 Cache3 Cache1 Primary for K1,V1 Primary for K3,V3 Primary for K2,V2 K1, V1 K2, V3 K3, V3
  • 52. 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”);
  • 53. Application PUT Application Get(K2) AppFabric Caching Client AppFabric Caching Client Routing Table Routing Table Cache1 Cache2 Cache3 Activity Data - Availability Primary for Primary for Primary for Replication Agent (K2, V2) K3, V3 K2, V2 K1, V1 K2, V2 K2, V2 Secondary for Secondary for Secondary for K3, V3 K1, V1
  • 54. 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 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
  • 55. Resource Data - Pessimistic Locking Client1: GetAndLock ("k1") Client3: Get ("k1") Client2: GetAndLock ("k1") GetAndLock gets lock handle Regular Get succeeds Other GetAndLock on same item fails New in Beta – Take locks on non-existent keys Allows you to co-ordinate creating new object amongst multiple clients K1
  • 56. 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);
  • 57. Register Notification for Key “K3" Call Delegate Store Last LSN Map Keys to Partition (say P2) Application AppFabric Caching Client Partition: P2 Last LSN: 19 Routing Table Poll Required Nodes Nodes Return List of Changes LSN Order Cache2 Cache3 Cache1 K2, V2 Primary for Primary for Primary for Change Log (Partition P2) Del K32 Del K43 Change Log Partition P1 Add K2 Del K32 Change Log 33 Add K1 34 Del K22 K1, V1 K3, V3 Scalable Notifications
  • 60. AppFabric Caching and Azure Platform
  • 61. 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
  • 62. 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 Application & AppFabric Caching deployed On-premise Caching Service Caching Service Caching Service Caching Worker Role Data on SQL Azure
  • 63. App on Windows Azure; Data on SQL Azure Web Role … Application Application Application AppFabric Caching Access Layer AppFabric Caching Access Layer AppFabric Caching Access Layer Application & AppFabric Caching on Windows Azure Caching Service Caching Service Caching Service Caching Worker Role AppFabric Caching Worker Role Data on SQL Azure
  • 64. App on Windows Azure; Data on-premise Web Role … Application Application Application AppFabric Caching Access Layer AppFabric Caching Access Layer AppFabric Caching Access Layer AppFabric Service Bus Application & AppFabric Caching on Windows Azure Caching Service Caching Service Caching Service Caching Worker Role AppFabric Caching Worker Role Data on-premises
  • 66. 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
  • 67. 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
  • 68. HPC Integration Final Results Store AppFabric Caching Market Data Central Market Data Store (~1 TB Tick Data) Final Results AppFabric Caching Intermediate Store Market Data Scratch Job Input Rollup Operation Split Method Scratch Keys Calculation Operation GridDynamics testing on CTP1 50 times improvement in some cases
  • 70. AppFabric Caching Vision – Cache for all your data

Editor's Notes

  1. MSCUIBusiness Application Template
  2. MSCUIBusiness Application Template
  3. MSCUIBusiness Application Template