Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Acsug scalable windows azure patterns


Published on

Windows Azure provides you with the capabilities to infinitely scale your applications, but how do you achieve this effectively and efficiently. In this session we will introduce the patterns and anti-patterns of scalability on the Windows Azure platform, demonstrating how to leverage connected systems technologies like the Azure AppFabric Service Bus to achieve scale, and an implementation of some of these patterns that demonstrates how to cost effectively scale your architectures.

Published in: Technology
  • Be the first to comment

Acsug scalable windows azure patterns

  1. 1. Scalable Windows Azure PatternsPresented by Nikolai Blackie @ Auckland Connected Systems User GroupPrincipal ArchitectAdaptiv Integration20th of October 2011
  2. 2. Agenda Overview the patterns of scalability Overview the scale targets on Windows Azure and how to scale past these Introduce Windows Azure CAT team cloud scalability framework – CloudFx Demonstrate Adaptiv’s scaled out distributed architecture Show how you can save money when scaling on Windows Azure
  3. 3. Traditional Scalability
  4. 4. Traditional Scalability
  5. 5. Traditional Scalability Issues Synchronous sequential units of work Large units of work Tight coupling between components Stateful applications Clustering for HA Expensive Scaling limits Inefficient use of resources How should you approach this in the cloud?
  6. 6. Logical Unit Of Work
  7. 7. Parallel Units Of Work Single Threaded Multi Threaded
  8. 8. Event Driven Processing Storage Queues ► Enable event driven architectures ► Allow load levelling ► Scale target of 500 messages per second Service Bus V1 ► Low latency relay ► Non durable direct eventing Service Bus V2 ► Durable asynchronous pub-sub and queues
  9. 9. Load Distribution
  10. 10. Load Balancing / Load Sharing Stateless Round Robin Network Load Balancer Web Role Web Role Web Role Queue Worker Role Worker Role Worker Role Legend Azure Instance Unit of Work
  11. 11. Vertical Partitioning
  12. 12. Vertical Partitioning
  13. 13. Horizontal Partitioning Partitioned Cloud Queue
  14. 14. Storage Services Scalability Targets Maximum scale per account Capacity – Up to 100 TBs Transactions – Up to 5,000 entities/messages/blobs per second Bandwidth – Up to 3 gigabits per second Per storage abstraction ► Single Queue - 500 messages per second ► Single Table Partition - 500 entities per second ► Single Blob - 60 MBytes/sec When targets reached? ► 503 Server busy – transient not fatal ► Use Upsert on batch operations
  15. 15. Storage Services Scalability Targets Front-End (FE) layer Partition Layer Distributed and replicated File System (DFS)
  16. 16. Service Bus Scalability Targets Quotas per service namespace Concurrent connections – 100 Number of topics/queues - 10,000 Number of subscriptions per topic - 2,000 Maximum Queue size – 1gb – 5gb Throughput Targets Queues depending on message size much faster than storage queues Topics throughput dependent on subscription counts Official guidance is coming soon
  17. 17. Sql Azure Scalability Targets No official guidance on I/O performance Sql Azure is a multi tenant database platform Runs on commodity hardware Throttled when connection overloads Sql Azure
  18. 18. Sharding Techniques
  19. 19. Cloud Scalability – Scale Up Azure Role Cost (NZD) CPU Bandwidth Memory XSmall $0.06 Shared Core 1.0 GHz 5 Mbps 0.768 GB Small $0.14 1 Core 1.6 GHz 100 Mbps 1.750 GB Medium $0.28 2 Cores 1.6 GHz 200 Mbps 3.50 GB Large $0.55 4 Cores 1.6 GHz 400 Mbps 7.00 GB XLarge $1.10 8 Cores 1.6 GHz 800 Mbps 14.0 GB
  20. 20. Cloud Scalability – Scale Up Edition Database Cost (NZD) Web 1GB $ 11.48 Web 5GB $ 57.41 Business 10GB $ 114.93 Business 20GB $ 229.86 Business 30GB $ 344.79 Business 40GB $ 459.72 Business 50GB $ 574.66
  21. 21. Cloud Scalability Key Features Small logical units of work Parallel units of work Event driven processing Load distribution ► Load balancing ► Vertical partitioning ► Horizontal partitioning Low cost scale out Dynamic scale up
  22. 22. Scalable Frameworks Windows Azure CAT Team Azure CloudFx Reference Library & Implementation
  23. 23. CloudFx Framework Features► CloudFx is a cloud solution framework and extensions library► A Swiss army knife for building scalable systems ► Service agnostic retries ► Large message queue ► Payload compression ► And much more….
  24. 24. Cost-Efficient Queue Listener Anti-Pattern continuous queue polling when idle Notify of new work Provision parallel dequeue threads & increase poll rate When no work reduce threads & polling rate Very efficient event based processing
  25. 25. Reliable Retry Framework Anti-Pattern failing catastrophically or rerunning entire processes due to service call failure Call to resource fails Retry based on configured pattern ► Fixed, Incremental, Exponential Ensure Idempotent operations
  26. 26. Reliable Retry Framework Anti-Pattern failing catastrophically or rerunning entire processes due to service call failure Call to resource fails Retry based on configured pattern ► Fixed, Incremental, Exponential Ensure Idempotent operations Expect failure, design for fault tolerance ► Netflix Simian Army ► CloudFx unit tests
  27. 27. Service Aggregation Anti-Pattern tightly coupled service deployments Enable flexible service aggregation Implemented using System.ServiceModel Extensions ► IExtensible<T> ► IExtensibleObject<T> Consolidate services or partition vertically
  28. 28. Large Message Queue Support Anti-Pattern writing custom code to handle queue storage limits of 64kb message size Abstracted support for messages of any size Built in compression when writing to all services Utilises DeflateStream Compress on write, decompress on read
  29. 29. Scalable Reconciliation Implementation
  30. 30. Scalable Reconciliation Implementation
  31. 31. Scalable Reconciliation Implementation
  32. 32. Reconciliation Scale Out Demo
  33. 33. Cost Capacity Planning Storage Transactions ► Queues 1 transaction to put, 2 transactions to get and delete Can batch up to 32 get message operations in 1 transaction ► Table storage 1 transaction for read/write Can batch 100 entity transactions is into 1 group transaction ► Blobs 1 transaction for read/write Bandwidth ► Measured from outside and between data centers ► Free inbound data
  34. 34. Cost Capacity Planning Storage ► Cumulative total through month, charged on average usage Compute Instances ► Charged as soon as virtual instance allocated regardless of running state ► Billed to the nearest hour Measurement ► Instrument Azure service access ► Use billing manager with A & B testing approach
  35. 35. Cost-Efficient Queue Listener Idle Polling * Polling Algorithm Transactions Per Day Service Bus Cost Per Day Standard One Dequeue Thread 79,200 $ - $ 0.09 10 Compute Instances - 150 Dequeue Threads 11,880,000 $ - $ 13.66 Back off One Dequeue Thread - $ 4.59 $ 0.15 10 Compute Instances - 150 Dequeue Threads - $ 22.87 $ 0.76 * 22 hours per day Running Polling ** Polling Algorithm Transactions Per Day Cost Per Day One Dequeue Thread 72,000 $ 0.08 10 Compute Instances - 150 Dequeue Threads 10,800,000 $ 12.41 ** 2 hours per day, 5 msgs per sec, 2 trans per message Savings Polling Algorithm Transactions Per Day Cost Per Day One Dequeue Thread 79,200 $ (0.06) 10 Compute Instances - 150 Dequeue Threads 11880000 $ 12.89
  36. 36. Cost-Efficient Queue Listener * Terms and conditions apply, your mileage may vary, these calculations are based on simple models
  37. 37. Batching Units of Work Parsing a 10000 line file ► 10000 messages a day ► Table storage batch transactions ► Using scatter scale out pattern Batch Size Queue Transactions Table Transactions Total Transactions Cost Per Day10 Lines 30,000,000 10,000,000 40,000,000 $45.98200 Lines 1,500,000 500,000 2,00,000 $ 2.302000 Lines 150,000 50,000 200,000 $0.23
  38. 38. Batching Units of Work * Terms and conditions apply, your mileage may vary, these calculations are based on simple models
  39. 39. Parallel Processing & Mixing Roles Per Day Per DayUtilisation Cost Utilisation Cost5 Threads Dequeuing across 5 instances $ 16.55 One Service over 3 instances $ 9.9325 Threads Dequeuing across 1 Instance $ 3.31 Three Services on one instance $ 3.31 * Terms and conditions apply, your mileage may vary, these calculations are based on simple models
  40. 40. Object Compression Compression Ratios ► Compressing a text based CSV 5:1 ratio ► Compressing a Xml file 10:1 ratio Based on 10000 CSV messages a day 10000 Line CSV File Blob Storage Space (GB) Cost Per Day Uncompressed 2064KB 19.68 $3.39 Compressed 390KB 3.72 $0.64 Savings 15.96 $2.75
  41. 41. Object Compression * Terms and conditions apply, your mileage may vary, these calculations are based on simple models
  42. 42. To Summarise You can scale with any combination of up and out using horizontal and vertical partitioning On the cloud make the most of the ability to scale out using small units of work Distribute load to reduce resource contention Make the best use of the resources you have paid for Use frameworks like CloudFx and to help you scale using best practices Use techniques like back off polling, batching, parallel processing and compression to reduce costs
  43. 43. Links Windows Azure Capacity Assessment Building Highly Scalable Java Applications on Windows Azure Cost Architecting for Windows Azure Understanding Windows Azure Storage Billing – Bandwidth, Transactions, and Capacity Operational costs of an Azure Message Queue
  44. 44. Links Windows Azure Storage Abstractions and their Scalability Targets Understanding the Scalability, Availability, Durability, and Billing of Windows Azure Storage Windows Azure Storage Architecture Overview Windows Azure AppFabric Service Bus Quotas Inside SQL Azure The Netflix Simian Army
  45. 45. Windows Azure CAT Links How to Simplify & Scale Inter-Role Communication Using Windows Azure AppFabric Service Bus Implementing Storage Abstraction Layer to Support Very Large Messages in Windows Azure Queues Transient Fault Handling Framework for SQL Azure, Windows Azure Storage, AppFabric Service Bus Best Practices for Maximizing Scalability and Cost Effectiveness of Queue- Based Messaging Solutions on Windows Azure
  46. 46. We would like to thank the sponsors. . . Premier Partners Associated Partners Supporting Partners: