App fabric introduction

1,713 views
1,473 views

Published on

AppFabric session I did in the past for SDN

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,713
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

App fabric introduction

  1. 1. Microsoft AppFabric Dennis van der Stelt Tellus
  2. 2. Introducing • Tellus – Lead generation – 10k websites – Looking for developers .NET Geeks • Dennis van der Stelt – http://bloggingabout.net/blogs/dennis/ – http://twitter.com/dvdstelt – dennis@bloggingabout.net
  3. 3. Session objectives Windows AppFabric Azure AppFabric Architectural choices
  4. 4. AppFabric • Services to build and manage composite applications • Formerly known as – BizTalk Services – .NET Services – Velocity – Dublin
  5. 5. •Workflows •Monitoring •Troubleshooting •Scaling out •Scripting •Distributed •Enterprise scale •Load balancing •ASP.NET Integration Windows Server AppFabric •Connect •Pass through •Discoverable •REST based •Claim based •Transformation •Security Token •REST based Azure AppFabric
  6. 6. Windows Server AppFabric SERVICE & WORKFLOW MANAGEMENT
  7. 7. Brought my own whiteboard
  8. 8. Hosting services Host Client WCF Service Databa se What are the current hosting capabilities of services?
  9. 9. Hosting services Host Client WCF Service MyApp.exe #1 – Your own application (Self hosted) Easiest to deploy No quality of service Databa se
  10. 10. Hosting services Host Client WCF Service MyService.ex e #2 – Windows Service Run in background, some monitoring Hardly any quality of service Databa se
  11. 11. Hosting services IIS Client WCF Service MyService.svc #3 – Internet Information Services Excellent quality of service Supports only HTTP protocol Databa se
  12. 12. Hosting services WAS Client WCF Service Databa se MyService.svc #4 – Windows Process Activation Services Excellent quality of service, multiple protocols No support for hosting Workflows & true scalability
  13. 13. Enter Dublin…
  14. 14. Hosting services AppFabric Workflow Client WCF Service Databa se MyService.svc #4 – Service & Workflow Management Quality of Service from IIS/WAS Hosting scalable workflow & WCF Services
  15. 15. Management Tools IIS Manager Modules PowerShell Services Persistence Workflows Hosting Monitoring Caching Windows Server AppFabric .NET Framework Persistence Runtime Databases IIS/WAS Windows Server Monitoring
  16. 16. Scalable Share workflow state across machines
  17. 17. AppFabric Hosting Management Service Windows Service + AppFabric Management Service Windows Service + AppFabric Persistence Database Management Service Windows Service + AppFabric
  18. 18. Scalable Retry mechanism for race conditions
  19. 19. AppFabric Hosting Client 3F2504E0-4F89-11D3-1337-… Management Service x Management Service Windows Service + AppFabric Windows Service + AppFabric Persistence Database
  20. 20. Windows Server AppFabric CACHING
  21. 21. Let’s look at a problem you might experience yourself…
  22. 22. AppFabric Caching WebServer Load Balancer WebServer WebServer Databa se
  23. 23. AppFabric Caching WebServer Load Balancer WebServer WebServer x Databa se
  24. 24. AppFabric Caching WebServer Load Balancer WebServer WebServer Solution is sticky sessions… Databa se
  25. 25. We’ll have uneven load balancing, we might loose sessions, etc…
  26. 26. AppFabric Caching WebServer Load Balancer WebServer Databa se WebServer Another solution is using DBMS to store sessions
  27. 27. Doesn’t scale well, we’ll have a performance bottleneck. And clustering is costly and fault sensitive!
  28. 28. What is AppFabric Caching? • An explicit, distributed, in-memory application cache for all kinds of data (CLR objects, XML, Binary data, etc.) – Flows "memory" across machines into a unified cache Clients can be spread across machines or processes Unified Cache View Clients Access the Cache as if it was a large single cache Cache Layer distributes data across the various cache nodes
  29. 29. AppFabric Caching WebServer Load Balancer WebServer WebServer Databa se
  30. 30. Why Velocity? * Share data across applications No more sticky routing * Peformance Operation Read 2k MSDN Forums Throughput Latency 30,000 / sec 3 – 4 ms Write 2k 18,000 / sec 5 Velocity Servers, 40GB Cache 98% of all calls to database come from cache Result is from 60% load on SQL Server, down to 2% * Scale out 3 ms Operation Throughput Read 2k 1 30,000 / sec Read 2k 2 58, 600 / sec Read 2k Velocity Servers 3 85, 500 / sec
  31. 31. Basic terminology in Velocity • • • • • • • Cache host Cache cluster Cluster configuration storage Machine 1 Machine Machine Named cache 2Cache 2Cache Cache Cache host A host B host C host D Region Named cache : Product catalog Named cache : ShoppingCart Cache item Tags Region A
  32. 32. Working with Velocity // Create instance of CacheFactory, which reads app.config DataCacheFactory factory = new DataCacheFactory(); // Get a named cache from the factory DataCache cache = factory.GetCache("default"); // Cache.Put(string key, object value) cache.Add("SDN", new SDNSession()); // Cache.Get(string key); var meeting = (SDNSession)cache.Get("SDN"); // Via indexers is also an option cache["what"] = new Object(); Object o = cache["what"];
  33. 33. Tags var starWarsTag = new DataCacheTag("StarWars"); var tags = new List<DataCacheTag>(); tags.Add(starWarsTag); tags.Add(new DataCacheTag("Force")); tags.Add(new DataCacheTag("Sith")); cache.Add("MyKey", "A New Hope", tags, "StarWarsRegion"); var result = cache.GetObjectsByTag(starWarsTag, "StarWarsRegion"); foreach (var item in result) { Console.WriteLine("{0} has value of {1}", item.Key, item.Value); }
  34. 34. Optimistic locking DataCacheItemVersion versionWillChange; DataCacheItemVersion versionWithError; // First get the current version 2 times cache.Get("MyKey", out versionWillChange); cache.Get("MyKey", out versionWithError); // We change the key, version hasn't changed in Velocity yet. cache.Put("MyKey", "MyNewValue", versionWillChange); // Version has changed with previous update, this will #fail cache.Put("MyKey", "MyErrorValue", versionWithError);
  35. 35. Pessimistic locking DataCacheLockHandle lockHandle = null; DataCacheLockHandle secondLockHandle = null; // Lock our object cache.GetAndLock("MyKey", new TimeSpan(0, 0, 10), out lockHandle); // This will still work string result = (string)cache.Get("MyKey"); // Try to lock for 2nd time -> #fail cache.GetAndLock("MyKey", new TimeSpan(0, 0, 10), out secondLockHandle); // This will break the lock!!! cache.Put("MyKey", "MyNewValue");
  36. 36. Notification callback DataCacheOperation filter = DataCacheOperation.AddItem; cache.AddItemLevelCallback("MyKey", filter, callback); cache.AddRegionLevelCallback("Region", filter, callback); cache.AddFailureNotificationCallback(failCallback); cache.Add("MyKey", "MyInitialValue"); public static void callback (string myCacheName, string myRegion, string myKey, DataCacheItemVersion itemVersion, DataCacheOperation OperationId, DataCacheNotificationDescriptor nd) { //display some of the delegate parameters Console.WriteLine("Region : " + myRegion); Console.WriteLine("Key : " + myKey); }
  37. 37. ASP.NET Session integration • SessionStoreProvider class – Plugs into ASP.NET Session store – Stores session state in Velocity • Scale – Session information available at all ASP.NET Nodes • High availability – Session data is backed up on addditional machines – Resilient to machine or process failures
  38. 38. Azure AppFabric • Webbased services • Yes, in the cloud! • Allow you to easily connect applications
  39. 39. Azure AppFabric SERVICE BUS
  40. 40. Azure Service Bus
  41. 41. Azure Service Bus Let’s open a port and do some forwarding
  42. 42. Azure Service Bus Oh, what about NAT, Proxies, etc?
  43. 43. Azure Service Bus Service Bus
  44. 44. Azure Service Bus App Service Bus
  45. 45. Features • Services discoverable through SB url • Full duplex channels supporting bi-directional communiction • Full-duplex p2p sessions – with network-boundary traversal create direct end-to-end connectivity through NAT • Multiple publishers & subscribers • REST based (non .NET platform support)
  46. 46. Azure AppFabric LABS http://portal.appfabriclabs.com/
  47. 47. Azure AppFabric ACCESS CONTROL
  48. 48. Azure Access Control Service Bus Federated Identity
  49. 49. Azure Access Control Service Bus Access Control ID
  50. 50. Azure Access Control Service Bus Access Control App ID
  51. 51. Access Control • Two new protocols – Created by Microsoft, Google, Yahoo, etc – Oauth WRAP & SWT – Authentication in HTTP Headers – Usable even via JavaScript – Ready for Geneva/WIF
  52. 52. Access Control • • • • The future No WS* available yet… or no longer? CardSpace Support for other web identity providers – Windows Live – Google – Yahoo – OpenId
  53. 53. Azure Pricing • Access Control – $1.99 / 100K transactions • Service Bus Connections – $3.99 per connection – $9.99 for a pack of 5 connections – $199 for a pack of 100 connections • Data Transfers – $0.10 in / $0.15 out per Gigabyte
  54. 54. Example (real world) architecture
  55. 55. Example architecture SQL Website
  56. 56. Example architecture SQL Website “Server Busy”
  57. 57. Example architecture Website SQL Website Website N L B
  58. 58. Example architecture Website SQL Website “Timeout” Website N L B
  59. 59. An important change was made…
  60. 60. Example architecture Isolated servers One way! SQL Sync Framework Website Website Website Prepublished Databases using SQL Express N L B
  61. 61. How to submit state changes to backend?
  62. 62. Example architecture Website Website Sync Framework Website AppFabric Hosting Backend WCF Service MSMQ Cache SQL N L B
  63. 63. Example architecture SB AC The near future? REST Based Service Layer Website Website Sync Framework Website AppFabric Hosting Backen d Servic e MSMQ Cache SQL N L B
  64. 64. Summary • • • • Different AppFabric components Difference Azure & Windows AppFabric New architectural choices Do you see benefits or opportunities?
  65. 65. questions Resources: • .NET Magazine maart 2010 & SDN Magazine • http://www.microsoft.com/windowsazure/ • http://bit.ly/1P6f5D • http://bloggingabout.net/blogs/dennis/

×