10 things every architect needs to know




Eric Nelson | ISV Application Architect | Microsoft UK
eric.nelson@microsoft.c...
Assumption

• You already have some
  familiarity with the Windows
  Azure Platform

• If you don’t then you will still
  ...
Agenda   Overview
         •   Dynamic environment
         •   Role Instances
         •   Latency & timeouts
         • ...
Overview




           Page 4
Windows Azure Platform

         makes it easy and cost effective
            to run your applications
               and ...
Windows Azure Platform




                         Page 6
Your code runs in Hosted Services
made up of Roles




                                    Page 7
Your Roles are code + configuration




                                      Page 8
You choose which type(s) of Role
to run your code in




                                   Page 9
At runtime you can have
multiple instances of your Roles




                               Load
                         ...
You store your data in Windows Azure
Storage




                                       Page 11
And/or you store your data in SQL Azure




                                          Page 12
Vs traditional Windows development


           It’s not really   It’s not really
           different.        different.
...
“Typical” Azure Application
                              Windows Azure Platform
                                         ...
Is it just about this?
                      “On and Off “                            “Growing Fast“




                 ...
Or is it also about this?
                     “I want to try                                “Departmental“
              ...
Behavioral changes


                          Developers
                             feel
                          empo...
Agenda   Overview
         •   Role Instances
         •   Dynamic environment
         •   Latency & timeouts
         • ...
Dynamic Environment




                      Page 19
Dynamic Environment means…


                                                      Windows
    Traditional                ...
Admin control (or lack of it)

• Limited access to local environment and state
  – No admin rights and privileges are avai...
Volatility: Your instances will be stopped


     Patching



                                              React
        ...
Role instance management example




                                   Page 23
Dynamic networking
• Dynamic environment means dynamic
  networking
  – Ports changes
  – IPs change
  – Cannot rely on no...
Role Instances




                 Page 25
Instances of Role Types
          “Typical Application”                           But…


                   Finance
      ...
Consolidation of Role Types
       Scalable Message Passing                         Meta-Message Passing


     HR        ...
Elasticity and Roles

            From this
                                                             To this


  Finan...
Latency and Timeouts




                       Page 29
Latency

          On premises application
                                                    App
                       ...
Timeout

On premises application
                                                             Try to connect
      Service...
Timeout Retry Code Example




                             Page 32
Timeout Retry Code Example




                             Page 33
Timeout Retry Code Example




TIP: There is a new code library for all this!

                                           ...
Transactions & bandwidth




                           Page 35
Transactions & bandwidth

•Bandwidth
  • Charged for usage
  • Functionality that was not bandwidth         Access Control...
Data center usage costing comparison


                 Web Role                                             Web Role




...
Batch Payloads
 Frequent message                     Option 1:
 passing with a small                 Serialized




      ...
Batch Queries

     Single Query Use               Batch Query Use

  Query                 Worker   Query
               ...
Be aware of “new costs” e.g. polling
•   Consider introducing polling a queue every 100ms
•   25,920,000 polls/month
•   £...
Be aware of cost


                             140 million                                  $140
    Transactions per Mon...
Be aware of cost


                             140 million                                  $140
    Transactions per Mon...
Be aware of cost

Be wary of frequent transactions with little work being done

                                  140 mill...
Polling best practices

• Poll less often
• Synchronize polling with
  business needs               8am to       12am til ...
Polling best practices cont.
    Scalable Message Passing                 Meta-Message Passing


  HR         Finance     ...
Data/State




             Page 46
Data/State

• Windows Azure instances are highly dynamic
  – Role instance local data is volatile
• Instances are independ...
You have many choices for data
                   Relational Database


                   Structured Storage


          ...
Side by Side Evaluation
                                                                     Single SQL
                  ...
Example: Registry/Configuration/User
Settings
A traditional set of data that is traditionally stored on the local
environm...
Tables for storing Data

Why do this?
Partition     Row Key       Data         Data                  Data          Data
Ke...
Selecting keys is … key
Consider searching an address book



       Search By         Partition Key                    Ro...
Data Sensitivity




                   Page 53
Segmentation


          Online Shop                                Online Shop




                                      ...
Sharding



       Contact ID
                               Contact ID
      First Name              First Name
         ...
Encryption



       Contact ID
                               Contact ID
      First Name              First Name
       ...
Agenda   Overview
         •   Role Instances
         •   Dynamic environment
         •   Latency & timeouts
         • ...
Summary
• Windows Web Development best practices apply
• But
• Cost becomes surprisingly significant in shaping
  architec...
NEXT STEPS
  For latest slides and all the links http://bit.ly/ericnelson
  For more resources and information http://bit....
SQL Azure Labs




                 Page 60
Demo




       Page 61
Upcoming SlideShare
Loading in …5
×

10 things ever architect should know about the Windows Azure Platform - ericnel

7,946 views

Published on

Deck used at Software Architect 2010, Oct 2010.

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

No Downloads
Views
Total views
7,946
On SlideShare
0
From Embeds
0
Number of Embeds
1,207
Actions
Shares
0
Downloads
118
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

10 things ever architect should know about the Windows Azure Platform - ericnel

  1. 1. 10 things every architect needs to know Eric Nelson | ISV Application Architect | Microsoft UK eric.nelson@microsoft.com | http://bit.ly/ericnelson | http://twitter.com/ericnel Page 1
  2. 2. Assumption • You already have some familiarity with the Windows Azure Platform • If you don’t then you will still learn stuff – But you will be missing some context. Sorry – Also check out • http://bit.ly/azuretrenchesbookvol1 • http://ukazure.ning.com/events Page 2
  3. 3. Agenda Overview • Dynamic environment • Role Instances • Latency & timeouts • Transactions & bandwidth • Data/state • Data sensitivity Summary Page 3
  4. 4. Overview Page 4
  5. 5. Windows Azure Platform makes it easy and cost effective to run your applications and store your data inside Microsoft Data Centres using existing skills and integrate with your existing on-premise applications Page 5
  6. 6. Windows Azure Platform Page 6
  7. 7. Your code runs in Hosted Services made up of Roles Page 7
  8. 8. Your Roles are code + configuration Page 8
  9. 9. You choose which type(s) of Role to run your code in Page 9
  10. 10. At runtime you can have multiple instances of your Roles Load Balancer http://yourapp.cloudapp.net Page 10
  11. 11. You store your data in Windows Azure Storage Page 11
  12. 12. And/or you store your data in SQL Azure Page 12
  13. 13. Vs traditional Windows development It’s not really It’s not really different. different. There is just There is just more of it less of it Therefore many Windows Web development best practices apply Page 13
  14. 14. “Typical” Azure Application Windows Azure Platform Your Data Web Site Web Site Web ASMX,WCF) (ASPX, Role (ASPX, ASMX, WCF) Queues (ASPX, WCF, PhP) L B Worker Worker L Blobs Service Role B Internet Your Code Tables Your Relational Data Tables Views SPs Triggers Page 14
  15. 15. Is it just about this? “On and Off “ “Growing Fast“ Compute Compute Inactivity Period Average Average Usage Usage Time Time On and off workloads (e.g. batch Successful services needs to job) grow/scale Over provisioned capacity is wasted Keeping up w/growth is big IT Time to market can be cumbersome challenge Complex lead time for deployment “Unpredictable “Predictable Bursting“ Bursting“ Compute Average Compute Average Usage Usage Time Time Unexpected/unplanned peak in demand Services with micro seasonality trends Sudden spike impacts performance Peaks due to periodic increased demand Can’t over provision for extreme cases IT complexity and wasted capacity Page 15
  16. 16. Or is it also about this? “I want to try “Departmental“ something now“ Machines Machines Time Time Need to quickly provision new Need to quickly provision new machines for a temporary period of machines for a departmental solution time “Just store “Extend to data in the Cloud“ the Cloud“ With all processing elsewhere Extend existing applications “Migrate existing “New hybrid services“ applications“ Benefits of reduced operational costs On-premise and Cloud aka S+S Page 16
  17. 17. Behavioral changes Developers feel empowered Cost of Developers architectural become decisions is entrepreneurs more visible Page 17
  18. 18. Agenda Overview • Role Instances • Dynamic environment • Latency & timeouts • Transactions & bandwidth • Data/state • Data sensitivity Summary Page 18
  19. 19. Dynamic Environment Page 19
  20. 20. Dynamic Environment means… Windows Traditional Azure Control over network topology Admin Limited control over IPs, ports and machines Control Consistent bandwidth with stable latency Latency Variable latency and bandwidth Control over machine Machine names can change identification Identification every time an instance starts Limited control over lifetime, Control over machine lifetime Volatility state becomes transient Page 20
  21. 21. Admin control (or lack of it) • Limited access to local environment and state – No admin rights and privileges are available (yet). – No pre-setup or configuration can be done (yet). • Code defines exact set up of roles which provides uniformity across instances Page 21
  22. 22. Volatility: Your instances will be stopped Patching React • When an instance goes away, it’s Notification of gone, including its state! Moving instance • Properly handle state so it can lifecycle events be preserved. Failure Page 22
  23. 23. Role instance management example Page 23
  24. 24. Dynamic networking • Dynamic environment means dynamic networking – Ports changes – IPs change – Cannot rely on node IPs or machine names • The traditional way of networking may no longer be the best fit. – Direct communication is possible – Shift to indirect • Using Windows Azure storage • Using Windows Azure Service Bus Page 24
  25. 25. Role Instances Page 25
  26. 26. Instances of Role Types “Typical Application” But… Finance Web Message Finance Web Web Role A Message Role A Role A Queue Queue 10 Sec 10 Sec Worker Role A Worker Worker Role A Role A TIP: Queue writes are approx 20/s per writer Page 26
  27. 27. Consolidation of Role Types Scalable Message Passing Meta-Message Passing HR Finance Sales HR Finance Sales Message Message Message Message Message Message Meta-queue HR HR Finance Sales Finance Queue Queue Queue Sales 10 10 5 Finance Sec Sec Sec 10 Sec Worker Worker Worker Meta-worker Role Role Role Role Message Type? TIP: Web Roles can communicate direct to Workers TIP: Maximum time to process a Q Item is 2 hours Page 27
  28. 28. Elasticity and Roles From this To this Finance Web Web Finance Web Web Web Message Role A Role A Message Role A Role A Role A 10 to 15 Queue minutes Queue 10 Sec 10 Sec Worker Worker Worker Worker Role A Role A Role A Role A Page 28
  29. 29. Latency and Timeouts Page 29
  30. 30. Latency On premises application App Data Service App Request Consistent and accepted latencies Cloud based application App Service Data App Request Increases in quantity and variability of latencies TIP: Expect Web Role to SQL Azure to take about twice as long Page 30
  31. 31. Timeout On premises application Try to connect Service App App Request Data Consistent, reliable connectivity and access Connection Yes Continue doing Successful? work Cloud based application Timeouts? No Service App App Request Data No Tried 5 Yes Increased likelihood of timeouts times? Fail Page 31
  32. 32. Timeout Retry Code Example Page 32
  33. 33. Timeout Retry Code Example Page 33
  34. 34. Timeout Retry Code Example TIP: There is a new code library for all this! Page 34
  35. 35. Transactions & bandwidth Page 35
  36. 36. Transactions & bandwidth •Bandwidth • Charged for usage • Functionality that was not bandwidth Access Control based may now be effected. Per AC transactions/month • E.g. using Windows Azure Blobs instead of writing to disk Bandwidth Per GB transfer to/from datacenter •Transactions • Charged by quantity Storage • Access types that were not Per GB stored & transactions traditionally on a transaction count may now be effected. Service Bus • E.g. using Access Control Services Per connection/month and Storage SQL Azure Per GB allocated database by day Page 36
  37. 37. Data center usage costing comparison Web Role Web Role Transaction Transaction Browser Image Download Blob Browser Image Download Blob Bandwidth Bandwidth Egress Egress TIP: Increasing the size of the VM will increase network throughput Page 37
  38. 38. Batch Payloads Frequent message Option 1: passing with a small Serialized # of transactions amount of data can Message Passing Header effect performance and Header Header cost. Header Header Content Content Content Header Total Bytes or Content Overhead Content Content Content Header Message Content Structure Content Header Option 2; Content # of txs TIP: Q items 8KB limit Packaged Message Content TIP: Watch out for data formats! Passing Content Total Bytes TIP: Use storage APIs to group transactions Page 38
  39. 39. Batch Queries Single Query Use Batch Query Use Query Worker Query Role A Query Worker Worker Query Query Role Role B Query Worker Query Query Reduction of bandwidth Role C and transactions! Query Worker Query Query Role D Query Worker Role Worker Query Query Role E Query Page 39
  40. 40. Be aware of “new costs” e.g. polling • Consider introducing polling a queue every 100ms • 25,920,000 polls/month • £0.0061 per 10,000 storage transactions • Therefore it will cost – £15.81/month • To get an SLA, need two worker roles polling – £31.62/month • Cost of two workers – £0.0728 per hour x 720 x 2 – £104.83/month • Total cost £136.45/month Page 40
  41. 41. Be aware of cost 140 million $140 Transactions per Month 120 million $120 Cost per Month 100 million $100 80 million $80 60 million $60 40 million $40 20 million $20 0 1 instance 5 instances 100 ms 100 ms Instances polling storage Page 41
  42. 42. Be aware of cost 140 million $140 Transactions per Month 120 million $120 Cost per Month 100 million $100 80 million $80 60 million $60 40 million $40 20 million $20 0 5 instances 5 instances 100 ms 1 second Instances polling storage Page 42
  43. 43. Be aware of cost Be wary of frequent transactions with little work being done 140 million $140 Transactions per Month 120 million $120 Cost per Month Unnecessary Cost 100 million $100 80 million $80 60 million $60 40 million $40 20 million $20 0 5 instances Polls which 100 ms found work Instances polling storage Page 43
  44. 44. Polling best practices • Poll less often • Synchronize polling with business needs 8am to 12am til 4am 12pm – – every 1 every 100ms minute 4am til 8am – every 10 seconds Page 44
  45. 45. Polling best practices cont. Scalable Message Passing Meta-Message Passing HR Finance Sales HR Finance Sales Message Message Message Message Message Message Meta-queue HR HR Finance Sales Finance Queue Queue Queue Sales 10 10 5 Finance Sec Sec Sec 10 Sec Worker Worker Worker Meta-worker Role Role Role Role Message Type? Page 45
  46. 46. Data/State Page 46
  47. 47. Data/State • Windows Azure instances are highly dynamic – Role instance local data is volatile • Instances are independent – State changes are not reflected in other instances • Therefore – Local instance storage is only useful for temporary data or as a cache – All other data needs to be moved to durable storage Page 47
  48. 48. You have many choices for data Relational Database Structured Storage Unstructured Storage NTFS Drive Service Communication Page 48
  49. 49. Side by Side Evaluation Single SQL Single Blob Drive Queue Table Azure Database Structured Data Y Y Relational Database Y Server Side Processing Y Direct Access from outside Y Y Y Y Azure Messaging Infrastructure Y Persistent Storage Y Y 1 week Y Y 200 GB/ 1 Size Limit 1 TB 100 TB 100 TB 50 GB (*) TB Page 49
  50. 50. Example: Registry/Configuration/User Settings A traditional set of data that is traditionally stored on the local environment is configuration and user settings. Commonly this is stored in the registry, xml or ini files. Options Best Case Usage Blob storage Configuration file that is read only once during app load SQL database Used in environments where a SQL database already exists Windows Azure table User settings that may be changed externally from the environment Page 50
  51. 51. Tables for storing Data Why do this? Partition Row Key Data Data Data Data Key Customer ID Description Name Credit Card # Order Total Tracking ID 1 Customer John Smith xxxx-xxxx-xxxx-xxxx Partition A 1 Order – 1 £35.12 Z783lhs 1 Order – 2 £75.00 Z829bhb 2 Customer Bill Johnson xxxx-xxxx-xxxx-xxxx Partition B 2 Order – 3 £10.00 Z778asd 2 Order – 4 £42.00 Z239uhy 3 Customer Travis Jones xxxx-xxxx-xxxx-xxxx Partition C 3 Order – 5 £25.93 Z329nps 3 Order – 6 £80.94 Z440ydd Page 51
  52. 52. Selecting keys is … key Consider searching an address book Search By Partition Key Row Key Name Last name + First initial First name + Middle initial Phone number Area code Number Address County + city House number + Street name TIP: Table deletes take time TIP: Replicate data to avoid joins and increase indexes Page 52
  53. 53. Data Sensitivity Page 53
  54. 54. Segmentation Online Shop Online Shop Product catalogue Purchasing Product Database catalogue Secure Transaction (Service Bus) Page 54
  55. 55. Sharding Contact ID Contact ID First Name First Name Cloud Last Name Last Name Shipping Information Shipping Information Customer Credit Card # Social Security # Contact ID Billing Data Customer Credit Card # On Premises Other Information Social Security # On Premises Other Information Page 55
  56. 56. Encryption Contact ID Contact ID First Name First Name Cloud Last Name Last Name Shipping Information Shipping Information £!”$&$%!&£% Customer Credit Card # !£$&!%£&%* Social Security # £”$&!%*^(& Billing Data ^$”$&%$”& On Premises Other Information On Premises Page 56
  57. 57. Agenda Overview • Role Instances • Dynamic environment • Latency & timeouts • Transactions & bandwidth • Data/state • Data sensitivity Summary Page 57
  58. 58. Summary • Windows Web Development best practices apply • But • Cost becomes surprisingly significant in shaping architectures • Plenty of early adopters, therefore – Good Architecture guidance is now appearing – Plenty of detail to dig into Page 58
  59. 59. NEXT STEPS For latest slides and all the links http://bit.ly/ericnelson For more resources and information http://bit.ly/startazure As an ISV intending to explore/adopt azure, sign up to http://bit.ly/ukmpr and come along and meet with us http://blogs.msdn.com/b/ukisvdev Eric Nelson | ISV Application Architect | Microsoft UK eric.nelson@microsoft.com | http://bit.ly/ericnelson | http://twitter.com/ericnel Page 59
  60. 60. SQL Azure Labs Page 60
  61. 61. Demo Page 61

×