SlideShare una empresa de Scribd logo
1 de 53
Scale Your Data Tier with Windows Server AppFabric Chris Dufour, ASP MVP Software Architect, Compuware chris.dufour@wigets.net
Agenda
Simple Do the simplest thing that will possibly work
Scalability Able to support the required quality of service as the system load increases -Wiktionary
Typical Web Architecture
Web Explosion Web Site’s too slow!! Where did my shopping cart go? IIS/ASP.NET IIS/ASP.NET IIS/ASP.NET  Application  Application  Application Servers are crashing Database Database is hot!! Services are slow
Agenda
Data Near Processing Cache Cache Browser Smart Client Cache Web Service Cache ASP.NET Cache Database
Good but… Cache is scoped to machine  / process Machines die Processes recycle Cache memory is limited
What if? 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
Windows Server AppFabric AppFabric CACHING WORKFLOW HOSTING SERVICE HOSTING MONITORING SCALE OUT HIGH AVAILABILITY  MANAGEMENT
Unified Cache View What is AppFabric Caching? An explicit, distributed, in-memory application cache for all kinds of data  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
AppFabric Cache
Data Distribution - Partitioned Cache … Web Tier ASP.Net App ASP.Net App ASP.Net App Caching Client Caching Client Caching Client G H I D E F A B C Cache  Service Cache  Service Cache Tier Cache  Service E G B D H A I C F 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 a Second Cache Server Load Load Max Throughput increases Latency decreases Caching Tier Throughput Latency
Add a Second Cache Server Load Caching Tier Throughput Latency
Associated Press Caches metadata and news Serves 16 million hits per day Increased the amount of cached data 6 times.
System.Web.Cache
AppFabricDataCache
Copy Client DLLs Update Web.config … .NET 3.5 SP1 OR .NET 4 <hosts>       <host name="BL1CDB8083714“ cachePort="22233"  cacheHostName="DistributedCacheService"/>      …..    </hosts>  <localCacheisEnabled=“true"  ../> <security … />  Application  Application  Application Caching Access Layer Caching Access Layer Caching Access Layer .NET 4 Install AppFabric Configure AppFabric Caching Service Caching  Service Caching  Service Configuration Store  Deployment
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
Administration PowerShell cmdlets are used to administer the cache cluster	 Rich set of cmdlets for  Cache cluster management Cache creation and monitoring
Hello AppFabric Cache
Using PowerShell Remember – PowerShell can also be called from .NET Code!
Security 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 grant-cacheallowedclientaccount  RedDomainachine1$   grant-cacheallowedclientaccount  RedDomainohn
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 Host Physical processes hosting AppFabric Caching instance. Named Caches Can span across machines Defined in the configuration file Regions Physically co-located Container of Cache Items May be implicit or explicitly created Cache Item Key, Payload (Object ), Tags,  TTL, Timestamps, Version
AppFabric Caching API // Create instance of cachefactory (reads appconfig) DataCacheFactory fac = new DataCacheFactory(); // Get a named cache from the factory DataCache catalog = fac.GetCache("catalogcache"); // 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");
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);
Types of Data Grocery Shop  Web Tier Shopping Cart Grocery Inventory Distributed Cache         Grocery  Catalog
Reference Data – Performance Catalog data doesn’t change often Unnecessary network cost to access from different machines Solution – Local Cache Application Application Get(K2) Get(K2) Put(K2, v3) AppFabric Caching Client AppFabric Caching Client Local Cache RoutingTable Routing Table Cache2 Cache3 Cache1 K2, V2 K2, V2 Primary for K1,V1 Primary for K3,V3 Primary for K2,V2 K1, V1 K2, V3 K3, V3
Reference Data – Bulk Get Bulk Fetch from region 200-300k ops per second Fewer network calls Catalog.BulkGet(  	new List<string>(){“toy-101”, “toy-102”} ,       “toyRegion”);
Activity Data – Session Integration Load Balance Requests No more sticky routing <sessionState  mode="Custom“ customProvider="SessionStoreProvider"> <providers>     <add name="SessionStoreProvider"           type=“Microsoft.Data.Caching.DataCacheSessionStoreProvider,   ClientLibrary“  cacheName="<YourNamedCache>"/> </providers> </sessionState> Drop in AppFabric Caching SessionStoreProvider … Caching Access Layer Caching Access Layer Session State stored  in AppFabric Caching Allows session state to be shared amongst multiple applications Scale your Session Store Dynamically Cache  Service Caching  Service Caching  Service Highly Available  Application  Application  Application Caching Access Layer
Application Application Activity Data - Availability PUT Get(K2) AppFabric Caching Client AppFabric Caching Client Routing Table Routing Table Cache1 Cache2 Cache3 Primary for Primary for Primary for  Replication Agent K3, V3 K1, V1 K2, V2 (K2, V2) K2, V2 Secondary for Secondary for  Secondary for K2, V2 K2, V2 K3, V3 K1, V1
Resource Data - Optimistic Locking 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  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 Take locks on non-existent keys Allows you to co-ordinate calls for data K1
Data Race GET GET GET
Lock Non-Existent Key GET/LOCK GET/LOCK GET/LOCK Cache  Service Cache  Service Caching  Service
Composite Race CALL WAIT WAIT Cache  Service Cache  Service Caching  Service
Composite Race PUT UNLOCK GET GET Cache  Service Cache  Service Caching  Service
Resource/Activity Data – Tracking Changes Cache Event notifications Register on any client to notify changes Batched Notifications 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  Application Map Keys to Partition 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
Agenda
Pre-Fetch Hospital Data Center
Pre-Fetch Remote Clinic Hospital Slow!! Data Center WAN
Pre-Fetch Hospital Remote Clinic Data Center Cache  Service WAN
Agenda
Web Platform Installer
Select Enterprise
Install AppFabric
Install AppFabric
endpoint.tv
AppFabric on MSDN http://msdn.microsoft.com/AppFabric

Más contenido relacionado

La actualidad más candente

DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)Hendrik Ebbers
 
$.get, a Prime on Data Fetching
$.get, a Prime on Data Fetching$.get, a Prime on Data Fetching
$.get, a Prime on Data FetchingJosh Black
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkFabio Tiriticco
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsTips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsSarvesh Kushwaha
 
Glassfish JEE Server Administration - Module 4 Load Balancer
Glassfish JEE Server Administration - Module 4 Load BalancerGlassfish JEE Server Administration - Module 4 Load Balancer
Glassfish JEE Server Administration - Module 4 Load BalancerDanairat Thanabodithammachari
 
ASP.NET MVC 4 Request Pipeline Internals
ASP.NET MVC 4 Request Pipeline InternalsASP.NET MVC 4 Request Pipeline Internals
ASP.NET MVC 4 Request Pipeline InternalsLukasz Lysik
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postvamsi krishna
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthroughmitesh_sharma
 
Felix HTTP - Paving the road to the future
Felix HTTP - Paving the road to the futureFelix HTTP - Paving the road to the future
Felix HTTP - Paving the road to the futureMarcel Offermans
 
Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments Pavel Kaminsky
 
Knowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletKnowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletFahmi Jafar
 

La actualidad más candente (18)

DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)
 
$.get, a Prime on Data Fetching
$.get, a Prime on Data Fetching$.get, a Prime on Data Fetching
$.get, a Prime on Data Fetching
 
JEE Programming - 07 EJB Programming
JEE Programming - 07 EJB ProgrammingJEE Programming - 07 EJB Programming
JEE Programming - 07 EJB Programming
 
JEE Programming - 04 Java Servlets
JEE Programming - 04 Java ServletsJEE Programming - 04 Java Servlets
JEE Programming - 04 Java Servlets
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
Oracle OSB Tutorial 3
Oracle OSB Tutorial 3Oracle OSB Tutorial 3
Oracle OSB Tutorial 3
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsTips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC Applications
 
Glassfish JEE Server Administration - Module 4 Load Balancer
Glassfish JEE Server Administration - Module 4 Load BalancerGlassfish JEE Server Administration - Module 4 Load Balancer
Glassfish JEE Server Administration - Module 4 Load Balancer
 
Connection Pooling
Connection PoolingConnection Pooling
Connection Pooling
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
ASP.NET MVC 4 Request Pipeline Internals
ASP.NET MVC 4 Request Pipeline InternalsASP.NET MVC 4 Request Pipeline Internals
ASP.NET MVC 4 Request Pipeline Internals
 
Weblogic12 c installation guide
Weblogic12 c installation guideWeblogic12 c installation guide
Weblogic12 c installation guide
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 
Felix HTTP - Paving the road to the future
Felix HTTP - Paving the road to the futureFelix HTTP - Paving the road to the future
Felix HTTP - Paving the road to the future
 
Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments
 
Knowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletKnowledge Sharing : Java Servlet
Knowledge Sharing : Java Servlet
 

Similar a Scale Your Data Tier With Windows Server App Fabric

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
 
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9Nuno Godinho
 
Taking advantage of the Amazon Web Services (AWS) Family
Taking advantage of the Amazon Web Services (AWS) FamilyTaking advantage of the Amazon Web Services (AWS) Family
Taking advantage of the Amazon Web Services (AWS) FamilyBen Hall
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCLFastly
 
Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Hyun-Mook Choi
 
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
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaYevgeniy Brikman
 
Hammock, a Good Place to Rest
Hammock, a Good Place to RestHammock, a Good Place to Rest
Hammock, a Good Place to RestStratoscale
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingBertrand Delacretaz
 
websphere cast iron labs
 websphere cast iron labs websphere cast iron labs
websphere cast iron labsAMIT KUMAR
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesPavol Pitoňák
 
Solid fire cloudstack storage overview - CloudStack European User Group
Solid fire cloudstack storage overview - CloudStack European User GroupSolid fire cloudstack storage overview - CloudStack European User Group
Solid fire cloudstack storage overview - CloudStack European User GroupShapeBlue
 
CloudStack Meetup London - Primary Storage Presentation by SolidFire
CloudStack Meetup London - Primary Storage Presentation by SolidFire CloudStack Meetup London - Primary Storage Presentation by SolidFire
CloudStack Meetup London - Primary Storage Presentation by SolidFire NetApp
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedToru Wonyoung Choi
 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionBertrand Delacretaz
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiJérémy Derussé
 
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
 

Similar a Scale Your Data Tier With Windows Server App Fabric (20)

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
 
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
 
Taking advantage of the Amazon Web Services (AWS) Family
Taking advantage of the Amazon Web Services (AWS) FamilyTaking advantage of the Amazon Web Services (AWS) Family
Taking advantage of the Amazon Web Services (AWS) Family
 
Sql Portfolio
Sql PortfolioSql Portfolio
Sql Portfolio
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부
 
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?
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
 
BDD in iOS with Cedar
BDD in iOS with CedarBDD in iOS with Cedar
BDD in iOS with Cedar
 
Hammock, a Good Place to Rest
Hammock, a Good Place to RestHammock, a Good Place to Rest
Hammock, a Good Place to Rest
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
 
websphere cast iron labs
 websphere cast iron labs websphere cast iron labs
websphere cast iron labs
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile Devices
 
Solid fire cloudstack storage overview - CloudStack European User Group
Solid fire cloudstack storage overview - CloudStack European User GroupSolid fire cloudstack storage overview - CloudStack European User Group
Solid fire cloudstack storage overview - CloudStack European User Group
 
CloudStack Meetup London - Primary Storage Presentation by SolidFire
CloudStack Meetup London - Primary Storage Presentation by SolidFire CloudStack Meetup London - Primary Storage Presentation by SolidFire
CloudStack Meetup London - Primary Storage Presentation by SolidFire
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 version
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
 
HTML5와 모바일
HTML5와 모바일HTML5와 모바일
HTML5와 모바일
 
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
 

Más de Chris Dufour

Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5Chris Dufour
 
Developing Windows 10 Hosted Web Apps
Developing Windows 10 Hosted Web AppsDeveloping Windows 10 Hosted Web Apps
Developing Windows 10 Hosted Web AppsChris Dufour
 
Developing windows 10 universal apps
Developing windows 10 universal appsDeveloping windows 10 universal apps
Developing windows 10 universal appsChris Dufour
 
DevCamp - What can the cloud do for me
DevCamp - What can the cloud do for meDevCamp - What can the cloud do for me
DevCamp - What can the cloud do for meChris Dufour
 
Microsoft Azure Platform-as-a-Service (PaaS)
Microsoft Azure Platform-as-a-Service (PaaS)Microsoft Azure Platform-as-a-Service (PaaS)
Microsoft Azure Platform-as-a-Service (PaaS)Chris Dufour
 
Migrate an Existing Application to Microsoft Azure
Migrate an Existing Application to Microsoft AzureMigrate an Existing Application to Microsoft Azure
Migrate an Existing Application to Microsoft AzureChris Dufour
 
Whats new for developers in Visual Studio 2013
Whats new for developers in Visual Studio 2013Whats new for developers in Visual Studio 2013
Whats new for developers in Visual Studio 2013Chris Dufour
 
Windows Azure Active Directory: Identity Management in the Cloud
Windows Azure Active Directory: Identity Management in the CloudWindows Azure Active Directory: Identity Management in the Cloud
Windows Azure Active Directory: Identity Management in the CloudChris Dufour
 
Asynchronous Programming in ASP.NET
Asynchronous Programming in ASP.NETAsynchronous Programming in ASP.NET
Asynchronous Programming in ASP.NETChris Dufour
 
Introduction to CSLA
Introduction to CSLAIntroduction to CSLA
Introduction to CSLAChris Dufour
 
Implementing OData: Create a UG Event Feed
Implementing OData: Create a UG Event FeedImplementing OData: Create a UG Event Feed
Implementing OData: Create a UG Event FeedChris Dufour
 

Más de Chris Dufour (11)

Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
 
Developing Windows 10 Hosted Web Apps
Developing Windows 10 Hosted Web AppsDeveloping Windows 10 Hosted Web Apps
Developing Windows 10 Hosted Web Apps
 
Developing windows 10 universal apps
Developing windows 10 universal appsDeveloping windows 10 universal apps
Developing windows 10 universal apps
 
DevCamp - What can the cloud do for me
DevCamp - What can the cloud do for meDevCamp - What can the cloud do for me
DevCamp - What can the cloud do for me
 
Microsoft Azure Platform-as-a-Service (PaaS)
Microsoft Azure Platform-as-a-Service (PaaS)Microsoft Azure Platform-as-a-Service (PaaS)
Microsoft Azure Platform-as-a-Service (PaaS)
 
Migrate an Existing Application to Microsoft Azure
Migrate an Existing Application to Microsoft AzureMigrate an Existing Application to Microsoft Azure
Migrate an Existing Application to Microsoft Azure
 
Whats new for developers in Visual Studio 2013
Whats new for developers in Visual Studio 2013Whats new for developers in Visual Studio 2013
Whats new for developers in Visual Studio 2013
 
Windows Azure Active Directory: Identity Management in the Cloud
Windows Azure Active Directory: Identity Management in the CloudWindows Azure Active Directory: Identity Management in the Cloud
Windows Azure Active Directory: Identity Management in the Cloud
 
Asynchronous Programming in ASP.NET
Asynchronous Programming in ASP.NETAsynchronous Programming in ASP.NET
Asynchronous Programming in ASP.NET
 
Introduction to CSLA
Introduction to CSLAIntroduction to CSLA
Introduction to CSLA
 
Implementing OData: Create a UG Event Feed
Implementing OData: Create a UG Event FeedImplementing OData: Create a UG Event Feed
Implementing OData: Create a UG Event Feed
 

Scale Your Data Tier With Windows Server App Fabric

  • 1. Scale Your Data Tier with Windows Server AppFabric Chris Dufour, ASP MVP Software Architect, Compuware chris.dufour@wigets.net
  • 3. Simple Do the simplest thing that will possibly work
  • 4. Scalability Able to support the required quality of service as the system load increases -Wiktionary
  • 6. Web Explosion Web Site’s too slow!! Where did my shopping cart go? IIS/ASP.NET IIS/ASP.NET IIS/ASP.NET Application Application Application Servers are crashing Database Database is hot!! Services are slow
  • 8. Data Near Processing Cache Cache Browser Smart Client Cache Web Service Cache ASP.NET Cache Database
  • 9. Good but… Cache is scoped to machine / process Machines die Processes recycle Cache memory is limited
  • 10. What if? 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
  • 11. Windows Server AppFabric AppFabric CACHING WORKFLOW HOSTING SERVICE HOSTING MONITORING SCALE OUT HIGH AVAILABILITY MANAGEMENT
  • 12. Unified Cache View What is AppFabric Caching? An explicit, distributed, in-memory application cache for all kinds of data 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
  • 14. Data Distribution - Partitioned Cache … Web Tier ASP.Net App ASP.Net App ASP.Net App Caching Client Caching Client Caching Client G H I D E F A B C Cache Service Cache Service Cache Tier Cache Service E G B D H A I C F Scale on Data Size More machines => More memory to cache Scale on Cache Throughput More machines => keys distributed across more machines => better throughput
  • 15. Scale Test Output Load 1 Cache Server As load increases, throughput fails to scale latency increases Caching Tier Throughput Latency
  • 16. Add a Second Cache Server Load Load Max Throughput increases Latency decreases Caching Tier Throughput Latency
  • 17. Add a Second Cache Server Load Caching Tier Throughput Latency
  • 18. Associated Press Caches metadata and news Serves 16 million hits per day Increased the amount of cached data 6 times.
  • 21. Copy Client DLLs Update Web.config … .NET 3.5 SP1 OR .NET 4 <hosts> <host name="BL1CDB8083714“ cachePort="22233" cacheHostName="DistributedCacheService"/> ….. </hosts> <localCacheisEnabled=“true" ../> <security … /> Application Application Application Caching Access Layer Caching Access Layer Caching Access Layer .NET 4 Install AppFabric Configure AppFabric Caching Service Caching Service Caching Service Configuration Store Deployment
  • 22. 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
  • 23. Administration PowerShell cmdlets are used to administer the cache cluster Rich set of cmdlets for Cache cluster management Cache creation and monitoring
  • 25. Using PowerShell Remember – PowerShell can also be called from .NET Code!
  • 26. Security 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 grant-cacheallowedclientaccount  RedDomainachine1$ grant-cacheallowedclientaccount  RedDomainohn
  • 27. 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 Host Physical processes hosting AppFabric Caching instance. Named Caches Can span across machines Defined in the configuration file Regions Physically co-located Container of Cache Items May be implicit or explicitly created Cache Item Key, Payload (Object ), Tags, TTL, Timestamps, Version
  • 28. AppFabric Caching API // Create instance of cachefactory (reads appconfig) DataCacheFactory fac = new DataCacheFactory(); // Get a named cache from the factory DataCache catalog = fac.GetCache("catalogcache"); // 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");
  • 29. 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);
  • 30. Types of Data Grocery Shop Web Tier Shopping Cart Grocery Inventory Distributed Cache Grocery Catalog
  • 31. Reference Data – Performance Catalog data doesn’t change often Unnecessary network cost to access from different machines Solution – Local Cache Application Application Get(K2) Get(K2) Put(K2, v3) AppFabric Caching Client AppFabric Caching Client Local Cache RoutingTable Routing Table Cache2 Cache3 Cache1 K2, V2 K2, V2 Primary for K1,V1 Primary for K3,V3 Primary for K2,V2 K1, V1 K2, V3 K3, V3
  • 32. Reference Data – Bulk Get Bulk Fetch from region 200-300k ops per second Fewer network calls Catalog.BulkGet( new List<string>(){“toy-101”, “toy-102”} , “toyRegion”);
  • 33. Activity Data – Session Integration Load Balance Requests No more sticky routing <sessionState mode="Custom“ customProvider="SessionStoreProvider"> <providers> <add name="SessionStoreProvider" type=“Microsoft.Data.Caching.DataCacheSessionStoreProvider, ClientLibrary“ cacheName="<YourNamedCache>"/> </providers> </sessionState> Drop in AppFabric Caching SessionStoreProvider … Caching Access Layer Caching Access Layer Session State stored in AppFabric Caching Allows session state to be shared amongst multiple applications Scale your Session Store Dynamically Cache Service Caching Service Caching Service Highly Available Application Application Application Caching Access Layer
  • 34. Application Application Activity Data - Availability PUT Get(K2) AppFabric Caching Client AppFabric Caching Client Routing Table Routing Table Cache1 Cache2 Cache3 Primary for Primary for Primary for Replication Agent K3, V3 K1, V1 K2, V2 (K2, V2) K2, V2 Secondary for Secondary for Secondary for K2, V2 K2, V2 K3, V3 K1, V1
  • 35. Resource Data - Optimistic Locking 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 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
  • 36. 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 Take locks on non-existent keys Allows you to co-ordinate calls for data K1
  • 37. Data Race GET GET GET
  • 38. Lock Non-Existent Key GET/LOCK GET/LOCK GET/LOCK Cache Service Cache Service Caching Service
  • 39. Composite Race CALL WAIT WAIT Cache Service Cache Service Caching Service
  • 40. Composite Race PUT UNLOCK GET GET Cache Service Cache Service Caching Service
  • 41. Resource/Activity Data – Tracking Changes Cache Event notifications Register on any client to notify changes Batched Notifications DataCache.RegisterCacheLevelCallback( int filter, DataCacheChangeCallback delegate); DataCache.RegisterRegionLevelCallback( String region, int filter, DataCacheChangeCallback delegate); DataCache.RegisterKeyLevelCallback( String region, String key, int filter, DataCacheChangeCallback delegate);
  • 42. Register Notification for Key “K3" Call Delegate Store Last LSN Application Map Keys to Partition 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
  • 45. Pre-Fetch Remote Clinic Hospital Slow!! Data Center WAN
  • 46. Pre-Fetch Hospital Remote Clinic Data Center Cache Service WAN
  • 53. AppFabric on MSDN http://msdn.microsoft.com/AppFabric
  • 54. Thanks to our contributors

Notas del editor

  1. In the future we will be bringing these capabilities to the cloud and bringing some of the cloud capabilities such as service bus and access control to the on-premise server solution as well.