61
David Pallmann GM Custom App Dev, Neudesic http://davidpallmann.blogspot.com @davidpallmann

Windows azure design patterns

Embed Size (px)

Citation preview

Page 1: Windows azure design patterns

David Pallmann GM Custom App Dev, Neudesic http://davidpallmann.blogspot.com @davidpallmann

Sheena.Graham
Stamp
Page 2: Windows azure design patterns

1. General Cloud Computing Patterns 2. Patterns in the Windows Azure platform

Compute Storage Relational Database Communication Security Network

3. Cloud application patterns discussion Discussion / Q & A

Page 3: Windows azure design patterns

Pu Pr Hy Ia Sa Pa Ps Su

Ro In Wo We Vr Lb Ep Ei

Bl Co Qm Qu En Ta Pk Rk Ep

Ds Db Rd Sg Fr Sh Fm Re

General

Compute

Storage

DB

Sb Sq To Fi Su Comm

Vn Rg Mg Network

Ip Rp Ts Tk Cl Security Ra

Cd Tm Rl Rf Rd

Ca

Page 4: Windows azure design patterns

Pu Pr Hy Ia Sa Pa Ps Su

Cloud Types Cloud Levels of Use Platform

PUBLIC CLOUD

PRIVATE CLOUD

HYBRID CLOUD

INFRASTR. AS A SVCE

PLATFORM AS A SVCE

SOFTWARE AS A SVCE

PLATFORM SERVICE

SUBSCRIP- TION

Page 5: Windows azure design patterns

Public Cloud Private Cloud Hybrid Cloud

Pu Pr Hy

Page 6: Windows azure design patterns

Advanced data center, global presence On-demand, elastic scale, well-managed Multi-tenant, consumption-based pricing

Pu PUBLIC CLOUD

Page 7: Windows azure design patterns

On-premises virtualization infrastructure Shares some characteristics of public cloud Upcoming Windows Server 8 is able to virtually pool and allocate compute, storage, network resources in a multi-tenant fashion

Pr

YOUR CLOUD INFRASTRUCTURE

PRIVATE CLOUD

Page 8: Windows azure design patterns

Connect public cloud with private cloud Integrate via VPN or other means

Hy

YOUR CLOUD INFRASTRUCTURE

CLOUD VENDOR INFRASTRUCTURE

HYBRID CLOUD

Page 9: Windows azure design patterns

Ia Sa Pa

“Bring Your Own VM“ “Bring Your Own App” “Bring Your Own User”

IaaS Raw Virtual Resources

PaaS App Services Platform

SaaS Just Use It

INFRASTR. AS A SVCE

PLATFORM AS A SVCE

SOFTWARE AS A SVCE

Page 10: Windows azure design patterns

Service provided by the cloud platform Compute Service

Run your software in the cloud data center Most intimate level of cloud computing Other services generally usable in-cloud or on-prem

RESTful Services Most cloud services use HTTP REST Storage, Communication, Management, …

Interop Services Use a specific protocol for interop / compatibility Example: SQL Azure Database (TDS protocol)

Ps PLATFORM

SERVICE

Page 11: Windows azure design patterns

Ongoing billing arrangement Consumption-based Services used have pricing meters Types

Month-to-month Term subscription Negotiated terms

Month-to-month is easy entry / easy exit without residual obligations Term or negotiated subscriptions can get you a discount in exchange for a commitment

Su SUBSCRIP-

TION

Page 12: Windows azure design patterns
Page 13: Windows azure design patterns

Compute Service

Storage Service

Blob Storage

Queue Storage

Table Storage

SQL Azure Database

SQL Azure Reporting

Cache Service

Service Bus

Windows Azure Traffic Manager

Access Control Service

SQL Azure Data Sync Service

SQL Azure Import Export Service

Windows Azure Connect

DataMarket

CDN

S

Ps PLATFORM

SERVICE

Page 14: Windows azure design patterns

Fault domain Spreads out your redundant servers / storage across the data center so a large failure doesn’t take out all of your resources

Upgrade domain How patches or application updates are applied Upgrades parts of your application in sequence (“red black pattern”) to maintain availability

Du Df FAULT

DOMAIN UPGRADE DOMAIN

Page 15: Windows azure design patterns

Upgrade Domain 2

Upgrade Domain 3

Upgrade Domain 1

Fault Domain 3 Fault Domain 2 Fault Domain 1

Role A Instance 1

Role B Instance 1

Role C Instance 1

Role B Instance 2

Role C Instance 2

Role A Instance 2

Role C Instance 3

Role A Instance 3

Role B Instance 3

Page 16: Windows azure design patterns

Roles

Ro In Wo We Vr Lb Ep Ei Ca

Endpoints Cache

ROLE INSTANCE WEB ROLE

WORKER ROLE

VM ROLE

LOAD BALANCER

INPUT ENDPOINT

INTERNAL ENDPONIT

CACHE SERVICE

Page 17: Windows azure design patterns

Your app, hosted in Compute service Consists of one or more tiers (“roles”) Production & Staging deployment slots

Hs

Production Deployment

Slot

Staging Deployment

Slot

Windows Azure Regional

Data Center Hosted Service Project

Subscription

Page 18: Windows azure design patterns

Role: a tier of your app (VM farm) Instance: VM, member of a role (5 sizes) Role has one or more instances (2+ for SLA) VM instances are volatile, roles are sturdy (like ants : colony or soldiers : army, you can lose an individual but the organization survives)

In Ro

VM VM VM VM VM

ROLE INSTANCE

Page 19: Windows azure design patterns

We

Configured with Windows Server, IIS & a public LB endpoint

Upload your app

PaaS

Managed Auto patched

Configured with Windows Server

Upload your app

PaaS Managed

Auto patched

You prepare a VM

Upload a full VM

IaaS You Manage

No auto-patching

Web Role Web Container

Worker Role General-purpose Container

VM Role VM Image

Vr Wo WEB ROLE

WORKER ROLE

VM ROLE

Page 20: Windows azure design patterns

Allows access to a role Load balancer: round-robin Input (public) endpoint: public, load-balanced Internal endpoint: only accessible by cloud app

Ei Ep

VM VM VM VM VM

Lb LOAD

BALANCER INPUT

ENDPOINT INTERNAL ENDPOINT

Page 21: Windows azure design patterns

Di Dp

HOSTED SERVICE

APPLICATION RUNTIME

FILES

Compute Service

SERVICE METADATA

HOSTED SERVICE

CUSTOM VM IMAGE

Compute Service

SERVICE METADATA

Paas Deployment IaaS Deployment PAAS DEPLOYMENT

IAAS DEPLOYMENT

Page 22: Windows azure design patterns

VM VM VM

Web Role Com

pute Tier W

orker Role Compute Tier

Public Endpoint

Queue

VM VM VM

Page 23: Windows azure design patterns

Cache Service Distributed Memory Cache Available in different sizes Same programming model as Windows Server Cache (“Velocity”)

Ca CACHE

SERVICE

Page 24: Windows azure design patterns

Attendee Bee Conference App HTML5/Mobile ASP.NET/MVC web site hosted in a Web Role

Page 25: Windows azure design patterns

Bl Co Qm Qu En Ta Pk Rk Ep

Blob Storage Queue Storage Table Storage

BLOB CONTAINER QUEUE MESSAGE

QUEUE TABLE ENTITY PARTITION KEY

ROW KEY

ENTITY PROPERTY

Page 26: Windows azure design patterns

Ratio of primitive : relational data is frequently higher in the cloud Cheap: pennies per gigabyte/mo Scale: no practical size limit Simple: less complexity / overhead Lighter: optimistic concurrency Trendy: fueled by trends in cloud / mobile arch/ & movements like NoSQL

Page 27: Windows azure design patterns

Bl

Use for anything you would normally use a

file for

For queuing task messages

Structured data where you don’t need

relational features

Blob Storage File-like

Queue Storage Simple queues

Table Storage Big, cheap tables

Ta Qu BLOB QUEUE TABLE

Page 28: Windows azure design patterns

Blob: File-like storage Container: Holds blobs, like folder Name, data, metadata Sequential/streamed access Simple put/get operations Data stored with redundancy Provides persistence for VMs Directly reference blobs as URIs 2 kinds of blobs: block (sequential), page (random)

Co Bl BLOB CONTAINER

Page 29: Windows azure design patterns

Queue: holds messages Messages small string or XML content Access semantics may differ from enterprise queue technologies you are used to Enterprise reasons to use queues also apply in the cloud Can use queues to load-balance workers Can use queues to coordinate work across roles Strict FIFO not guaranteed due to queue semantics

Qm Qu QUEUE QUEUE

MESSAGE

Page 30: Windows azure design patterns

Big, cheap data tables Simple record-oriented storage Table: hold entities (records) Entity: contains properties (fields) Does not enforce a schema No relational features Partition Key + Row Key = a unique key

En Ta

Rk Pk En Ep Ep Ep :

TABLE ENTITY

ENTITY PARTITION KEY

ROW KEY

ENTITY PROPERTY

ENTITY PROPERTY

ENTITY PROPERTY

Page 31: Windows azure design patterns

IMAGES

MEDIA CONTAINER

VIDEO XML

20 GB

1000 40 40

WEB ORDERS

ORDER QUEUE

PHONE ORDERS

COUNTRY (PK) CUSTOMER ID (RK) LAST NAME FIRST NAME STREET CITY STATE POSTAL PHONE EMAIL

CONTACTS TABLE

Page 32: Windows azure design patterns

AttendeeBee Conference App Blob & Table Storage

Page 33: Windows azure design patterns

Db Db Rd Sh Sg Fr Re Fm

Database Reporting Service

Data Sync Service

Federation Service

DATABASE SERVER

DATABASE REPORT DEFINITION

REPORT ENDPOINT

SYNC GROUP

SYNC HUB

FEDERATION ROOT

FEDERATION MEMBER

Page 34: Windows azure design patterns

Db

Sql Azure Database Database Service

Sql Azure Reporting Reporting Service

SQL Azure Data Sync Synchronization Service

Sy

Rs

Sql Azure Federations Database Federation Service

Fr

DATABASE SERVICE

REPORT SERVICE

SYNC SERVICE FEDERATION

SERVICE

Page 35: Windows azure design patterns

Relational DB as a service One master and two replicants, auto failover Physical management handled for you Has most SQL Server features but not all Size limit of 150GB Database Server: virtual DB server (actually 3) Database: database contained in a DB server

Db Ds DATABASE

SERVER DATABASE

Page 36: Windows azure design patterns

DB reporting as a service Similar experience to SSRS Source is SQL Azure Database Use BIDS to create reports, RDF format Rd: report definition Re: web-accessible reporting endpoint

Re Rd REPORT

DEFINITION REPORT

ENDPOINT

Page 37: Windows azure design patterns

1-way or bi-directional syncing SQL Azure to SQL Azure SQL Azure to SQL Server Hub and spoke model: all syncing is to and/or from the hub SQL Azure database Can trigger a sync manually or schedule Sync: Synchronization operation Sync group: Defines group of DBs for syncing Sync hub: the hub of the sync group

Sh Sg SYNC GROUP SYNC HUB

Page 38: Windows azure design patterns

Database federation Partition or shard to multiple databases, have a “federation database” that looks like one DB Federation Root: federation root database Federation Member: member database

Fm Fr FEDERATION

ROOT FEDERATION

MEMBER

Page 39: Windows azure design patterns

Accessing & Managing a SQL Azure Database

Page 40: Windows azure design patterns

Sb Sq To Fi Su

Service Bus Service Bus Queues

SERVICE BUS

SERVICE BUS QUEUE

TOPIC SUBSCRIP- TION

FILTER

Page 41: Windows azure design patterns

Using the cloud as a communication relay Navigates NATs, firewalls, proxies well Supports client-service, eventing/pub-sub messaging patterns Volatile (best effort) messaging

Sb SERVICE

BUS

Page 42: Windows azure design patterns

Service Bus Queue: Durable messaging Topic: publish point for durable messaging Subscription: receiver of durable messaging Filter : criteria on which messages to receive

Sq

Su

To

Fi

SERVICE BUS QUEUE

TOPIC

SUBSCRIP- TION

FILTER

Page 43: Windows azure design patterns

T-Shirt World Using a Service Bus Queue to Relay Orders for Processing

Page 44: Windows azure design patterns

Vn Rg Mg

VPN Connection

Cd

CDN

Tm

Traffic Manager

Rl Rf Rd VIRTUAL

NETWORK ROLE

GROUP MACHINE

GROUP CONTENT DELIVERY NETWORK

TRAFFIC MANAGER

LOCALE-BASED ROUTING

FAILOVER ROUTING

DISTRIBUTED ROUTING

Page 45: Windows azure design patterns

Windows Azure Connect Virtual Network: VPN connection between cloud and on-prem machines Role Group: indicates which roles are members of a virtual network Machine Group: indicates which on-prem machines are members of a virtual network

Vn

Mg

Rg

VIRTUAL NETWORK

ROLE GROUP

MACHINE GROUP

Page 46: Windows azure design patterns

S

WEB ROLE

S

3

S

SQL SERVER DATABASE

Page 47: Windows azure design patterns

Content Delivery Network CDN: Utilizes worldwide network of 24+ edge server to deliver content efficiently Often used for media Locale-directed DNS goes to nearest node to serve up cached content Content sources from blob storage or your hosted service

Cd CONTENT DELIVERY NETWORK

Page 48: Windows azure design patterns

Windows Azure Traffic Manager Traffic Manager: Routes DNS access to your hosted service to one of several possible deployments based on rules Locale-based Routing: route to a deployment based on locale Failover Routing: route to a secondary if primary is not healthy (via a heartbeat) Distributed Routing: route based on a desired distribution across data centers

Tm

Rl

Rf

Rd

TRAFFIC MANAGER

LOCALE-BASED ROUTINE

FAILOVER ROUTING

DISTRIBUTED ROUTING

Page 49: Windows azure design patterns

Ip Rp Ts

Claims-based Security

Tk Cl Ra IDENTITY

PROVIDER RELYING PARTY

SECURITY TOKEN

SERVICE

TOKEN CLAIM REDIRECTED AUTHENTICATION

Page 50: Windows azure design patterns

Modern way to do AuthN/AuthZ Use with web identity, domain identity Identity Provider: Party providing security token with claims Relying Party: application that wants to authenticate/authorize user Security Token Service: how application/user authenticates (interactively or programmatically) Redirected Authentication: user visits app, user redirected to STS to sign in, redirected back to app with token

Ip

Ts

Rp

Ra

IDENTITY PROVIDER

RELYING PARTY

SECURITY TOKEN

SERVICE

REDIRECTED AUTHENTICATION

Page 51: Windows azure design patterns

S

WEB ROLE

S

2+

Windows Azure

RP ACS

Google

Yahoo!

Live ID

Page 52: Windows azure design patterns

S

WEB ROLE

S

2+

Windows Azure

RP

ADFS

AD

Enterprise

Page 53: Windows azure design patterns
Page 54: Windows azure design patterns

Can “load balance” back end of worker roles using queues

Worker Role

Queue

Page 55: Windows azure design patterns

Front end can submit tasks for the back end Both front end and back end can be scaled to accommodate load

Web Role

Worker Role

Q

Page 56: Windows azure design patterns

Command/Query Responsibility Segregation Best for large implementations Separate read & write

WEB FARM CQRS-READS

PUBLIC CLOUD

WEB FARM CQRS-WRITES

CLUSTERED / PARTITIONED DB

FILES, QUEUES

RELATIONAL DATA

NON-RELATIONAL DATA

You probably don’t do the same amount of each Take advantage of lightweight read mechanisms Safer – avoid accidental updates/deletes

Page 57: Windows azure design patterns
Page 58: Windows azure design patterns

DECENTRALIZED BACK END

Business Services

Application

TABLET

CLOU

D

HETEROGENEOUS FRONT END

DESKTOP BROWSER

PHONE

Identity Services

IP

Data Stores

Platform Services

Directories

Partner Services

PARTNER

Data Stores

Page 59: Windows azure design patterns

Attendee Bee Conference App Open, Mobile, Global, & Social

Page 60: Windows azure design patterns

Pu Pr Hy Ia Sa Pa Ps Su

Ro In Wo We Vr Lb Ep Ei

Bl Co Qm Qu En Ta Pk Rk Ep

Ds Db Rd Sg Fr Sh Fm Re

General

Compute

Storage

DB

Sb Sq To Fi Su Comm

Vn Rg Mg Network

Ip Rp Ts Tk Cl Security Ra

Cd Tm Rl Rf Rd

Ca

Page 61: Windows azure design patterns

David Pallmann GM Custom App Dev, Neudesic http://davidpallmann.blogspot.com @davidpallmann

Thanks!