Anúncio
Anúncio

Mais conteúdo relacionado

Apresentações para você(20)

Similar a App fabric introduction(20)

Anúncio

Último(20)

Anúncio

App fabric introduction

  1. Microsoft AppFabric Dennis van der Stelt Tellus
  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. Session objectives Windows AppFabric Azure AppFabric Architectural choices
  4. AppFabric • Services to build and manage composite applications • Formerly known as – BizTalk Services – .NET Services – Velocity – Dublin
  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. Windows Server AppFabric SERVICE & WORKFLOW MANAGEMENT
  7. Brought my own whiteboard
  8. Hosting services Host Client WCF Service Databa se What are the current hosting capabilities of services?
  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. 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. Hosting services IIS Client WCF Service MyService.svc #3 – Internet Information Services Excellent quality of service Supports only HTTP protocol Databa se
  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. Enter Dublin…
  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. 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. Scalable Share workflow state across machines
  17. AppFabric Hosting Management Service Windows Service + AppFabric Management Service Windows Service + AppFabric Persistence Database Management Service Windows Service + AppFabric
  18. Scalable Retry mechanism for race conditions
  19. AppFabric Hosting Client 3F2504E0-4F89-11D3-1337-… Management Service x Management Service Windows Service + AppFabric Windows Service + AppFabric Persistence Database
  20. Windows Server AppFabric CACHING
  21. Let’s look at a problem you might experience yourself…
  22. AppFabric Caching WebServer Load Balancer WebServer WebServer Databa se
  23. AppFabric Caching WebServer Load Balancer WebServer WebServer x Databa se
  24. AppFabric Caching WebServer Load Balancer WebServer WebServer Solution is sticky sessions… Databa se
  25. We’ll have uneven load balancing, we might loose sessions, etc…
  26. AppFabric Caching WebServer Load Balancer WebServer Databa se WebServer Another solution is using DBMS to store sessions
  27. Doesn’t scale well, we’ll have a performance bottleneck. And clustering is costly and fault sensitive!
  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. AppFabric Caching WebServer Load Balancer WebServer WebServer Databa se
  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. 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. 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. 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. 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. 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. 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. 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. Azure AppFabric • Webbased services • Yes, in the cloud! • Allow you to easily connect applications
  39. Azure AppFabric SERVICE BUS
  40. Azure Service Bus
  41. Azure Service Bus Let’s open a port and do some forwarding
  42. Azure Service Bus Oh, what about NAT, Proxies, etc?
  43. Azure Service Bus Service Bus
  44. Azure Service Bus App Service Bus
  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. Azure AppFabric LABS http://portal.appfabriclabs.com/
  47. Azure AppFabric ACCESS CONTROL
  48. Azure Access Control Service Bus Federated Identity
  49. Azure Access Control Service Bus Access Control ID
  50. Azure Access Control Service Bus Access Control App ID
  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. Access Control • • • • The future No WS* available yet… or no longer? CardSpace Support for other web identity providers – Windows Live – Google – Yahoo – OpenId
  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. Example (real world) architecture
  55. Example architecture SQL Website
  56. Example architecture SQL Website “Server Busy”
  57. Example architecture Website SQL Website Website N L B
  58. Example architecture Website SQL Website “Timeout” Website N L B
  59. An important change was made…
  60. Example architecture Isolated servers One way! SQL Sync Framework Website Website Website Prepublished Databases using SQL Express N L B
  61. How to submit state changes to backend?
  62. Example architecture Website Website Sync Framework Website AppFabric Hosting Backend WCF Service MSMQ Cache SQL N L B
  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. Summary • • • • Different AppFabric components Difference Azure & Windows AppFabric New architectural choices Do you see benefits or opportunities?
  65. questions Resources: • .NET Magazine maart 2010 & SDN Magazine • http://www.microsoft.com/windowsazure/ • http://bit.ly/1P6f5D • http://bloggingabout.net/blogs/dennis/
Anúncio