0
Patterns for Cloud Computing
Patterns for Cloud Computing




                   This is Jim
Patterns for Cloud Computing




 Jim has many questions about cloud computing
Patterns for Cloud Computing




 The more he reads, the more confused he gets
Patterns for Cloud Computing




          “What is Cloud Computing?”
Patterns for Cloud Computing




         “What can I use the Cloud for?”
Patterns for Cloud Computing




   “What is Microsoft’s roadmap in this space?”
Answering these Questions can be Difficult
Answering these Questions can be Difficult

             So many alternative definitions from
                     differe...
Session Objectives
Session Objectives

                      Explore a Clear Definition
                        of Cloud Computing


        ...
Defining Cloud Computing
Defining Cloud Computing




        Jim has heard all the buzzwords
Defining Cloud Computing




         Service Oriented Architecture
Defining Cloud Computing




           Rich Internet Applications
Defining Cloud Computing




             Software as a Service
Defining Cloud Computing




              Software + Services
Defining Cloud Computing




       Are any of these cloud computing?
Defining Cloud Computing




  Styles of application architecture
Defining Cloud Computing




These styles can work in the cloud,
 but they are not cloud computing
Defining Cloud Computing




 Where do your applications “live”?
Defining Cloud Computing




               On Premises
                 Hosted
                  Cloud
Defining Cloud Computing

       Application runs
       on-premises




    • Bring my own
      machines,
        Buy my...
Defining Cloud Computing

       Application runs     Application runs at a
       on-premises                 hoster




...
Defining Cloud Computing

       Application runs     Application runs at a     Application runs using
       on-premises ...
Defining Cloud Computing




            Cloud “Variants”
Defining Cloud Computing




              Public Cloud
Defining Cloud Computing




Pool of computing resources offered by
       a vendor, typically using a
         “pay as yo...
Defining Cloud Computing




              Private Cloud
Defining Cloud Computing




 Pool of computing resources that lives
  within a self managed datacenter
Defining Cloud Computing




 Pool of computing resources that lives
 within a datacenter with no sharing
Defining Cloud Computing




 “What is Microsoft doing in Cloud Computing?”
Defining Cloud Computing




 Refer to the introductory Azure
materials – not going to go through
             them here
Defining Cloud Computing




          3 x Critical Concepts
Defining Cloud Computing



                   Roles

                Web Role
               Worker Role
Defining Cloud Computing




                  Storage

         Table, Blob, Relational
Defining Cloud Computing




                Messaging

                  Queues
Patterns for Cloud Computing




       Using the Cloud for Scale
Patterns for Cloud Computing




“Isn’t the cloud good for applications that need to
                 scale dynamically?”
Patterns for Cloud Computing




          For example, tax applications
Patterns for Cloud Computing




             “How does this work?”
Patterns for Cloud Computing




     Let’s do some white boarding for Jim…
…and when I say white boarding, I really mean it
#1 - Using the Cloud for Scale


“Wow! What a great site!”


                  Request
     Browser                 Web Ti...
#1 - Using the Cloud for Scale


Browser

Browser

Browser          Web Tier      B/L Tier    Database
               “Ser...
#1 - Using the Cloud for Scale


Browser

Browser

Browser         Web Tier      B/L Tier     Database

Browser           ...
How would Jim do this today on premises?
#1 - Using the Cloud for Scale
           How would Jim do this today on premises?


Browser

Browser             Web Tier...
#1 - Using the Cloud for Scale
           How would Jim do this today on premises?


Browser

Browser                     ...
#1 - Using the Cloud for Scale
           How would Jim do this today on premises?


Browser

Browser             Web Tier...
#1 - Using the Cloud for Scale
           How would Jim do this today on premises?


Browser                              ...
Not without consequences...
#1 - Using the Cloud for Scale
           How would Jim do this today on premises?


Browser                              ...
#1 - Using the Cloud for Scale
                  How would Jim do this today on premises?


                              ...
#1 - Using the Cloud for Scale


                                         Datacenter peak load




Usage                  ...
How can Windows Azure help?
#1 - Using the Cloud for Scale


“Wow! What a great site!”


                  Request
     Browser                 Web Ro...
#1 - Using the Cloud for Scale


Browser

Browser

Browser          Web Role      Worker Role    Azure
                   ...
#1 - Using the Cloud for Scale


Browser

Browser               Web Role
                 N
Browser          L    Web Role...
#1 - Using the Cloud for Scale


Browser
                                  Worker
Browser            Web Role
            ...
#1 - Using the Cloud for Scale


Browser                                    p1 p2 p3
                                  Wor...
OK, so changing config is easy...

…but what else do I need to know?
#1 - Using the Cloud for Scale


Browser                                    p1 p2 p3
                                  Wor...
#1 - Using the Cloud for Scale




 Web Role                         Worker Role




        Tight coupling between web an...
#1 - Using the Cloud for Scale


                                                 4. Process

      Web Role              ...
#1 - Using the Cloud for Scale


                                                   4. Process

       Web Role           ...
Demo: PrimeSolvr
How many web and worker roles do you need?
#1 - Using the Cloud for Scale


Browser

Browser             Web Role
                N
Browser         L   Web Role     ...
#1 - Using the Cloud for Scale



 Web Role                 Worker Role




            Req



                  Queue
#1 - Using the Cloud for Scale

Web Role                                      Worker Role

  Web Role                     ...
Patterns for Cloud Computing
                   Takeaways

          Using configuration, Azure makes it
          easy to...
Patterns for Moving to the Cloud




Using the Cloud for Multi Tenancy
Patterns for Cloud Computing




      “I like the idea of scaling Web roles…”
Patterns for Cloud Computing




    “…but need to serve multiple customers”
Patterns for Cloud Computing




     “Without creating separate codebases!”
#2 - Using the Cloud for Multi Tenancy




  Browser        Web Tier     B/L Tier    Database
Customer #1
How would Jim do this today on premises?
#2 - Using the Cloud for Multi Tenancy
              How would Jim do this today on premises?


  Browser            Web T...
Gets expensive pretty quickly
#2 - Using the Cloud for Multi Tenancy


  Browser
Customer #1

  Browser        Web Tier     B/L Tier    Database
Custome...
Schema Customizations

  UI Customizations
Schema Customizations

  UI Customizations
3 options for data in multi tenant environment
#2 - Using the Cloud for Multi Tenancy


  Browser
                                                     Fixed Schema
Custo...
#2 - Using the Cloud for Multi Tenancy


  Browser                                                       Database
Customer...
#2 - Using the Cloud for Multi Tenancy


  Browser                                              Fixed Schema
             ...
#2 - Using the Cloud for Multi Tenancy
                                         Tenant


                                 ...
#2 - Using the Cloud for Multi Tenancy
                                       Tenant


                                   ...
#2 - Using the Cloud for Multi Tenancy
                                       Tenant


                                   ...
#2 - Using the Cloud for Multi Tenancy
                                            Tenant


                              ...
Schema Customizations

  UI Customizations
#2 - Using the Cloud for Multi Tenancy


  Browser
Customer #1

  Browser        Web Tier     B/L Tier    Database
Custome...
URL Handing
Can ASP
      .NET MVC Help?
Single Controller per Tenant

http://employeedata.cloudapp.net/CompanyA
          (CompanyAController)

http://employeedat...
Shared Controller per Tenant

http://employeedata.cloudapp.net/CompanyA
           (EmployeeController)

http://employeeda...
Shared Controller per Tenant (with URL mask)

          http://hr.companya.co.uk
(http://employeedata.cloudapp.net/employe...
#2 - Using the Cloud for Multi Tenancy

              http://hr.companya.co.uk
  Browser
Customer #1          http://emplo...
#2 - Using the Cloud for Multi Tenancy

              http://hr.companya.co.uk -> CNAME (employeedata.cloudapp.net)
  Brow...
#2 - Using the Cloud for Multi Tenancy

              http://hr.companya.co.uk -> CNAME (employeedata.cloudapp.net)
  Brow...
Demo: Multi Tenant Routing using ASP
                                   .NET MVC
Patterns for Cloud Computing
                   Takeaways

          Always consider Multi Tenancy first,
          even i...
Patterns for Moving to the Cloud




    Using the Cloud for Compute
Patterns for Cloud Computing




 Jim has seen how Azure enables multiple nodes
Patterns for Cloud Computing




    “Can I use all of these nodes in parallel?”
Patterns for Cloud Computing




  “I’ve got this multi-GB file I need analyzing…”
#3 - Using the Cloud for Compute



                                       Data
         Data                Worker
      ...
#3 - Using the Cloud for Compute



                           Result
                                    Worker

        ...
Popularized by the term “MapReduce”*




     * 2004 OSDI paper by Jeff Dean and Sanjay Ghemawat (Google)
#3 - Using the Cloud for Compute

               How many ”e”’s in
“The quick brown fox jumps over the lazy dog”?
        ...
#3 - Using the Cloud for Compute



                                      L<k,v>
                                         ...
And it’s definitely popular...
#3 - Using the Cloud for Compute

                    Google
20pb of data analyzed every day using MapReduce

            ...
Frameworks
#3 - Using the Cloud for Compute

            Apache Hadoop
Open Source Java “Inspired by MapReduce”
       (Core, HDFS, m...
How would Jim do this today on premises?
#3 - Using the Cloud for Compute
                     How would Jim do this today on premises?




                       ...
How about implementing this on Windows Azure?
#3 - Using the Cloud for Compute


                                                                             Data
     ...
Demo: Windows Azure Demo
 “Inspired by MapReduce”
Patterns for Cloud Computing
                   Takeaways

          MapReduce very visible, although
          can be dif...
Patterns for Moving to the Cloud




     Using the Cloud for Storage
Patterns for Cloud Computing




  “The cloud lets me store infinite data, right?”
Patterns for Cloud Computing




Lots of headaches with data management today
Patterns for Cloud Computing




        “It sounds too good to be true…”
How does Jim do this today on premises?
#4 - Using the Cloud for Storage
         How would Jim do this today on premises?




           File
                   ...
#4 - Using the Cloud for Storage
         How would Jim do this today on premises?




           Data   TDS (Tabular Data...
#4 - Using the Cloud for Storage
          How would Jim do this today on premises?




            Data
                 ...
#4 - Using the Cloud for Storage


   I love                         I love
    you!                         you too!



 ...
#4 - Using the Cloud for Storage


        I love                             I love
         you!                        ...
How does the cloud help?
Breaks the affinity between your data and hardware
#4 - Using the Cloud for Storage

“Code Near” Pattern
Data access code near to home, long data connection




    Client  ...
#4 - Using the Cloud for Storage

“Code Far” Pattern
Data access code far from home, short data
connection



    Client  ...
Blobs, Tables, Relational
Blobs, Tables, Relational
#4 - Using the Cloud for Storage


PutBlob                                                            Blob Container
PUT h...
#4 - Using the Cloud for Storage


                                                                   Blob Container


   ...
#4 - Using the Cloud for Storage


                                                                   Blob Container


   ...
#4 - Using the Cloud for Storage


PutBlock(blobname, blockid, data)                            Blob Container
PutBlockLis...
Blobs, Tables, Relational
#4 - Using the Cloud for Storage
REST:
GET http://account.table.core.windows.net/Customer?$filter=%20PartitionKey%20eq%20v...
Blobs, Tables, Relational
Codename Sitka (early 2008)
SQL Server Data Services (MIX08)
#4 - Using the Cloud for Storage

         This is what I’m doing on premises...



            Data
                     ...
#4 - Using the Cloud for Storage

         So, this is what I would like to do in the cloud...



            Data
       ...
SQL Data Services (MIX09)
SQL Azure (July 2009)
#4 - Using the Cloud for Storage

         So, this is what I would like to do...



            Data
                    ...
#4 - Using the Cloud for Storage




          HTTP               TDS
Browser           Web Role         SQL Azure   RDBMS
#4 - Using the Cloud for Storage




          HTTP              Queue                 TDS
Browser          Web Role      ...
Migration!
#4 - Using the Cloud for Storage


                             “The Data Center”


          HTTP                        ...
#4 - Using the Cloud for Storage


                                        “The Cloud”


          HTTP              Queue...
Demo: SQL Azure CTP
Patterns for Cloud Computing
                   Takeaways

          Understand the pricing model for
          storage on...
Patterns for Moving to the Cloud




 Using the Cloud for Communications
Patterns for Cloud Computing




 Jim’s organization needs to communicate with
               other organizations
Patterns for Cloud Computing




“This has always been a very tricky and expensive
             process to get working”
Patterns for Cloud Computing




    “Does the cloud offer anything to help?”
How would Jim have done this before?
#5 - Using the Cloud for Communications




                     Telco provided WAN
Company 1                             ...
#5 - Using the Cloud for Communications



                           Internet
                     Telco provided WAN
Com...
#5 - Using the Cloud for Communications



                           Internet
                     Telco provided WAN
Com...
What does the cloud provide?
#5 - Using the Cloud for Communications


                     http://app.queue.core.windows.net/


                      ...
#5 - Using the Cloud for Communications
Company 1

                     http://app.queue.core.windows.net/
  Client

     ...
#5 - Using the Cloud for Communications
Company 1

                     http://app.queue.core.windows.net/
  Client

     ...
#5 - Using the Cloud for Communications
Company 1

                     http://app.queue.core.windows.net/
  Client
   Mas...
#5 - Using the Cloud for Communications
Company 1

                     http://app.queue.core.windows.net/
  Client

     ...
#5 - Using the Cloud for Communications
            Proxy?
Company 1

            Firewall
                        http://...
#5 - Using the Cloud for Communications
Company 1

                 Firewall
                               http://app.que...
#5 - Using the Cloud for Communications
Company 1

                 Firewall
                                           ht...
#5 - Using the Cloud for Communications
Company 1

                 Firewall
                                       http:/...
How does the .NET Service Bus help?
#5 - Using the Cloud for Communications
Company 1

                                                        sb://.../myqueu...
#5 - Using the Cloud for Communications
Company 1

            Firewall
                                                  ...
#5 - Using the Cloud for Communications
This Conference
 MySQL Admin         Firewall
                                    ...
Demo: Socket Shifter
Patterns for Cloud Computing
                   Takeaways

          Be careful consuming Azure queues
          directly ...
Next Steps
Next Steps




       Obviously, our friend Jim, is fake…
Next Steps

             Make sure you have a clear definition
                    of Cloud Computing


               Exp...
simon.guest@microsoft.com
   http://simonguest.com
Patterns For Cloud Computing
Patterns For Cloud Computing
Upcoming SlideShare
Loading in...5
×

Patterns For Cloud Computing

21,319

Published on

Covers five patterns for cloud computing, showing implementations using Windows Azure

Published in: Technology
3 Comments
66 Likes
Statistics
Notes
No Downloads
Views
Total Views
21,319
On Slideshare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
3,239
Comments
3
Likes
66
Embeds 0
No embeds

No notes for slide

Transcript of "Patterns For Cloud Computing"

  1. 1. Patterns for Cloud Computing
  2. 2. Patterns for Cloud Computing This is Jim
  3. 3. Patterns for Cloud Computing Jim has many questions about cloud computing
  4. 4. Patterns for Cloud Computing The more he reads, the more confused he gets
  5. 5. Patterns for Cloud Computing “What is Cloud Computing?”
  6. 6. Patterns for Cloud Computing “What can I use the Cloud for?”
  7. 7. Patterns for Cloud Computing “What is Microsoft’s roadmap in this space?”
  8. 8. Answering these Questions can be Difficult
  9. 9. Answering these Questions can be Difficult So many alternative definitions from different vendors It can be difficult to describe what the cloud can be used for Keeping up with our beta and released products is challenging
  10. 10. Session Objectives
  11. 11. Session Objectives Explore a Clear Definition of Cloud Computing Arm you with 5 Patterns for Cloud-based Applications Show you how to Implement these Patterns using our Platform
  12. 12. Defining Cloud Computing
  13. 13. Defining Cloud Computing Jim has heard all the buzzwords
  14. 14. Defining Cloud Computing Service Oriented Architecture
  15. 15. Defining Cloud Computing Rich Internet Applications
  16. 16. Defining Cloud Computing Software as a Service
  17. 17. Defining Cloud Computing Software + Services
  18. 18. Defining Cloud Computing Are any of these cloud computing?
  19. 19. Defining Cloud Computing Styles of application architecture
  20. 20. Defining Cloud Computing These styles can work in the cloud, but they are not cloud computing
  21. 21. Defining Cloud Computing Where do your applications “live”?
  22. 22. Defining Cloud Computing On Premises Hosted Cloud
  23. 23. Defining Cloud Computing Application runs on-premises • Bring my own machines, Buy my own connectivity, software, etc.and hardware, • manage my own Complete control data center and responsibility • Upfront capital costs for the infrastructure
  24. 24. Defining Cloud Computing Application runs Application runs at a on-premises hoster • Bring my own • Rent machines, machines, connectivity, Buy my own Pay someone to software connectivity, software, etc.and hardware, host my application • Less control, but • manage my own Complete control using hardware that fewer data center and responsibility I specify responsibilities • Upfront capital • Lower capital costs, costs for the but pay for fixed infrastructure capacity, even if idle
  25. 25. Defining Cloud Computing Application runs Application runs at a Application runs using on-premises hoster cloud platform • Bring my own • Rent machines, • Shared, machines, connectivity, multi-tenant Pay someone for a Buy my own Pay someone to software environment connectivity, pool of computing software, etc.and hardware, host my application • Less control, but • Offers pool of resources that can • manage my own Complete control using hardware that fewer computing be applied to a set data center and responsibility I specify responsibilities resources, of applications abstracted from • Upfront capital • Lower capital costs, costs for the but pay for fixed infrastructure infrastructure capacity, even if idle • Pay as you go
  26. 26. Defining Cloud Computing Cloud “Variants”
  27. 27. Defining Cloud Computing Public Cloud
  28. 28. Defining Cloud Computing Pool of computing resources offered by a vendor, typically using a “pay as you go” model
  29. 29. Defining Cloud Computing Private Cloud
  30. 30. Defining Cloud Computing Pool of computing resources that lives within a self managed datacenter
  31. 31. Defining Cloud Computing Pool of computing resources that lives within a datacenter with no sharing
  32. 32. Defining Cloud Computing “What is Microsoft doing in Cloud Computing?”
  33. 33. Defining Cloud Computing Refer to the introductory Azure materials – not going to go through them here
  34. 34. Defining Cloud Computing 3 x Critical Concepts
  35. 35. Defining Cloud Computing Roles Web Role Worker Role
  36. 36. Defining Cloud Computing Storage Table, Blob, Relational
  37. 37. Defining Cloud Computing Messaging Queues
  38. 38. Patterns for Cloud Computing Using the Cloud for Scale
  39. 39. Patterns for Cloud Computing “Isn’t the cloud good for applications that need to scale dynamically?”
  40. 40. Patterns for Cloud Computing For example, tax applications
  41. 41. Patterns for Cloud Computing “How does this work?”
  42. 42. Patterns for Cloud Computing Let’s do some white boarding for Jim…
  43. 43. …and when I say white boarding, I really mean it
  44. 44. #1 - Using the Cloud for Scale “Wow! What a great site!” Request Browser Web Tier B/L Tier Database Response
  45. 45. #1 - Using the Cloud for Scale Browser Browser Browser Web Tier B/L Tier Database “Server Busy” Browser Browser
  46. 46. #1 - Using the Cloud for Scale Browser Browser Browser Web Tier B/L Tier Database Browser “Timeout” Browser
  47. 47. How would Jim do this today on premises?
  48. 48. #1 - Using the Cloud for Scale How would Jim do this today on premises? Browser Browser Web Tier N Browser L Web Tier B/L Tier Database B Browser Web Tier Browser
  49. 49. #1 - Using the Cloud for Scale How would Jim do this today on premises? Browser Browser B/L Tier N Browser Web Tier L B/L Tier Database B Browser B/L Tier Browser
  50. 50. #1 - Using the Cloud for Scale How would Jim do this today on premises? Browser Browser Web Tier B/L Tier N N Browser L Web Tier L B/L Tier Database B B Browser Web Tier B/L Tier Browser
  51. 51. #1 - Using the Cloud for Scale How would Jim do this today on premises? Browser p1 p2 p3 Browser Web Tier B/L Tier N N Browser L Web Tier L B/L Tier Database B B Browser Web Tier B/L Tier Browser
  52. 52. Not without consequences...
  53. 53. #1 - Using the Cloud for Scale How would Jim do this today on premises? Browser p1 p2 p3 Browser Web Tier B/L Tier N N Browser L Web Tier L B/L Tier Database B B Browser Web Tier B/L Tier Browser “That took a lot of work - and money!”
  54. 54. #1 - Using the Cloud for Scale How would Jim do this today on premises? p1 p2 p3 “Not so great now…” Web Tier B/L Tier N N Browser L Web Tier L B/L Tier Database B B Web Tier B/L Tier “That took a lot of work - and money!” “Hmmm... Most of this stuff is sitting idle...”
  55. 55. #1 - Using the Cloud for Scale Datacenter peak load Usage Idle time Jan Apr Jul Oct
  56. 56. How can Windows Azure help?
  57. 57. #1 - Using the Cloud for Scale “Wow! What a great site!” Request Browser Web Role Worker Role Azure Storage Response
  58. 58. #1 - Using the Cloud for Scale Browser Browser Browser Web Role Worker Role Azure Storage “Server Busy” Browser Browser
  59. 59. #1 - Using the Cloud for Scale Browser Browser Web Role N Browser L Web Role Worker Role Azure B Storage Browser Web Role Browser You don’t see this bit
  60. 60. #1 - Using the Cloud for Scale Browser Worker Browser Web Role Role N N Worker Azure Browser L Web Role L Role Storage B B Browser Worker Web Role Role Browser
  61. 61. #1 - Using the Cloud for Scale Browser p1 p2 p3 Worker Browser Web Role Role N N Worker Azure Browser L Web Role L Role Storage B B Browser Worker Web Role Role Browser
  62. 62. OK, so changing config is easy... …but what else do I need to know?
  63. 63. #1 - Using the Cloud for Scale Browser p1 p2 p3 Worker Browser Web Role Role N N Worker Azure Browser L Web Role L Role Storage B B Browser Worker Web Role Role Browser
  64. 64. #1 - Using the Cloud for Scale Web Role Worker Role Tight coupling between web and worker role is an anti-pattern
  65. 65. #1 - Using the Cloud for Scale 4. Process Web Role Worker Role 2. Respond to UI Req 1 Place on queue . 3. Pickup from queue Queue
  66. 66. #1 - Using the Cloud for Scale 4. Process Web Role Worker Role Req 5. Add result to table Queue 6. Query table on refresh Table
  67. 67. Demo: PrimeSolvr
  68. 68. How many web and worker roles do you need?
  69. 69. #1 - Using the Cloud for Scale Browser Browser Web Role N Browser L Web Role Worker Role Azure B Storage Browser Web Role Browser Collate IIS logs Testing / MOM pack
  70. 70. #1 - Using the Cloud for Scale Web Role Worker Role Req Queue
  71. 71. #1 - Using the Cloud for Scale Web Role Worker Role Web Role Worker Role Web Role Worker Role Req Req Req Queue Web Role Worker Role Web Role Monitor queue Worker Role length against user’s Web Role expectations Worker Role
  72. 72. Patterns for Cloud Computing Takeaways Using configuration, Azure makes it easy to scale roles Understand how to communicate between Web and Worker role Strategy on when to scale up/down roles in production
  73. 73. Patterns for Moving to the Cloud Using the Cloud for Multi Tenancy
  74. 74. Patterns for Cloud Computing “I like the idea of scaling Web roles…”
  75. 75. Patterns for Cloud Computing “…but need to serve multiple customers”
  76. 76. Patterns for Cloud Computing “Without creating separate codebases!”
  77. 77. #2 - Using the Cloud for Multi Tenancy Browser Web Tier B/L Tier Database Customer #1
  78. 78. How would Jim do this today on premises?
  79. 79. #2 - Using the Cloud for Multi Tenancy How would Jim do this today on premises? Browser Web Tier B/L Tier Database Customer #1 Browser Web Tier B/L Tier Database Customer #2 Browser Web Tier B/L Tier Database Customer #3
  80. 80. Gets expensive pretty quickly
  81. 81. #2 - Using the Cloud for Multi Tenancy Browser Customer #1 Browser Web Tier B/L Tier Database Customer #2 Browser Customer #3
  82. 82. Schema Customizations UI Customizations
  83. 83. Schema Customizations UI Customizations
  84. 84. 3 options for data in multi tenant environment
  85. 85. #2 - Using the Cloud for Multi Tenancy Browser Fixed Schema Customer #1 Browser Web Tier B/L Tier Database Customer #2 Browser Option 1: Everyone Uses the Same Database/Schema Customer #3 Pros: Simplest approach, easy to maintain/upgrade. Cons: No customizations. Restoring of tenant data.
  86. 86. #2 - Using the Cloud for Multi Tenancy Browser Database Customer #1 Customer #1 Browser Web Tier B/L Tier Database Customer #2 Customer #2 Browser Database Customer #3 Customer #3 Option 2: Give Each Customer Their Own Database/Schema Pros: Flexible. Tenant restore is easier. High Isolation. Cons: Can be costly. Difficult to upgrade db schemas.
  87. 87. #2 - Using the Cloud for Multi Tenancy Browser Fixed Schema with Customizations Customer #1 Browser Web Tier B/L Tier Database Customer #2 Browser Option 3: Fixed Database/Schema, with customizations Customer #3 Pros: Customers can add their own custom fields Cons: Non standard way of customizing the schema. Tenant restore is difficult.
  88. 88. #2 - Using the Cloud for Multi Tenancy Tenant * 1 TenantID int TenantName nvarchar * Employee EmployeeId int TypeID * Type int FirstName nvarchar Name nvarchar LastName nvarchar CLRType nvarchar 1 1 Customization * int * CustomizationID Value nvarchar
  89. 89. #2 - Using the Cloud for Multi Tenancy Tenant * 1 TenantID 1 TenantName UK Branch * Employee EmployeeId 1 TypeID * Type 1 FirstName Gordon Name PostalCode LastName Brown CLRType string 1 1 Customization * 1 * CustomizationID Value SW1 2AA A
  90. 90. #2 - Using the Cloud for Multi Tenancy Tenant * 1 TenantID 2 TenantName US Branch * Employee EmployeeId 2 TypeID * Type 2 FirstName Barack Name ZipCode LastName Obama CLRType string 1 1 Customization * 2 * CustomizationID Value 20500
  91. 91. #2 - Using the Cloud for Multi Tenancy Tenant * 1 Fixed Schema TenantID 2 Applies to All Could be both TenantName US Branch * * Tenants Employee Type EmployeeId 2 TypeID 2 Customizable FirstName Barack Tenant by Tenant Name ZipCode LastName Obama Basis CLRType string 1 1 Customization * 2 * CustomizationID Value 20500
  92. 92. Schema Customizations UI Customizations
  93. 93. #2 - Using the Cloud for Multi Tenancy Browser Customer #1 Browser Web Tier B/L Tier Database Customer #2 Browser Customer #3
  94. 94. URL Handing
  95. 95. Can ASP .NET MVC Help?
  96. 96. Single Controller per Tenant http://employeedata.cloudapp.net/CompanyA (CompanyAController) http://employeedata.cloudapp.net/CompanyB (CompanyBController)
  97. 97. Shared Controller per Tenant http://employeedata.cloudapp.net/CompanyA (EmployeeController) http://employeedata.cloudapp.net/CompanyB (EmployeeController)
  98. 98. Shared Controller per Tenant (with URL mask) http://hr.companya.co.uk (http://employeedata.cloudapp.net/employees) http://hr.companyb.com (http://employeedata.cloudapp.net/employees)
  99. 99. #2 - Using the Cloud for Multi Tenancy http://hr.companya.co.uk Browser Customer #1 http://employeedata.cloudapp.net Browser Web Tier B/L Tier Database Customer #2 Browser Customer #3 http://hr.companyb.com
  100. 100. #2 - Using the Cloud for Multi Tenancy http://hr.companya.co.uk -> CNAME (employeedata.cloudapp.net) Browser Customer #1 http://employeedata.cloudapp.net Browser Web Tier B/L Tier Database Customer #2 Browser Customer #3 http://hr.companyb.com -> CNAME (employeedata.cloudapp.net)
  101. 101. #2 - Using the Cloud for Multi Tenancy http://hr.companya.co.uk -> CNAME (employeedata.cloudapp.net) Browser Customer #1 http://employeedata.cloudapp.net Browser Web Tier B/L Tier Database Customer #2 Use custom routing in ASP .NET MVC Browser Customer #3 http://hr.companyb.com -> CNAME (employeedata.cloudapp.net)
  102. 102. Demo: Multi Tenant Routing using ASP .NET MVC
  103. 103. Patterns for Cloud Computing Takeaways Always consider Multi Tenancy first, even if only one customer Design considerations must include both data and UI Many other considerations (such as identity)
  104. 104. Patterns for Moving to the Cloud Using the Cloud for Compute
  105. 105. Patterns for Cloud Computing Jim has seen how Azure enables multiple nodes
  106. 106. Patterns for Cloud Computing “Can I use all of these nodes in parallel?”
  107. 107. Patterns for Cloud Computing “I’ve got this multi-GB file I need analyzing…”
  108. 108. #3 - Using the Cloud for Compute Data Data Worker Data Client Master Worker Data Worker
  109. 109. #3 - Using the Cloud for Compute Result Worker Result Client Master Worker Result Worker Result
  110. 110. Popularized by the term “MapReduce”* * 2004 OSDI paper by Jeff Dean and Sanjay Ghemawat (Google)
  111. 111. #3 - Using the Cloud for Compute How many ”e”’s in “The quick brown fox jumps over the lazy dog”? M<k,v> Data Worker M<k,v> Client Master Worker M<k.v> Worker “Map” M<“the quick brown”.”e”> M<“fox jumps over”.”e”> M<“the lazy dog”.”e”>
  112. 112. #3 - Using the Cloud for Compute L<k,v> Worker L<k,v> Client Master Worker Result Worker L<k,v> 3 x ”e”s found “Reduce” L<”e”,”1”> L<”e”,”1”> L<”e”,”1”>
  113. 113. And it’s definitely popular...
  114. 114. #3 - Using the Cloud for Compute Google 20pb of data analyzed every day using MapReduce Yahoo! 10k+ cores, 4pb of data using MapReduce Facebook 2500+ cores, 1pb of data using MapReduce
  115. 115. Frameworks
  116. 116. #3 - Using the Cloud for Compute Apache Hadoop Open Source Java “Inspired by MapReduce” (Core, HDFS, many more) Cloudera Consulting, training, distribution of Hadoop Amazon Elastic MapReduce Hadoop implementation on EC2
  117. 117. How would Jim do this today on premises?
  118. 118. #3 - Using the Cloud for Compute How would Jim do this today on premises? Data Data Worker Data Client Master Worker Client Application Job/Task Scheduler Worker Data Remote Service
  119. 119. How about implementing this on Windows Azure?
  120. 120. #3 - Using the Cloud for Compute Data Worker Data Data Worker Client Web Role Data Client Application Job/Task Scheduler Worker Remote Service Req Queue Table
  121. 121. Demo: Windows Azure Demo “Inspired by MapReduce”
  122. 122. Patterns for Cloud Computing Takeaways MapReduce very visible, although can be difficult to initially grasp Learn about existing frameworks, especially Apache Hadoop Read up on Dryad (DryadLINQ) for future direction
  123. 123. Patterns for Moving to the Cloud Using the Cloud for Storage
  124. 124. Patterns for Cloud Computing “The cloud lets me store infinite data, right?”
  125. 125. Patterns for Cloud Computing Lots of headaches with data management today
  126. 126. Patterns for Cloud Computing “It sounds too good to be true…”
  127. 127. How does Jim do this today on premises?
  128. 128. #4 - Using the Cloud for Storage How would Jim do this today on premises? File RPC/NFS Client File Server Store
  129. 129. #4 - Using the Cloud for Storage How would Jim do this today on premises? Data TDS (Tabular Data Stream) Client DB Server RDBMS
  130. 130. #4 - Using the Cloud for Storage How would Jim do this today on premises? Data HTTP POST Browser Web Server Database
  131. 131. #4 - Using the Cloud for Storage I love I love you! you too! Server Data Affinity between your data and physical hardware that serves it
  132. 132. #4 - Using the Cloud for Storage I love I love you! you too! Server Data Symptoms: Which RAID number was that again? Tedious to backup exponentially growing data Crap! I’m at 95% capacity - got to move to a bigger disk
  133. 133. How does the cloud help?
  134. 134. Breaks the affinity between your data and hardware
  135. 135. #4 - Using the Cloud for Storage “Code Near” Pattern Data access code near to home, long data connection Client DAL Cloud Storage Good for offline scenarios + client applications DAL -> Storage typically REST connection
  136. 136. #4 - Using the Cloud for Storage “Code Far” Pattern Data access code far from home, short data connection Client Web Tier DAL Cloud Storage Good for browser based scenarios, but no offline. Good for “chattier” applications between DAL and database
  137. 137. Blobs, Tables, Relational
  138. 138. Blobs, Tables, Relational
  139. 139. #4 - Using the Cloud for Storage PutBlob Blob Container PUT http://account.blob.core.windows./net/containername/blobname REST API Client Azure Blob Storage http://account.blob.core.windows.net/containername/blobname PutBlob = 64Mb MAX MetaData = 8Kb per Blob
  140. 140. #4 - Using the Cloud for Storage Blob Container REST API Client Azure Blob Storage GetBlob GET http://account.blob.core.windows./net/containername/blobname http://account.blob.core.windows.net/containername/blobname
  141. 141. #4 - Using the Cloud for Storage Blob Container REST API Client Azure Blob Storage GetBlob GET http://account.blob.core.windows./net/containername/blobname Range: bytes=329300 - 730000 http://account.blob.core.windows.net/containername/blobname
  142. 142. #4 - Using the Cloud for Storage PutBlock(blobname, blockid, data) Blob Container PutBlockList(blobname, blockid1 …, blockidN) , REST API Client Azure Blob Storage http://account.blob.core.windows.net/containername/blobname PutBlock = 4Mb MAX to a maximum of 50Gb BlockId = 64 bytes
  143. 143. Blobs, Tables, Relational
  144. 144. #4 - Using the Cloud for Storage REST: GET http://account.table.core.windows.net/Customer?$filter=%20PartitionKey%20eq%20value LINQ: var customers = from o in context.CreateQuery<customer>(“Customer”) where o.PartitionKey == value select o; Worker Role Azure Table Storage http://account.table.core.windows.net Each Table: PartitionKey (e.g. DocumentName) to ensure scalability RowKey (e.g. version number) [fields] for data
  145. 145. Blobs, Tables, Relational
  146. 146. Codename Sitka (early 2008)
  147. 147. SQL Server Data Services (MIX08)
  148. 148. #4 - Using the Cloud for Storage This is what I’m doing on premises... Data TDS Client DB Server RDBMS
  149. 149. #4 - Using the Cloud for Storage So, this is what I would like to do in the cloud... Data TDS Client DB Server RDBMS
  150. 150. SQL Data Services (MIX09)
  151. 151. SQL Azure (July 2009)
  152. 152. #4 - Using the Cloud for Storage So, this is what I would like to do... Data TDS Client SQL Azure RDBMS
  153. 153. #4 - Using the Cloud for Storage HTTP TDS Browser Web Role SQL Azure RDBMS
  154. 154. #4 - Using the Cloud for Storage HTTP Queue TDS Browser Web Role Worker Role SQL Azure RDBMS
  155. 155. Migration!
  156. 156. #4 - Using the Cloud for Storage “The Data Center” HTTP TDS Browser Web Tier Bus. Logic SQL Server RDBMS
  157. 157. #4 - Using the Cloud for Storage “The Cloud” HTTP Queue TDS Browser Web Role Worker Role SQL Azure RDBMS
  158. 158. Demo: SQL Azure CTP
  159. 159. Patterns for Cloud Computing Takeaways Understand the pricing model for storage on-premises vs. cloud Read up and understand code near/code far models SQL Azure as a factor for migration/move from on premises
  160. 160. Patterns for Moving to the Cloud Using the Cloud for Communications
  161. 161. Patterns for Cloud Computing Jim’s organization needs to communicate with other organizations
  162. 162. Patterns for Cloud Computing “This has always been a very tricky and expensive process to get working”
  163. 163. Patterns for Cloud Computing “Does the cloud offer anything to help?”
  164. 164. How would Jim have done this before?
  165. 165. #5 - Using the Cloud for Communications Telco provided WAN Company 1 Company 2 Client Server FTP FTP Client Server
  166. 166. #5 - Using the Cloud for Communications Internet Telco provided WAN Company 1 Company 2 Client Server FTP FTP Client Server
  167. 167. #5 - Using the Cloud for Communications Internet Telco provided WAN Company 1 Company 2 DMZ Client Server Extranet Browser Site
  168. 168. What does the cloud provide?
  169. 169. #5 - Using the Cloud for Communications http://app.queue.core.windows.net/ REST Client Azure Queue
  170. 170. #5 - Using the Cloud for Communications Company 1 http://app.queue.core.windows.net/ Client REST Azure Queue Company 2 Client
  171. 171. #5 - Using the Cloud for Communications Company 1 http://app.queue.core.windows.net/ Client REST Azure Queue Company 2 Client
  172. 172. #5 - Using the Cloud for Communications Company 1 http://app.queue.core.windows.net/ Client Master Key REST Azure Queue Company 2 Client Master Key
  173. 173. #5 - Using the Cloud for Communications Company 1 http://app.queue.core.windows.net/ Client REST Web Role Azure Queue Company 2 Client
  174. 174. #5 - Using the Cloud for Communications Proxy? Company 1 Firewall http://app.queue.core.windows.net/ Client REST Web Role Azure Queue Company 2 Client Firewall
  175. 175. #5 - Using the Cloud for Communications Company 1 Firewall http://app.queue.core.windows.net/ Client REST Web Role Azure Queue Company 2 65.55.33.204 Client Firewall 192.168.14.100 NAT?
  176. 176. #5 - Using the Cloud for Communications Company 1 Firewall http://app.queue.core.windows.net/ Client REST Web Role Azure Queue Company 2 65.55.33.204 Client Firewall 192.168.14.100 OK, so I’ll do a HTTP poll every minute
  177. 177. #5 - Using the Cloud for Communications Company 1 Firewall http://app.queue.core.windows.net/ Client REST Web Role Azure Queue Company 2 65.55.33.204 Client Firewall 192.168.14.100 …and how about other protocols other than HTTP?
  178. 178. How does the .NET Service Bus help?
  179. 179. #5 - Using the Cloud for Communications Company 1 sb://.../myqueue Client .NET Service Bus Company 2 Client Firewall Outbound bi-directional socket Kept alive in background
  180. 180. #5 - Using the Cloud for Communications Company 1 Firewall sb://.../myqueue Client Outbound one-way socket .NET Service Bus Company 2 Message routed Client accordingly Firewall Outbound bi-directional socket Kept alive in background
  181. 181. #5 - Using the Cloud for Communications This Conference MySQL Admin Firewall sb://.../myqueue My Laptop Outbound one-way socket Localhost:1000 .NET Service Bus My Home Message routed Home PC accordingly 192.168.14.193 Firewall Outbound bi-directional socket Kept alive in background My SQL Port 3306
  182. 182. Demo: Socket Shifter
  183. 183. Patterns for Cloud Computing Takeaways Be careful consuming Azure queues directly via REST Firewalls/NATs can add additional trouble (especially non-HTTP) Learn how .NET Service Bus traverses in these scenarios
  184. 184. Next Steps
  185. 185. Next Steps Obviously, our friend Jim, is fake…
  186. 186. Next Steps Make sure you have a clear definition of Cloud Computing Explore the 5 usage patterns for your scenarios today Think about the next steps for implementation and migration
  187. 187. simon.guest@microsoft.com http://simonguest.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×