173
Patterns for Cloud Computing Solution Architect Briefing zoli.herczeg.ro Taken from Simon Guests’ work at TechEd Berlin 2009

Patterns for Cloud Computing

  • Upload
    darby

  • View
    42

  • Download
    2

Embed Size (px)

DESCRIPTION

Patterns for Cloud Computing. Solution Architect Briefing zoli.herczeg.ro Taken from Simon Guests’ work at TechEd Berlin 2009. This is Jim. Patterns for Cloud Computing. Jim’s Boss (the CIO) has asked him to “move their company to the cloud!”. Patterns for Cloud Computing. - PowerPoint PPT Presentation

Citation preview

Page 1: Patterns for Cloud Computing

Patterns for Cloud Computing

Solution Architect Briefingzoli.herczeg.ro

Taken from Simon Guests’ work at TechEd Berlin 2009

Page 2: Patterns for Cloud Computing

This is Jim

Patterns for Cloud Computing

Page 3: Patterns for Cloud Computing

Jim’s Boss (the CIO) has asked him to “move their company to the cloud!”

Patterns for Cloud Computing

Page 4: Patterns for Cloud Computing

He’s seen many great things on cloud computing/Windows Azure

Patterns for Cloud Computing

Page 5: Patterns for Cloud Computing

…but he’s still a little confused

Patterns for Cloud Computing

Page 6: Patterns for Cloud Computing

He still doesn’t quite understand what types of applications make sense in the

cloud

Patterns for Cloud Computing

Page 7: Patterns for Cloud Computing

He also wonders how other organizations are using the cloud

Patterns for Cloud Computing

Page 8: Patterns for Cloud Computing

What patterns have other people learned – and can Jim re-use for his applications?

Patterns for Cloud Computing

Page 9: Patterns for Cloud Computing

Session Objectives

Page 10: Patterns for Cloud Computing

Session Objectives

Validate what you may have heard and seen so far

Provide you with 5 patterns for cloud-based applications

Show you how to implement these patterns using Windows

Azure

Page 11: Patterns for Cloud Computing

Where does my application live?

Application runs on-premises

Application runs at a hoster

Application runs using cloud

platform

Build

vs.

Buy

Build

Buy

“Packaged”Application

An application that I buy “off the shelf” and

run myself

“Home Built”Application

An application that I develop and run myself

Hosted “Home Built”

An application that I develop

myself, but run at a hoster

Hosted “Packaged”

An application that I buy “off the shelf” and then run at a

hosterCloud

Platform

An application that I develop

myself, that I run in the cloud

“Software as a Service”

A hosted application that I

buy from a vendor

Page 12: Patterns for Cloud Computing

Platform Services

Software Services

Application Services

Infrastructure Services

Microsoft Cloud ServicesCategories of Services

Page 13: Patterns for Cloud Computing

Pricing

Compute• $0.12 / CPU hour

Storage• $0.15 / GB / month• $0.01 / 10k txn /

month Bandwidth

• $0.10 in / GB• $0.15 out / GB

Web Edition (1GB)• $9.99 / month

Business Edition (10GB)• $99.99 / month

Bandwidth• $0.10 in / GB• $0.15 out / GB

Service Bus• $0.15 / 100k

messages Access Control

• $0.15 / 100k tokens Bandwidth

• $0.10 in / GB• $0.15 out / GB

SUBSCRIPTIONCONSUMPTION VOLUME LICENSING“Pay as you go and

grow”Available at launch

• Low barrier to entry and flexibility• Optimized for cloud elasticity

• Discounts for commitment• Plans for payment

predictability

“Coordinated purchasing”

Planned for FY11• Unified purchasing through EA• Introduction to volume

discounts

“Value for a commitment“

Select offers Announced

Page 14: Patterns for Cloud Computing

Offers & PromotionsDevelopment Accelerator Designed to accelerate cloud app development. Flexible (on/off) consumption for scaling. Predictable payment and discounted price.

•6 month subscription (38%-45% discount) •Offered as a unit (can order multiple units)•Cancel first 30 days; anytime after first 6 months•Overage at Standard Consumption rates

CORE ($59.95/month)Amount Included in BaseCompute 750 hrs/mo Storage 10 GB/mo Storage Transactions 1M/mo NET - Messages 1M/moData Transfers 7 GB In / 14 GB Out

EXTENDED ($109.95/month)Amount Included in BaseSame as Core except also includes 1 SQL Azure Business Edition DB (10 GB)

Introductory Free Offer No-cost developer starter offer. Provides no-cost allocation to run a cloud service.

•Available to all partner/customers•Limit of one per customer•Overage at Standard Consumption rates

NO-COSTWindows AzureCompute 25 Hrs/monthStorage 0.5 GB/monthBandwidth 0.5 GB/monthStorage Transactions 10K/month

SQL Azure1 Web Edition DB (1GB DB) 90 day trial

Service Bus and Access Control Service Messages 100K/mo

MSDN Premium Mobilize committed .NET developer base. Enable them to build, deploy, manage multiple cloud projects w/in MSDN subscription.

• Available to MSDN Premium subscribers with limit of one per subscription (one per Windows Live ID)• 12-month term• Overage at partner Consumption rates• Limited time to sign up (thru 6/30/10)• After 6/30/10 quantities may be reduced

NO-COSTWindows AzureCompute 750 hrs Storage 10 GBStorage Transaction 1M

SQL Azure - 3 Web DB (1 GB)

Service Bus and Access Control Service Messages 1 Million

Data Transfer 7GB In/14GB Out

Page 15: Patterns for Cloud Computing

Private(On-Premise)

Infrastructure

(as a Service)

Platform(as a

Service)

Types of Clouds

Storage

Server HW

Networking

Servers

Databases

Virtualization

Runtimes

Applications

Security & Integration

Storage

Server HW

Networking

Servers

Databases

Virtualization

Runtimes

Applications

Security & Integration

Storage

Server HW

Networking

Servers

Databases

Virtualization

Runtimes

Applications

Security & Integration

You

man

age M

anaged by vendor

Managed by vendor

You

man

age

You

man

age

Page 16: Patterns for Cloud Computing

Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Page 17: Patterns for Cloud Computing

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

Patterns for Cloud Computing

Page 18: Patterns for Cloud Computing

For example, tax applications

Patterns for Cloud Computing

Page 19: Patterns for Cloud Computing

“How does this work?”

Patterns for Cloud Computing

Page 20: Patterns for Cloud Computing

Let’s do some white boarding for Jim…

Patterns for Cloud Computing

Page 21: Patterns for Cloud Computing

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

Page 22: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web TierBrowserRequest

B/L Tier DatabaseResponse

“Wow! What a great site!”

Page 23: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web Tier B/L Tier Database

Browser

Browser

Browser

Browser

Browser

“Server Busy”

Page 24: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web Tier B/L Tier Database

Browser

“Timeout”

Browser

Browser

Browser

Browser

Page 25: Patterns for Cloud Computing

How would Jim do this today on premises?

Page 26: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web Tier B/L Tier Databa

seBrowser

Browser

Browser

Browser

Browser

Web Tier

Web Tier

N L B

How would Jim do this today on premises?

Page 27: Patterns for Cloud Computing

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

Page 28: Patterns for Cloud Computing

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

Page 29: Patterns for Cloud Computing

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

Page 30: Patterns for Cloud Computing

Not without consequences...

Page 31: Patterns for Cloud Computing

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

Page 32: Patterns for Cloud Computing

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

Page 33: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Usage

Jan Apr Jul Oct

Datacenter peak load

Idle time

Page 34: Patterns for Cloud Computing

How can Windows Azure help?

Page 35: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web RoleBrowserRequest Worker

RoleAzure Storag

eResponse

“Wow! What a great site!”

Page 36: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web Role Worker Role

AzureStorag

eBrowser

“Server Busy”

Browser

Browser

Browser

Browser

Page 37: Patterns for Cloud Computing
Page 38: Patterns for Cloud Computing
Page 39: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web Role

Worker Role

AzureStorag

eBrowser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

You don’t see this bit

Page 40: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web Role

AzureStorag

eBrowser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

Worker Role

Worker Role

Worker Role

N L B

Page 41: Patterns for Cloud Computing

OK, so changing config is easy...

…but what else do I need to know?

Page 42: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web RoleBrowser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

N L B

AzureStorag

eWorker

Role

Worker Role

Worker Role

Page 43: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web RoleBrowser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

N L B

AzureStorag

eWorker

Role

Worker Role

Worker Role

Tight coupling between web and worker role is an anti-

pattern

Page 44: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web Role Worker Role

Queue

Req1. Place on queue 3. Pickup from queue

4. Process

2. Respond to UI

Page 45: Patterns for Cloud Computing

#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

Page 46: Patterns for Cloud Computing

How many web and worker roles do you need?

Page 47: Patterns for Cloud Computing

How many web and worker roles do you need?

Page 48: Patterns for Cloud Computing

#1 - Using the Cloud for Scale

Web Role

Worker Role

AzureStorag

eBrowser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

Worker RoleLog

WMI_Win32_PerfFormattedData_ASPNET_ASPNETApplications/RequestsPerSecond

Management APIor Email

Page 49: Patterns for Cloud Computing

How many web and worker roles do you need?

Page 50: Patterns for Cloud Computing

#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 51: Patterns for Cloud Computing

#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 52: Patterns for Cloud Computing

Patterns for Cloud ComputingTakeaways

Understand how to communicate between Web and Worker roleStrategy on when to scale up/down roles in production

Using configuration, Azure makes it easy to scale roles

Page 53: Patterns for Cloud Computing

Patterns for Moving to the Cloud

#2 - Using the Cloud for Multi Tenancy

Page 54: Patterns for Cloud Computing

“I like the idea of scaling Web roles…”

Patterns for Cloud Computing

Page 55: Patterns for Cloud Computing

“…but need to serve multiple customers”

Patterns for Cloud Computing

Page 56: Patterns for Cloud Computing

“Without creating separate codebases!”

Patterns for Cloud Computing

Page 57: Patterns for Cloud Computing

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser B/L Tier Database

Customer #1

Page 58: Patterns for Cloud Computing

How would Jim do this today on premises?

Page 59: Patterns for Cloud Computing

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

Page 60: Patterns for Cloud Computing

Gets expensive pretty quickly

Page 61: Patterns for Cloud Computing

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser B/L Tier Database

Browser

Browser

Customer #1

Customer #2

Customer #3

Page 62: Patterns for Cloud Computing

Schema Customizations

UI Customizations

Page 63: Patterns for Cloud Computing

Schema Customizations

UI Customizations

Page 64: Patterns for Cloud Computing

3 options for data in multi tenant environment

Page 65: Patterns for Cloud Computing

#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 66: Patterns for Cloud Computing

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser B/L Tier

DatabaseBrowser

Browser

Customer #1

Customer #2

Customer #3 Option 2: Give Each Customer Their Own

Database/Schema

Customer #1Database

Database

Customer #2

Customer #3

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

Page 67: Patterns for Cloud Computing

#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 68: Patterns for Cloud Computing

#2 - Using the Cloud for Multi Tenancy

TenantIDTenant

int

TenantNamenvarchar

EmployeeIdEmployee

int

FirstName nvarchar

LastName nvarchar

CustomizationID

Customizationint

Value nvarchar

TypeIDType

int

Name nvarchar

CLRType nvarchar

1

*

*1

*1

*

*

Page 69: Patterns for Cloud Computing

#2 - Using the Cloud for Multi Tenancy

TenantIDTenant

1

TenantNameUK Branch

EmployeeIdEmployee

1

FirstName Gordon

LastName Brown

CustomizationID

Customization1

Value SW1A 2AA

TypeIDType

1

Name PostalCode

CLRType string

1

*

*1

*1

*

*

Page 70: Patterns for Cloud Computing

#2 - Using the Cloud for Multi Tenancy

TenantIDTenant

2

TenantNameUS Branch

EmployeeIdEmployee

2

FirstName Barack

LastName Obama

CustomizationID

Customization2

Value 20500

TypeIDType

2

Name ZipCode

CLRType string

1

*

*1

*1

*

*

Page 71: Patterns for Cloud Computing

#2 - Using the Cloud for Multi Tenancy

TenantIDTenant

2

TenantNameUS Branch

EmployeeIdEmployee

2

FirstName Barack

LastName Obama

CustomizationID

Customization2

Value 20500

TypeIDType

2

Name ZipCode

CLRType string

1

*

*1

*1

*

*

Fixed SchemaApplies to All

Tenants

CustomizableTenant by

Tenant Basis

Could be both

Page 72: Patterns for Cloud Computing

Schema Customizations

UI Customizations

Page 73: Patterns for Cloud Computing

#2 - Using the Cloud for Multi Tenancy

Web TierBrowser B/L Tier Database

Browser

Browser

Customer #1

Customer #2

Customer #3

Page 74: Patterns for Cloud Computing

URL Handling

Page 75: Patterns for Cloud Computing

Can ASP.NET MVC Help?

Page 76: Patterns for Cloud Computing

#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 77: Patterns for Cloud Computing

#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 78: Patterns for Cloud Computing

#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 routing in ASP.NET MVC

http://employeedata.cloudapp.net

Page 79: Patterns for Cloud Computing

Patterns for Cloud ComputingTakeaways

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

Page 80: Patterns for Cloud Computing

Patterns for Moving to the Cloud

#3 - Using the Cloud for Compute

Page 81: Patterns for Cloud Computing

Jim has seen how Azure enables multiple nodes

Patterns for Cloud Computing

Page 82: Patterns for Cloud Computing

“Can I use all of these nodes in parallel?”

Patterns for Cloud Computing

Page 83: Patterns for Cloud Computing

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

Patterns for Cloud Computing

Page 84: Patterns for Cloud Computing

#3 - Using the Cloud for Compute

MasterClient

Data

Worker

Worker

Worker

Data

Data

Data

Page 85: Patterns for Cloud Computing

#3 - Using the Cloud for Compute

MasterClientResul

t

Worker

Worker

Worker

Result

Result

Result

Page 86: Patterns for Cloud Computing

Popularized by the term “MapReduce”*

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

Page 87: Patterns for Cloud Computing

#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 88: Patterns for Cloud Computing

#3 - Using the Cloud for Compute

MasterClientResul

t

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 89: Patterns for Cloud Computing

And it’s definitely popular...

Page 90: Patterns for Cloud Computing

#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 91: Patterns for Cloud Computing

Frameworks

Page 92: Patterns for Cloud Computing

#3 - Using the Cloud for Compute

Apache HadoopOpen Source Java “Inspired by MapReduce”

(Core, HDFS, many more)

ClouderaConsulting, training, distribution of Hadoop

Amazon Elastic MapReduceHadoop implementation on EC2

Page 93: Patterns for Cloud Computing

How would Jim do this today on premises?

Page 94: Patterns for Cloud Computing

#3 - Using the Cloud for Compute

MasterClient

Data

Worker

Worker

Worker

Data

Data

DataClient ApplicationJob/Task Scheduler

Remote Service

Sockets

How would Jim do this today on premises?

Page 95: Patterns for Cloud Computing

How about implementing this on Windows Azure?

Page 96: Patterns for Cloud Computing

#3 - Using the Cloud for Compute

Web RoleClient

Data

Worker

Worker

Worker

Data

Data

DataClient ApplicationJob/Task Scheduler

Remote Service

Queue

Req

Table

Page 97: Patterns for Cloud Computing

Patterns for Cloud ComputingTakeaways

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 98: Patterns for Cloud Computing

Patterns for Moving to the Cloud

#4 - Using the Cloud for Storage

Page 99: Patterns for Cloud Computing

“The cloud lets me store infinite data, right?”

Patterns for Cloud Computing

Page 100: Patterns for Cloud Computing

Lots of headaches with data management today

Patterns for Cloud Computing

Page 101: Patterns for Cloud Computing

“It sounds too good to be true…”

Patterns for Cloud Computing

Page 102: Patterns for Cloud Computing

How does Jim do this today on premises?

Page 103: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

File ServerClientRPC/NFSFile

Store

How would Jim do this today on premises?

Page 104: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

DB ServerClient RDBMS

TDS (Tabular Data Stream)Data

How would Jim do this today on premises?

Page 105: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

Web ServerBrowser Datab

ase

HTTP POSTData

How would Jim do this today on premises?

Page 106: Patterns for Cloud Computing

#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 107: Patterns for Cloud Computing

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

disk

Page 108: Patterns for Cloud Computing

How does the cloud help?

Page 109: Patterns for Cloud Computing

Breaks the affinity between your data and hardware

Page 110: Patterns for Cloud Computing

Blobs, Tables, Relational

Page 111: Patterns for Cloud Computing

Blobs, Tables, Relational

Page 112: Patterns for Cloud Computing

#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 MAXMetaData = 8Kb per Blob

Page 113: Patterns for Cloud Computing

#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

Page 114: Patterns for Cloud Computing

#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 115: Patterns for Cloud Computing

#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 50GbBlockId = 64 bytes

Page 116: Patterns for Cloud Computing

Blobs, Tables, Relational

Page 117: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

Worker Role

AzureTable

Storage

Each Table:

PartitionKey (e.g. DocumentName) to ensure scalabilityRowKey (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;

Page 118: Patterns for Cloud Computing

Blobs, Tables, Relational

Page 119: Patterns for Cloud Computing

Codename Sitka (early 2008)

Page 120: Patterns for Cloud Computing

SQL Server Data Services (MIX08)

Page 121: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

DB ServerClient RDBMS

TDSData

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

Page 122: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

DB ServerClient RDBMS

TDSData

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

Page 123: Patterns for Cloud Computing

SQL Data Services (MIX09)

Page 124: Patterns for Cloud Computing

SQL Azure (July 2009)

Page 125: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

SQL AzureClient RDBMS

TDSData

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

Page 126: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

SQL AzureBrowser RDBMS

TDSWeb Role

HTTP

Page 127: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

SQL AzureBrowser RDBMS

TDSWeb Role

HTTP Worker Role

Queue

Page 128: Patterns for Cloud Computing

Migration!

Page 129: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

Browser RDBMSWeb Tier

HTTPBus. Logic

“The Data Center”

SQL Server

TDS

Page 130: Patterns for Cloud Computing

#4 - Using the Cloud for Storage

SQL AzureBrowser RDBMS

TDSWeb Role

HTTP Worker Role

Queue

“The Cloud”

Page 131: Patterns for Cloud Computing

Patterns for Cloud ComputingTakeaways

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 132: Patterns for Cloud Computing

Patterns for Moving to the Cloud

#5 - Using the Cloud for Communications

Page 133: Patterns for Cloud Computing

Jim’s organization needs to communicate with other organizations

Patterns for Cloud Computing

Page 134: Patterns for Cloud Computing

“This has always been a very tricky and expensive process to get working”

Patterns for Cloud Computing

Page 135: Patterns for Cloud Computing

“Does the cloud offer anything to help?”

Patterns for Cloud Computing

Page 136: Patterns for Cloud Computing

How would Jim have done this before?

Page 137: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client Server

Company 1 Company 2Telco provided WAN

FTPClient

FTPServer

Page 138: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client Server

Company 1 Company 2Telco provided WAN

FTPClient

FTPServer

Internet

Page 139: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client Server

Company 1 Company 2Telco provided WAN

Browser

Internet

ExtranetSite

DMZ

Page 140: Patterns for Cloud Computing

What does the cloud provide?

Page 141: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

ClientREST

Azure Queue

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

Page 142: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

RESTAzure Queue

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

Client

Company 1

Company 2

Page 143: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

RESTAzure Queue

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

Client

Company 1

Company 2 x

Page 144: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

RESTAzure Queue

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

Client

Company 1

Company 2

Primary Access Key

Primary Access Key

Page 145: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

RESTAzure Queue

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

Client

Company 1

Company 2Web Role

Page 146: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

RESTAzure Queue

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

Client

Company 1

Company 2Web Role

Firewall

Firewall

Proxy?

Page 147: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

RESTAzure Queue

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

Client

Company 1

Company 2Web Role

Firewall

Firewall

NAT?

65.55.33.204

192.168.14.100

Page 148: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

RESTAzure Queue

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

Client

Company 1

Company 2Web Role

Firewall

Firewall

65.55.33.204

192.168.14.100OK, so I’ll do a

HTTP poll every minute

Page 149: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

RESTAzure Queue

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

Client

Company 1

Company 2Web Role

Firewall

Firewall

65.55.33.204

192.168.14.100…and how about other

protocols other than HTTP?

Page 150: Patterns for Cloud Computing

How does the Service Bus help?

Page 151: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

Service Bus

sb://.../myqueue

Client

Company 1

Company 2

Page 152: Patterns for Cloud Computing

Two modes: TCP Relay and Message Buffer

Page 153: Patterns for Cloud Computing

Two modes: TCP Relay and Message Buffer

Page 154: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

Outbound bi-directional socketKept alive in background

Service Bus

sb://.../myqueue

Client

Company 1

Company 2

Firewall

Page 155: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

Outbound bi-directional socketKept alive in background

Service Bus

sb://.../myqueue

Client

Company 1

Company 2

Firewall

FirewallOutbound one-way socket

Message routedaccordingly

Page 156: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

My Laptop

Outbound bi-directional socketKept alive in background

Service Bus

sb://.../myqueue

Home PC

This Conference

My Home

Firewall

FirewallOutbound one-way socket

Message routedaccordingly

192.168.14.193

SQL Express

Port 1433

Localhost:1000

Application

Page 157: Patterns for Cloud Computing

Two modes: TCP Relay and Message Buffer

Page 158: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

Consumer defines and createsa Message Buffer

Service Bus

sb://.../myqueue

Client

Company 1

Company 2

Firewall

ATOMPub via REST

Page 159: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

Producer sends messages tothe Message Buffer

Service Bus

sb://.../myqueue

Client

Company 1

Company 2

Firewall

ATOMPub via REST

Firewall

Page 160: Patterns for Cloud Computing

#5 - Using the Cloud for Communications

Client

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

Service Bus

sb://.../myqueue

Client

Company 1

Company 2

Firewall

ATOMPub via REST

Firewall

Page 161: Patterns for Cloud Computing

Patterns for Cloud ComputingTakeaways

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

Be careful consuming Azure queues directly via REST

Page 162: Patterns for Cloud Computing

Patterns for Moving to the Cloud

Putting the Patterns Together

Page 163: Patterns for Cloud Computing

We’ve covered 5 patterns, but Jim has one last question…

Patterns for Cloud Computing

Page 164: Patterns for Cloud Computing

Are there cases where these patterns work together?

Patterns for Cloud Computing

Page 165: Patterns for Cloud Computing

Putting the Patterns Together

PHP

Let’s build an application in

PHP that scales to many nodes…

Windows Azure

Page 166: Patterns for Cloud Computing

Putting the Patterns Together

PHP

Java Servlet

Google AppEngine

ASP.NETAmazon 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 167: Patterns for Cloud Computing

Putting the Patterns Together

PHP

Java Servlet

Google AppEngine

ASP.NETAmazon EC2

Job

Job

Job

Client

Windows Azure

Compute results with a

MapReduce-like way of

distributing work across all of

these applications

Page 168: Patterns for Cloud Computing

Putting the Patterns Together

PHP

SQL Azure

Database

Java Servlet

Google AppEngine

ASP.NETAmazon EC2

Job

Job

Job

Client

Windows AzureStore the

results in a SQL Azure database

Page 169: Patterns for Cloud Computing

Putting the Patterns Together

PHP

SQL Azure

Database

.NET Service Bus

Java Servlet

Google AppEngine

ASP.NETAmazon EC2

Job

Job

Job

Client

Windows Azure

Coordinate communicatio

n through the .NET

Service Bus

Page 170: Patterns for Cloud Computing

Putting the Patterns Together

PHP

SQL Azure

Database

.NET Service Bus

Java Servlet

Google AppEngine

ASP.NETAmazon EC2

Job

Job

Job

Client

Windows Azure

Page 171: Patterns for Cloud Computing

Next Steps

Page 172: Patterns for Cloud Computing

Obviously, our friend Jim, is fake…

Next Steps

Page 173: Patterns for Cloud Computing

Next Steps

Build on the sessions that you’ve learned

Explore the 5 usage patterns for your scenarios today

Think about the next steps for implementation