Intro to Windows Server AppFabric
by Ron Jacobs, Senior Technical Evangelist at Microsoft
Windows Server AppFabric is a set of integrated technologies that make it easier to build, scale and manage Web and composite applications that run on IIS.
This presentation will help SQL Server developers and DBAs get up to speed on AppFabric. You'll also learn how Windows AppFabric caching can help you scale your Data Tier.
You will learn:
•The core capabilities of Windows Server AppFabric
•How the distributed nature of AppFabric’s cache allows large amounts of data to be stored in-memory for extremely fast access and help you scale your SQL Data Tier
•How to get started with Windows Server AppFabric
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
Microsoft Windows Server AppFabric
1. Windows Server AppFabric Speaker: Ron Jacobs Senior Technical Evangelist, Microsoft Silicon Valley SQL Server User Group April 2010 Mark Ginnebaugh, User Group Leader, mark@designmind.com
2. Windows Server AppFabric AppFabric is a set of integrated technologies that make it easier to build, scale, and manage Web and composite applications that run on IIS.
3. Ron Jacobs of Microsoft Ron Jacobs Senior Technical Evangelist Microsoft Platform Evangelism Group in Redmond Current focus Windows Communication Foundation (WCF) Windows Workflow Foundation (WWF) For more information about this meeting: http://www.meetup.com/The-SiliconValley-SQL-Server-User-Group/calendar/12626266
4. Designing and Delivering Scalable and Resilient Web Services Ron Jacobs Sr. Technical Evangelist, Microsoft http://blogs.msdn.com/rjacobs Video of this session: http://live.visitmix.com/MIX10/Sessions/FT11
9. 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
11. Data Near Processing Cache Cache Browser Smart Client Cache Web Service ASP.NET Cache Cache Database
12. Good but… Cache is scoped to machine / process Machines die Processes recycle Cache memory is limited
13. 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
14. Windows Server AppFabric AppFabric CACHING WORKFLOW HOSTING SERVICE HOSTING MONITORING SCALE OUT HIGH AVAILABILITY MANAGEMENT AppFabric Cache – Formerly known as Code Name “Velocity”
15. 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
17. 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
18. Scale Test Output Load 1 Cache Server As load increases, throughput fails to scale latency increases Caching Tier Throughput Latency
19. Add Second Cache Server Load Load Max Throughput increases Latency decreases Caching Tier Throughput Latency
25. 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
26. Administration PowerShell cmdlets are used to administer the cache cluster Rich set of cmdlets for Cache cluster management Cache creation and monitoring
30. 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
31. 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
32. 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");
33. 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);
34. Types of Data Grocery Shop Web Tier Shopping Cart Grocery Inventory Distributed Cache Grocery Catalog
35. 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
36. 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”);
37. 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
38. 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
39. 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
40. 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
58. To learn more or inquire about speaking opportunities, please contact: Mark Ginnebaugh, User Group Leader mark@designmind.com
Editor's Notes
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.