Patterns for Cloud Computing Simon Guest Senior Director, Technical - - PowerPoint PPT Presentation

patterns for cloud computing
SMART_READER_LITE
LIVE PREVIEW

Patterns for Cloud Computing Simon Guest Senior Director, Technical - - PowerPoint PPT Presentation

Patterns for Cloud Computing Simon Guest Senior Director, Technical Strategy Microsoft Corporation Patterns for Cloud Computing Patterns for Cloud Computing This is Jim Patterns for Cloud Computing Jim has many questions about cloud


slide-1
SLIDE 1

Patterns for Cloud Computing

Simon Guest Senior Director, Technical Strategy Microsoft Corporation

slide-2
SLIDE 2

Patterns for Cloud Computing

slide-3
SLIDE 3

This is Jim Patterns for Cloud Computing

slide-4
SLIDE 4

Jim has many questions about cloud computing Patterns for Cloud Computing

slide-5
SLIDE 5

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

slide-6
SLIDE 6

“What is cloud computing?” Patterns for Cloud Computing

slide-7
SLIDE 7

“What are vendors doing in this space?” Patterns for Cloud Computing

slide-8
SLIDE 8

“What applications make sense in the cloud?” Patterns for Cloud Computing

slide-9
SLIDE 9

Session Objectives

slide-10
SLIDE 10

Session Objectives Build on Stefan’s introduction of

  • f cloud computing

Provide you with 5 patterns for cloud-based applications Show implementations of these patterns

slide-11
SLIDE 11

Defining Cloud Computing

slide-12
SLIDE 12

Defining Cloud Computing

Application runs

  • n-premises

Buy my own hardware, and manage my own data center

Application runs

  • n-premises
  • Bring my own

machines, connectivity, software, etc.

  • Complete control

and responsibility

  • Upfront capital

costs for the infrastructure

slide-13
SLIDE 13

Defining Cloud Computing

Application runs

  • n-premises

Buy my own hardware, and manage my own data center

Application runs at a

hoster Pay someone to host my application using hardware that I specify

Application runs

  • n-premises
  • Bring my own

machines, connectivity, software, etc.

  • Complete control

and responsibility

  • Upfront capital

costs for the infrastructure Application runs at a

hoster

  • Rent machines,

connectivity, software

  • Less control, but

fewer responsibilities

  • Lower capital costs,

but pay for fixed capacity, even if idle

slide-14
SLIDE 14

Defining Cloud Computing

Application runs

  • n-premises

Buy my own hardware, and manage my own data center

Application runs at a

hoster Pay someone to host my application using hardware that I specify

Application runs using

cloud platform Pay someone for a pool of computing resources that can be applied to a set

  • f applications

Application runs

  • n-premises
  • Bring my own

machines, connectivity, software, etc.

  • Complete control

and responsibility

  • Upfront capital

costs for the infrastructure Application runs at a

hoster

  • Rent machines,

connectivity, software

  • Less control, but

fewer responsibilities

  • Lower capital costs,

but pay for fixed capacity, even if idle Application runs using

cloud platform

  • Shared,

multi-tenant environment

  • Offers pool of

computing resources, abstracted from infrastructure

  • Pay as you go
slide-15
SLIDE 15

Defining Cloud Computing

Cloud “Variants”

slide-16
SLIDE 16

Defining Cloud Computing

Public Cloud

slide-17
SLIDE 17

Defining Cloud Computing

Pool of computing resources offered by a vendor, typically using a “pay as you go” model

slide-18
SLIDE 18

Defining Cloud Computing

Private Cloud

slide-19
SLIDE 19

Defining Cloud Computing

Pool of computing resources that lives within a self managed datacenter

slide-20
SLIDE 20

Defining Cloud Computing

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

slide-21
SLIDE 21

Defining Cloud Computing

Compute: Virtualized compute based on Windows Server Storage: Durable, scalable, & available storage Management: Automated, management of the service Database: Relational processing for structured/ unstructured data Service Bus: General purpose application bus Access Control: Rules-driven, claims-based access control

slide-22
SLIDE 22

Defining Cloud Computing

Different Models

Infrastructure as a Service (IaaS) vs. Platform as a Service (PaaS)

slide-23
SLIDE 23

Defining Cloud Computing

Operating System Web Server Frameworks Your Application OS Services Deployment Provided By Amazon EC2 Virtualized Instance Hardware Provided by Windows Azure Deployment

slide-24
SLIDE 24

Defining Cloud Computing

Operating System Web Server Frameworks Your Application OS Services Provided by Google AppEngine Virtualized Instance Hardware Deployment Provided by Windows Azure Deployment

slide-25
SLIDE 25

Patterns for Cloud Computing

#1 - Using the Cloud for Scale

slide-26
SLIDE 26

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

slide-27
SLIDE 27

“For example, applications that have spikes or peak loads” Patterns for Cloud Computing

slide-28
SLIDE 28

“How does this work?” Patterns for Cloud Computing

slide-29
SLIDE 29

Let’s do some white boarding for Jim… Patterns for Cloud Computing

slide-30
SLIDE 30

…and when I say white boarding, I really mean it

slide-31
SLIDE 31

#1 - Using the Cloud for Scale

Web Tier Browser

Request

B/L Tier Database

Response

“Wow! What a great site!”

slide-32
SLIDE 32

#1 - Using the Cloud for Scale

Web Tier B/L Tier Database Browser Browser Browser Browser Browser

“Server Busy”

slide-33
SLIDE 33

#1 - Using the Cloud for Scale

Web Tier B/L Tier Database Browser

“Timeout”

Browser Browser Browser Browser

slide-34
SLIDE 34

How would Jim do this today on premises?

slide-35
SLIDE 35

#1 - Using the Cloud for Scale

Web Tier B/L Tier Database Browser Browser Browser Browser Browser Web Tier Web Tier N L B

How would Jim do this today on premises?

slide-36
SLIDE 36

#1 - Using the Cloud for Scale

Database Browser Browser Browser Browser Browser Web Tier B/L Tier B/L Tier B/L Tier N L B

How would Jim do this today on premises?

slide-37
SLIDE 37

#1 - Using the Cloud for Scale

Database Browser Browser Browser Browser Browser B/L Tier B/L Tier B/L Tier N L B Web Tier Web Tier Web Tier N L B

How would Jim do this today on premises?

slide-38
SLIDE 38

#1 - Using the Cloud for Scale

Browser Browser Browser Browser Browser B/L Tier B/L Tier B/L Tier N L B Database

p1 p2 p3

Web Tier Web Tier Web Tier N L B

How would Jim do this today on premises?

slide-39
SLIDE 39

Not without consequences...

slide-40
SLIDE 40

#1 - Using the Cloud for Scale

Browser Browser Browser Browser Browser B/L Tier B/L Tier B/L Tier N L B Database

p1 p2 p3

Web Tier Web Tier Web Tier N L B “That took a lot of work - and money!”

How would Jim do this today on premises?

slide-41
SLIDE 41

#1 - Using the Cloud for Scale

Browser B/L Tier B/L Tier B/L Tier N L B Database

p1 p2 p3

Web Tier Web Tier Web Tier N L B “Not so great now…” “Hmmm... Most of this stuff is sitting idle...” “That took a lot of work - and money!”

How would Jim do this today on premises?

slide-42
SLIDE 42

#1 - Using the Cloud for Scale

Usage Jan Apr Jul Oct Datacenter peak load Idle time

slide-43
SLIDE 43

How can cloud computing help?

slide-44
SLIDE 44

#1 - Using the Cloud for Scale

Web Role Browser

Request

Worker Role Azure Storage

Response

“Wow! What a great site!”

slide-45
SLIDE 45

#1 - Using the Cloud for Scale

Web Role Worker Role Azure Storage Browser

“Server Busy”

Browser Browser Browser Browser

slide-46
SLIDE 46
slide-47
SLIDE 47
slide-48
SLIDE 48

#1 - Using the Cloud for Scale

Web Role Worker Role Azure Storage Browser Browser Browser Browser Browser Web Role Web Role N L B You don’t see this bit

slide-49
SLIDE 49

#1 - Using the Cloud for Scale

Web Role Azure Storage Browser Browser Browser Browser Browser Web Role Web Role N L B Worker Role Worker Role Worker Role N L B

slide-50
SLIDE 50

OK, so changing config is easy... …but what else do I need to know?

slide-51
SLIDE 51

#1 - Using the Cloud for Scale

Web Role Browser Browser Browser Browser Browser Web Role Web Role N L B N L B Azure Storage Worker Role Worker Role Worker Role

slide-52
SLIDE 52

#1 - Using the Cloud for Scale

Web Role Browser Browser Browser Browser Browser Web Role Web Role N L B N L B Azure Storage Worker Role Worker Role Worker Role Tight coupling between web and worker role is an anti-pattern

slide-53
SLIDE 53

#1 - Using the Cloud for Scale

Web Role Worker Role Queue

Req

1 . Place on queue

  • 3. Pickup from queue
  • 4. Process
  • 2. Respond to UI
slide-54
SLIDE 54

#1 - Using the Cloud for Scale

Web Role Worker Role Queue

Req

  • 4. Process

Table

  • 5. Add result to table
  • 6. Query table on refresh
slide-55
SLIDE 55

Demo: Prime Solver

slide-56
SLIDE 56

How many web and worker roles do you need?

slide-57
SLIDE 57

How many web and worker roles do you need?

slide-58
SLIDE 58

#1 - Using the Cloud for Scale

Web Role Worker Role Azure Storage Browser Browser Browser Browser Browser Web Role Web Role N L B Worker Role Log WMI_Win32_PerfF

  • rmattedData_ASPNET_ASPNETApplications

/RequestsPerSecond Management API

  • r Email
slide-59
SLIDE 59

How many web and worker roles do you need?

slide-60
SLIDE 60

#1 - Using the Cloud for Scale

Web Role Queue

Req

Web Role Web Role

Req Req

Monitor queue length against user’ s expectations Web Role Web Role Web Role Worker Role

slide-61
SLIDE 61

#1 - Using the Cloud for Scale

Web Role Queue

Req

Web Role Web Role

Req Req

Monitor queue length against user’ s expectations Web Role Web Role Web Role Worker Role Worker Role Worker Role Worker Role Worker Role Worker Role

slide-62
SLIDE 62

Patterns for Cloud Computing Takeaways Understand how to communicate between roles and nodes Strategy on when to scale up/down roles in production A core tenet of cloud computing is the ability to scale up/down

slide-63
SLIDE 63

Patterns for Moving to the Cloud

#2 - Using the Cloud for Multi Tenancy

slide-64
SLIDE 64

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

slide-65
SLIDE 65

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

slide-66
SLIDE 66

“Without creating separate codebases!” Patterns for Cloud Computing

slide-67
SLIDE 67

How would Jim do this today on premises?

slide-68
SLIDE 68

#2 - Using the Cloud for Multi Tenancy

Web Tier Browser B/L Tier Database Customer #2 Web Tier Browser B/L Tier Database Customer #1 Web Tier Browser B/L Tier Database Customer #3

How would Jim do this today on premises?

slide-69
SLIDE 69

Gets expensive pretty quickly

slide-70
SLIDE 70

#2 - Using the Cloud for Multi Tenancy

Web Tier Browser B/L Tier Database Browser Browser Customer #1 Customer #2 Customer #3

slide-71
SLIDE 71

Schema Customizations UI Customizations

slide-72
SLIDE 72

Schema Customizations UI Customizations

slide-73
SLIDE 73

3 options for data in multi tenant environment

slide-74
SLIDE 74

#2 - Using the Cloud for Multi Tenancy

Web Tier Browser B/L Tier Database Browser Browser Customer #1 Customer #2 Customer #3

Option 1 : Everyone Uses the Same Database/Schema

Fixed Schema

Pros: Simplest approach, easy to maintain/upgrade. Cons: No customizations. Restoring of tenant data.

slide-75
SLIDE 75

#2 - Using the Cloud for Multi Tenancy

Web Tier Browser B/L Tier Database Browser Browser Customer #1 Customer #2 Customer #3

Option 2: Give Each Customer Their Own Database/Schema

Customer #1 Database Database Customer #2 Customer #3

Pros: Flexible. Tenant restore is easier . High Isolation. Cons: Can be costly. Difficult to upgrade db schemas.

slide-76
SLIDE 76

#2 - Using the Cloud for Multi Tenancy

Web Tier Browser B/L Tier Database Browser Browser Customer #1 Customer #2 Customer #3

Option 3: Fixed Database/Schema, with customizations

Fixed Schema with Customizations

Pros: Customers can add their own custom fields Cons: Non standard way of customizing the schema. Tenant restore is difficult.

slide-77
SLIDE 77

#2 - Using the Cloud for Multi Tenancy

TenantID

Tenant

int TenantName nvarchar EmployeeId

Employee

int FirstName nvarchar LastName nvarchar

CustomizationID

Customization

int Value nvarchar TypeID

Type

int Name nvarchar CLRType nvarchar

1

* *

1

*

1

* *

slide-78
SLIDE 78

#2 - Using the Cloud for Multi Tenancy

TenantID

Tenant

1 TenantName UK Branch EmployeeId

Employee

1 FirstName Gordon LastName Brown

CustomizationID

Customization

1 Value SW1 A 2AA TypeID

Type

1 Name PostalCode CLRType string

1

* *

1

*

1

* *

slide-79
SLIDE 79

#2 - Using the Cloud for Multi Tenancy

TenantID

Tenant

2 TenantName US Branch EmployeeId

Employee

2 FirstName Barack LastName Obama

CustomizationID

Customization

2 Value 20500 TypeID

Type

2 Name ZipCode CLRType string

1

* *

1

*

1

* *

slide-80
SLIDE 80

#2 - Using the Cloud for Multi Tenancy

TenantID

Tenant

2 TenantName US Branch EmployeeId

Employee

2 FirstName Barack LastName Obama

CustomizationID

Customization

2 Value 20500 TypeID

Type

2 Name ZipCode CLRType string

1

* *

1

*

1

* *

Fixed Schema Applies to All Tenants Customizable Tenant by Tenant Basis Could be both

slide-81
SLIDE 81

Schema Customizations UI Customizations

slide-82
SLIDE 82

#2 - Using the Cloud for Multi Tenancy

Web Tier Browser B/L Tier Database Browser Browser Customer #1 Customer #2 Customer #3

slide-83
SLIDE 83

URL Handing

slide-84
SLIDE 84

Routing using MVC approach

slide-85
SLIDE 85

#2 - Using the Cloud for Multi Tenancy

Web Tier Browser B/L Tier Database Browser Browser Customer #1 Customer #2 Customer #3 http://hr .contoso.co.uk http://hr .fabrikam.com http://employeedata.cloudapp.net

slide-86
SLIDE 86

#2 - Using the Cloud for Multi Tenancy

Web Tier Browser B/L Tier Database Browser Browser Customer #1 Customer #2 Customer #3 http://hr .contoso.co.uk -> CNAME (employeedata.cloudapp.net) http://hr .fabrikam.com -> CNAME (employeedata.cloudapp.net) http://employeedata.cloudapp.net

slide-87
SLIDE 87

#2 - Using the Cloud for Multi Tenancy

Web Tier Browser B/L Tier Database Browser Browser Customer #1 Customer #2 Customer #3 http://hr .contoso.co.uk -> CNAME (employeedata.cloudapp.net) http://hr .fabrikam.com -> CNAME (employeedata.cloudapp.net) Use custom route to controller mapping http://employeedata.cloudapp.net

slide-88
SLIDE 88

Demo: Multi Tenant Schema and UI

slide-89
SLIDE 89

Patterns for Cloud Computing Takeaways Design considerations must include both data and UI Many other considerations, such as identity – p&p guidance Always consider Multi Tenancy first, even if only one customer

slide-90
SLIDE 90

Patterns for Moving to the Cloud

#3 - Using the Cloud for Compute

slide-91
SLIDE 91

Jim sees how cloud computing supports scaling up/down nodes Patterns for Cloud Computing

slide-92
SLIDE 92

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

slide-93
SLIDE 93

“I’ve got this complex calculation I would like to share across these multiple nodes…” Patterns for Cloud Computing

slide-94
SLIDE 94

#3 - Using the Cloud for Compute

Master Client

Data

Worker Worker Worker

Data Data Data

slide-95
SLIDE 95

#3 - Using the Cloud for Compute

Master Client

Result

Worker Worker Worker

Result Result Result

slide-96
SLIDE 96

Popularized by the term “MapReduce”*

* 2004 OSDI paper by Jeff Dean and Sanjay Ghemawat (Google)

slide-97
SLIDE 97

#3 - Using the Cloud for Compute

Master Client

Data

Worker Worker Worker “Map”

M<k,v> M<k,v> M<k.v>

M<“the quick brown”.”e”> M<“fox jumps over”.”e”> M<“the lazy dog”.”e”> How many ”e”’ s in “The quick brown fox jumps over the lazy dog”?

slide-98
SLIDE 98

#3 - Using the Cloud for Compute

Master Client

Result

Worker Worker Worker “Reduce”

L<k,v> L<k,v> L<k,v>

L<”e”,”1 ”> L<”e”,”1 ”> L<”e”,”1 ”> 3 x ”e”s found

slide-99
SLIDE 99

And it’ s definitely popular ...

slide-100
SLIDE 100

#3 - Using the Cloud for Compute

Google 20pb of data analyzed every day using MapReduce Yahoo! 1 0k+ cores, 4pb of data using MapReduce Facebook 2500+ cores, 1 pb of data using MapReduce

slide-101
SLIDE 101

Frameworks

slide-102
SLIDE 102

#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

slide-103
SLIDE 103

How would Jim do this today on premises?

slide-104
SLIDE 104

#3 - Using the Cloud for Compute

Master Client

Data

Worker Worker Worker

Data Data Data

Client Application Job/Task Scheduler Remote Service

How would Jim do this today on premises?

slide-105
SLIDE 105

How about implementing this on Windows Azure?

slide-106
SLIDE 106

#3 - Using the Cloud for Compute

Web Role Client

Data

Worker Worker Worker

Data Data Data

Client Application Job/Task Scheduler Remote Service Queue

Req

Table

slide-107
SLIDE 107

Demo: Windows Azure Demo “Inspired by MapReduce”

slide-108
SLIDE 108

Patterns for Cloud Computing Takeaways Learn about existing frameworks, especially Apache Hadoop Read up on Dryad (DryadLINQ) for future direction MapReduce very visible, although can be difficult to initially grasp

slide-109
SLIDE 109

Patterns for Moving to the Cloud

#4 - Using the Cloud for Storage

slide-110
SLIDE 110

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

slide-111
SLIDE 111

Lots of headaches with data management today Patterns for Cloud Computing

slide-112
SLIDE 112

“It sounds too good to be true…” Patterns for Cloud Computing

slide-113
SLIDE 113

How does Jim do this today on premises?

slide-114
SLIDE 114

#4 - Using the Cloud for Storage

File Server Client RPC/NFS

File

Store

How would Jim do this today on premises?

slide-115
SLIDE 115

#4 - Using the Cloud for Storage

DB Server Client

RDBMS

TDS (Tabular Data Stream)

Data

How would Jim do this today on premises?

slide-116
SLIDE 116

#4 - Using the Cloud for Storage

Web Server Browser

Database

HTTP POST

Data

How would Jim do this today on premises?

slide-117
SLIDE 117

#4 - Using the Cloud for Storage

Server

Data

Affinity between your data and physical hardware that serves it

I love you! I love you too!

slide-118
SLIDE 118

#4 - Using the Cloud for Storage

Server

Data

I love you! I love you too!

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

slide-119
SLIDE 119

How does the cloud help?

slide-120
SLIDE 120

Breaks the affinity between your data and hardware

slide-121
SLIDE 121

Blobs, Tables, Relational

slide-122
SLIDE 122

Blobs, Tables, Relational

slide-123
SLIDE 123

#4 - Using the Cloud for Storage

Client

Azure Blob Storage

REST API

PutBlob PUT http://account.blob.core.windows./net/containername/blobname

Blob Container http://account.blob.core.windows.net/containername/blobname PutBlob = 64Mb MAX MetaData = 8Kb per Blob

slide-124
SLIDE 124

#4 - Using the Cloud for Storage

Client

Azure Blob Storage

REST API

GetBlob GET http://account.blob.core.windows./net/containername/blobname

Blob Container http://account.blob.core.windows.net/containername/blobname

slide-125
SLIDE 125

#4 - Using the Cloud for Storage

Client

Azure Blob Storage

REST API

GetBlob GET http://account.blob.core.windows./net/containername/blobname Range: bytes=329300 - 730000

Blob Container http://account.blob.core.windows.net/containername/blobname

slide-126
SLIDE 126

#4 - Using the Cloud for Storage

Client

Azure Blob Storage

REST API PutBlock(blobname, blockid, data) PutBlockList(blobname, blockid1 , …, blockidN) Blob Container http://account.blob.core.windows.net/containername/blobname PutBlock = 4Mb MAX to a maximum of 50Gb BlockId = 64 bytes

slide-127
SLIDE 127

Blobs, Tables, Relational

slide-128
SLIDE 128

#4 - Using the Cloud for Storage

Worker Role

Azure Table Storage

Each Table: PartitionKey (e.g. DocumentName) to ensure scalability RowKey (e.g. version number) [fields] for data http://account.table.core.windows.net

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;

slide-129
SLIDE 129

Blobs, Tables, Relational

slide-130
SLIDE 130

Codename Sitka (early 2008)

slide-131
SLIDE 131

SQL Server Data Services (MIX08)

slide-132
SLIDE 132

#4 - Using the Cloud for Storage

DB Server Client

RDBMS

TDS

Data

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

slide-133
SLIDE 133

#4 - Using the Cloud for Storage

DB Server Client

RDBMS

TDS

Data

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

slide-134
SLIDE 134

SQL Data Services (MIX09)

slide-135
SLIDE 135

SQL Azure (July 2009)

slide-136
SLIDE 136

#4 - Using the Cloud for Storage

SQL Azure Client

RDBMS

TDS

Data

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

slide-137
SLIDE 137

#4 - Using the Cloud for Storage

SQL Azure Browser

RDBMS

TDS Web Role HTTP

slide-138
SLIDE 138

#4 - Using the Cloud for Storage

SQL Azure Browser

RDBMS

TDS Web Role HTTP Worker Role Queue

slide-139
SLIDE 139

Migration!

slide-140
SLIDE 140

#4 - Using the Cloud for Storage

Browser

RDBMS

Web Tier HTTP

  • Bus. Logic

“The Data Center” SQL Server TDS

slide-141
SLIDE 141

#4 - Using the Cloud for Storage

SQL Azure Browser

RDBMS

TDS Web Role HTTP Worker Role Queue “The Cloud”

slide-142
SLIDE 142

Demo: SQL Azure CTP

slide-143
SLIDE 143

Patterns for Cloud Computing Takeaways Understand the pricing model for storage on-premises vs. cloud SQL Azure as a factor for migration/move from on premises Storage in the cloud may look the same, but breaks the affinity issue

slide-144
SLIDE 144

Patterns for Moving to the Cloud

#5 - Using the Cloud for Communications

slide-145
SLIDE 145

Jim’s organization needs to communicate with

  • ther organizations

Patterns for Cloud Computing

slide-146
SLIDE 146

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

slide-147
SLIDE 147

“Does the cloud offer anything to help?” Patterns for Cloud Computing

slide-148
SLIDE 148

How would Jim have done this before?

slide-149
SLIDE 149

#5 - Using the Cloud for Communications

Client Server Company 1 Company 2 Telco provided WAN FTP Client FTP Server

slide-150
SLIDE 150

#5 - Using the Cloud for Communications

Client Server Company 1 Company 2 Telco provided WAN FTP Client FTP Server Internet

slide-151
SLIDE 151

#5 - Using the Cloud for Communications

Client Server Company 1 Company 2 Telco provided WAN Browser Internet Extranet Site DMZ

slide-152
SLIDE 152

What does the cloud provide?

slide-153
SLIDE 153

#5 - Using the Cloud for Communications

Client REST

Azure Queue

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

slide-154
SLIDE 154

#5 - Using the Cloud for Communications

Client REST

Azure Queue

http://app.queue.core.windows.net/ Client Company 1 Company 2

slide-155
SLIDE 155

#5 - Using the Cloud for Communications

Client REST

Azure Queue

http://app.queue.core.windows.net/ Client Company 1 Company 2

slide-156
SLIDE 156

#5 - Using the Cloud for Communications

Client REST

Azure Queue

http://app.queue.core.windows.net/ Client Company 1 Company 2 Primary Access Key Primary Access Key

slide-157
SLIDE 157

#5 - Using the Cloud for Communications

Client REST

Azure Queue

http://app.queue.core.windows.net/ Client Company 1 Company 2 Web Role

slide-158
SLIDE 158

#5 - Using the Cloud for Communications

Client REST

Azure Queue

http://app.queue.core.windows.net/ Client Company 1 Company 2 Web Role Firewall Firewall

Proxy?

slide-159
SLIDE 159

#5 - Using the Cloud for Communications

Client REST

Azure Queue

http://app.queue.core.windows.net/ Client Company 1 Company 2 Web Role Firewall Firewall

NAT? 65.55.33.204 1 92.1 68.1 4.1 00

slide-160
SLIDE 160

#5 - Using the Cloud for Communications

Client REST

Azure Queue

http://app.queue.core.windows.net/ Client Company 1 Company 2 Web Role Firewall Firewall

65.55.33.204 1 92.1 68.1 4.1 00 OK, so I’ll do a HTTP poll every minute

slide-161
SLIDE 161

#5 - Using the Cloud for Communications

Client REST

Azure Queue

http://app.queue.core.windows.net/ Client Company 1 Company 2 Web Role Firewall Firewall

65.55.33.204 1 92.1 68.1 4.1 00 …and how about other protocols other than HTTP?

slide-162
SLIDE 162

How does the .NET Service Bus help?

slide-163
SLIDE 163

#5 - Using the Cloud for Communications

Client

.NET Service Bus

sb://.../myqueue Client Company 1 Company 2

slide-164
SLIDE 164

Two modes: TCP Relay and Message Buffer

slide-165
SLIDE 165

Two modes: TCP Relay and Message Buffer

slide-166
SLIDE 166

#5 - Using the Cloud for Communications

Client Outbound bi-directional socket Kept alive in background

.NET Service Bus

sb://.../myqueue Client Company 1 Company 2 Firewall

slide-167
SLIDE 167

#5 - Using the Cloud for Communications

Client Outbound bi-directional socket Kept alive in background

.NET Service Bus

sb://.../myqueue Client Company 1 Company 2 Firewall Firewall Outbound one-way socket Message routed accordingly

slide-168
SLIDE 168

#5 - Using the Cloud for Communications

My Laptop Outbound bi-directional socket Kept alive in background

.NET Service Bus

sb://.../myqueue Home PC This Conference My Home Firewall Firewall Outbound one-way socket Message routed accordingly

1 92.1 68.1 4.1 93

SQL Express

Port 1 433

Localhost:1 000

Application

slide-169
SLIDE 169

Two modes: TCP Relay and Message Buffer

slide-170
SLIDE 170

#5 - Using the Cloud for Communications

Client Consumer defines and creates a Message Buffer

.NET Service Bus

sb://.../myqueue Client Company 1 Company 2 Firewall ATOMPub via REST

slide-171
SLIDE 171

#5 - Using the Cloud for Communications

Client Producer sends messages to the Message Buffer

.NET Service Bus

sb://.../myqueue Client Company 1 Company 2 Firewall ATOMPub via REST Firewall

slide-172
SLIDE 172

#5 - Using the Cloud for Communications

Client Consumer picks up these messages (retrieve, peek, lock)

.NET Service Bus

sb://.../myqueue Client Company 1 Company 2 Firewall ATOMPub via REST Firewall

slide-173
SLIDE 173

Patterns for Cloud Computing Takeaways Firewalls/NATs can add additional trouble (especially non-HTTP) Learn how .NET Service Bus traverses in these scenarios Be careful consuming REST based queues using shared secret

slide-174
SLIDE 174

Patterns for Moving to the Cloud

Putting the Patterns Together

slide-175
SLIDE 175

We’ve covered 5 patterns, but Jim has one last question… Patterns for Cloud Computing

slide-176
SLIDE 176

Are there cases where these patterns work together? Patterns for Cloud Computing

slide-177
SLIDE 177

Putting the Patterns Together

PHP

Let’ s build an application in PHP that scales to many nodes…

Windows Azure

slide-178
SLIDE 178

Putting the Patterns Together

PHP Java Servlet Google AppEngine ASP .NET Amazon EC2 Windows Azure

Use the principles of multi tenancy to create a version of the application across multiple vendors

(1 0 nodes) (5 nodes using ELB)

slide-179
SLIDE 179

Putting the Patterns Together

PHP Java Servlet Google AppEngine ASP .NET Amazon EC2 Job Job Job Client Windows Azure

Compute results with a MapReduce-like way

  • f distributing work

across all of these applications

slide-180
SLIDE 180

Putting the Patterns Together

PHP SQL Azure Database Java Servlet Google AppEngine ASP .NET Amazon EC2 Job Job Job Client Windows Azure

Store the results in a SQL Azure database

slide-181
SLIDE 181

Putting the Patterns Together

PHP SQL Azure Database .NET Service Bus Java Servlet Google AppEngine ASP .NET Amazon EC2 Job Job Job Client Windows Azure

Coordinate communication through the .NET Service Bus

slide-182
SLIDE 182

Putting the Patterns Together

PHP SQL Azure Database .NET Service Bus Java Servlet Google AppEngine ASP .NET Amazon EC2 Job Job Job Client Windows Azure

slide-183
SLIDE 183

Putting the Patterns Together

PHP SQL Azure Database .NET Service Bus Java Servlet Google AppEngine ASP .NET Amazon EC2 Job Job Job Client Windows Azure 40 jobs of 250,000 numbers Compute Compute Compute Store results in SQL Azure

How many prime numbers between 1 and 1 0,000,000?

slide-184
SLIDE 184

Demo: Prime Solver v2.0

slide-185
SLIDE 185

Next Steps

slide-186
SLIDE 186

Obviously, our friend Jim, is fake… Next Steps

slide-187
SLIDE 187

Next Steps Make sure you have a clear definition

  • f Cloud Computing

Explore the 5 usage patterns for your scenarios today Think about the next steps for implementation and migration

slide-188
SLIDE 188

simon.guest@microsoft.com http://simonguest.com