patterns for cloud computing david gristwood application architect microsoft @scroffthebad

122
Patterns For Cloud Computing David Gristwood Application Architect Microsoft http://blogs.msdn.com/david_gristwood/ @ScroffTheBad

Post on 21-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns For Cloud Computing

David GristwoodApplication ArchitectMicrosoft

http://blogs.msdn.com/david_gristwood/@ScroffTheBad

Page 2: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Session Objectives

Page 3: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Session Objectives

Provide you with 5 patterns for cloud-based applications

Show implementations ofthese patterns

Page 4: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Page 5: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web TierBrowserRequest

B/L Tier Database

Response

“Wow! What a great site!”

Page 6: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web Tier B/L Tier Database

Browser

Browser

Browser

Browser

Browser

“Server Busy”

Page 7: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web Tier B/L Tier Database

Browser

“Timeout”

Browser

Browser

Browser

Browser

Page 8: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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 you do this today on premises?

Page 9: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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 you do this today on premises?

Page 10: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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 you do this today on premises?

Page 11: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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 you do this today on premises?

Page 12: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Not without consequences...

Page 13: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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 time, effort and money!”

How would you do this today on premises?

Page 14: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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...”

How would you do this today on premises?

“That took a lot of time, effort and money!”

Page 15: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Usage

Jan Apr Jul Oct

Datacenter peak load

Idle time

Page 16: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

How can cloud computing help?

Page 17: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web RoleBrowserRequest

Worker Role

Azure Storag

eResponse

“Wow! What a great site!”

Page 18: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web RoleWorker

Role

AzureStorag

e

Browser

“Server Busy”

Browser

Browser

Browser

Browser

Page 19: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad
Page 20: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web Role

Worker Role

AzureStorag

e

Browser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

You don’t see this bit

Page 21: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web Role

AzureStorag

e

Browser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

Worker Role

Worker Role

Worker Role

N L B

Page 22: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

OK, so changing config is easy...

…but what else do I need to know?

Page 23: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web Role

Browser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

N L B

AzureStorag

e

Worker Role

Worker Role

Worker Role

Page 24: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web Role

Browser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

N L B

AzureStorag

e

Worker Role

Worker Role

Worker Role

Tight coupling between web and worker role is an anti-

pattern

Page 25: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web RoleWorker

Role

Queue

Req

1. Place on queue 3. Pickup from queue

4. Process

2. Respond to UI

Page 26: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web RoleWorker

Role

Queue

Req

4. Process

Table

5. Add result to table

6. Query table on refresh

Page 27: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Demo #1: Prime Solver

Page 28: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

How many web and worker roles do you need?

Page 29: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

How many web and worker roles do you need?

Page 30: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web Role

Worker Role

AzureStorag

e

Browser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

Worker Role

Log

WMI_Win32_PerfFormattedData_ASPNET_ASPNETApplications/RequestsPerSecond

Management APIor Email

Page 31: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

How many web and worker roles do you need?

Page 32: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web Role

Queue

Req

Web Role

Web Role

Req

Req

Monitor queuelength against

user’s expectations

Web Role

Web Role

Web Role

Worker Role

Page 33: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#1 - Using the Cloud for Scale

Web Role

Queue

Req

Web Role

Web Role

Req

Req

Monitor queuelength against

user’s expectations

Web Role

Web Role

Web Role

Worker Role

Worker Role

Worker Role

Worker Role

Worker Role

Worker Role

Page 34: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Cloud Computing

Takeaways

Understand how to communicate between roles and nodesStrategy on when to scale up/down roles in production

A core tenet of cloud computing is the ability to scale up & down

Page 35: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Moving to the Cloud

#2 - Using the Cloud for Multi-Tenancy

Page 36: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser B/L Tier Database

Customer #2

Web TierBrowser B/L Tier Database

Customer #1

Web TierBrowser B/L Tier Database

Customer #3

How would you do this today on premises?

Page 37: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Gets expensive pretty quickly

Page 38: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser B/L Tier Database

Browser

Browser

Customer #1

Customer #2

Customer #3

What you really want is this:

Page 39: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Schema Customizations

UI Customizations

Page 40: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Schema Customizations

UI Customizations

Page 41: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

3 options for data in multi tenant environment

Page 42: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser 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.

Page 43: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser 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.

Page 44: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser B/L Tier Database

Browser

Browser

Customer #1

Customer #2

Customer #3

Option 3: Fixed Database/Schema, with customizations

Fixed Schemawith

Customizations

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

Page 45: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

TenantID

Tenant

int

TenantNamenvarchar

EmployeeId

Employee

int

FirstName nvarchar

LastName nvarchar

CustomizationID

Customization

int

Value nvarchar

TypeID

Type

int

Name nvarchar

CLRType nvarchar

1

*

*

1

*

1

*

*

Page 46: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

TenantID

Tenant

int

TenantNamenvarchar

EmployeeId

Employee

int

FirstName nvarchar

LastName nvarchar

CustomizationID

Customization

int

Value nvarchar

TypeID

Type

int

Name nvarchar

CLRType nvarchar

1

*

*

1

*

1

*

*

Fixed SchemaApplies to All

Tenants

CustomizableTenant by

Tenant Basis

Page 47: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

TenantID

Tenant

1

TenantNameUK Branch

EmployeeId

Employee

1

FirstName Gordon

LastName Brown

CustomizationID

Customization

1

Value SW1A 2AA

TypeID

Type

1

Name PostalCode

CLRType string

1

*

*

1

*

1

*

*

Page 48: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

TenantID

Tenant

2

TenantNameUS Branch

EmployeeId

Employee

2

FirstName Barack

LastName Obama

CustomizationID

Customization

2

Value 20500

TypeID

Type

2

Name ZipCode

CLRType string

1

*

*

1

*

1

*

*

Page 49: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Schema Customizations

UI Customizations

Page 50: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser B/L Tier Database

Browser

Browser

Customer #1

Customer #2

Customer #3

Page 51: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

URL Handing using MVC routing

Page 52: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser 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

Page 53: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser 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

Page 54: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser 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

Page 55: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Demo #2: Multi Tenant Schema and UI

Page 56: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Cloud Computing

Takeaways

Design considerations must include both data and UI

Many other considerations, such as identity

Always consider Multi Tenancy first, even if only one customer

Page 57: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Moving to the Cloud

#3 - Using the Cloud for

Compute

Page 58: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#3 - Using the Cloud for Compute

MasterClient

Data

Worker

Worker

Worker

Data

Data

Data

Page 59: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#3 - Using the Cloud for Compute

MasterClient

Result

Worker

Worker

Worker

Result

Result

Result

Page 60: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Popularized by the term “MapReduce”*

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

Page 61: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#3 - Using the Cloud for Compute

MasterClient

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”?

Page 62: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#3 - Using the Cloud for Compute

MasterClient

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

Page 63: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

And it’s definitely popular...

Page 64: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#3 - Using the Cloud for Compute

Google20pb of data analyzed every day using

MapReduce

Yahoo!10k+ cores, 4pb of data using MapReduce

Facebook2500+ cores, 1pb of data using MapReduce

Page 65: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

And there are several frameworks…

Page 66: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#3 - Using the Cloud for Compute

C++, C#, Erlang, Java, Python, Ruby, F#, R, …

Apache HadoopOpen Source Java “Inspired by MapReduce”

(Core, HDFS, many more)

Amazon Elastic MapReduceHadoop implementation on EC2

Page 67: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#3 - Using the Cloud for Compute

MasterClient

Data

Worker

Worker

Worker

Data

Data

DataClient ApplicationJob/Task Scheduler

Remote Service

Sockets

How would you do this today on premises?

Page 68: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

How about implementing this on Windows Azure?

Page 69: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#3 - Using the Cloud for Compute

Web RoleClient

Data

Worker

Worker

Worker

Data

Data

Data

Client ApplicationJob/Task Scheduler

Remote Service

Queue

Req

Table

Page 70: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Demo #3: Windows Azure Demo “Inspired by MapReduce”

Page 71: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Cloud Computing

Takeaways

Learn about existing frameworks, especially Apache HadoopRead up on Dryad (DryadLINQ) for future direction

MapReduce very visible, although can be difficult to initially grasp

Page 72: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Moving to the Cloud

#4 - Using the Cloud for

Storage

Page 73: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#4 - Using the Cloud for Storage

File ServerClientRPC/NFSFile

Store

How would you do this today on premises?

Page 74: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#4 - Using the Cloud for Storage

DB ServerClient RDBMS

TDS (Tabular Data Stream)Data

How would you do this today on premises?

Page 75: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#4 - Using the Cloud for Storage

Web Server

Browser Database

HTTP POSTData

How would you do this today on premises?

Page 76: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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!

Page 77: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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 dataDamn! I’m at 95% capacity - got to move to a

bigger disk

Page 78: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

How does the cloud help?

Page 79: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Breaks the affinity between your data and hardware

Page 80: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Blobs, Tables, Relational

Page 81: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Blobs, Tables, Relational

Page 82: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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

Page 83: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#4 - Using the Cloud for Storage

Client Azure Blob Storage

REST API

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

Blob Container

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

Page 84: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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

Page 85: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Blobs, Tables, Relational

Page 86: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#4 - Using the Cloud for Storage

Worker Role

AzureTable

Storage

Each Table:

PartitionKey (e.g. DocumentName) to ensure scalabilityRowKey (e.g. version number) as application key[fields] for data as name / value pairs

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;

Page 87: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Blobs, Tables, Relational

Page 88: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#4 - Using the Cloud for Storage

SQL AzureClient RDBMS

TDSData

For easy migration, this is what I would like to do...

Page 89: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#4 - Using the Cloud for Storage

SQL AzureBrowser RDBMS

TDS

Web RoleHTTP

Worker Role

Queue

Page 90: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Migration:

Page 91: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#4 - Using the Cloud for Storage

Browser RDBMS

Web TierHTTP

Bus. Logic

“The Data Center”

SQL Server

TDS

Page 92: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#4 - Using the Cloud for Storage

SQL AzureBrowser RDBMS

TDS

Web RoleHTTP

Worker Role

Queue

“The Cloud”

Page 93: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Demo #4: SQL Azure

Page 94: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Cloud Computing

Takeaways

Understand the pricing model for storage on-premises vs. cloudSQL Azure as a factor for migration/move from on premises

Storage in the cloud may look the same, but breaks the affinity issue

Page 95: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Moving to the Cloud

#5 - Using the Cloud for

Communications

Page 96: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#5 - Using the Cloud for Communications

Client Server

Company 1 Company 2Telco provided WAN

FTPClient

FTPServer

Page 97: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#5 - Using the Cloud for Communications

Client Server

Company 1 Company 2Telco provided WAN

FTPClient

FTPServer

Internet

Page 98: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#5 - Using the Cloud for Communications

Client Server

Company 1 Company 2Telco provided WAN

Browser

Internet

ExtranetSite

DMZ

Page 99: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

What does the cloud provide?

Page 100: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#5 - Using the Cloud for Communications

Client

REST

Azure Queue

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

Client

Company 1

Company 2

Page 101: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#5 - Using the Cloud for Communications

Client

REST

Azure Queue

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

Client

Company 1

Company 2 xSecurity?Shared keys?

Page 102: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#5 - Using the Cloud for Communications

Client

REST

Azure Queue

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

Client

Company 1

Company 2

Web Role

Page 103: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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?

Page 104: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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

192.168.14.100

Page 105: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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

192.168.14.100OK, so I’ll do a

HTTP poll every minute

Page 106: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#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

192.168.14.100…and how about other

protocols other than HTTP?

Page 107: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

How does the Azure AppFabric Service Bus help?

Page 108: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#5 - Using the Cloud for Communications

Client

AppFabricService Bus

sb://.../myqueue

Client

Company 1

Company 2

Page 109: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#5 - Using the Cloud for Communications

Client

Outbound bi-directional socketKept alive in background

AppFabric Service Bus

sb://.../myqueue

Client

Company 1

Company 2

Firewall

Page 110: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

#5 - Using the Cloud for Communications

Client

Outbound bi-directional socketKept alive in background

AppFabricService Bus

sb://.../myqueue

Client

Company 1

Company 2

Firewall

FirewallOutbound one-way socket

Message routedaccordingly

Page 111: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Cloud Computing

Takeaways

Firewalls/NATs can add additional trouble (especially non-HTTP)Learn how AppFabric Service Bus traverses in these scenarios

Be careful consuming REST based queues using shared secret

Page 112: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Patterns for Moving to the Cloud

Putting the patterns together…

Page 113: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Putting the Patterns Together

PHP

Let’s build an application in

PHP that scales to many nodes…

Windows Azure

Page 114: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Putting the Patterns Together

PHP

Java Servlet

Google AppEngine

ASP.NET

Amazon EC2

Windows AzureUse the principles of multi tenancy to

create a version of the application across multiple

vendors

(10 nodes)

(5 nodes using ELB)

Page 115: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

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 of

distributing work across all of

these applications

Page 116: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Putting the Patterns Together

PHP

SQL Azure

Database

Java Servlet

Google AppEngine

ASP.NET

Amazon EC2

Job

Job

Job

Client

Windows AzureStore the

results in a SQL Azure database

Page 117: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

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 AppFabric

Service Bus

Page 118: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Putting the Patterns Together

PHP

SQL Azure

Database

AppFabric Service Bus

Java Servlet

Google AppEngine

ASP.NET

Amazon EC2

Job

Job

Job

Client

Windows Azure

40 jobs of250,000numbers

Compute

Compute

Compute

Store resultsin SQL AzureHow many

prime numbers

between 1 & 10,000,000?

Page 119: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Demo #5: Prime Solver v2.0

Page 120: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Next Steps

Page 121: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Head up to www.Azure.com . . . . .

Next Steps

Page 122: Patterns For Cloud Computing David Gristwood Application Architect Microsoft  @ScroffTheBad

Next Steps

© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED

OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.