Developing For The Windows Azure Platform

Preview:

Citation preview

Marcus Tillett

T:@drmarcustillett

www.dotnetsolutions.co.uk

Dive into the Windows Azure Platform DEMO: Migrating an existing on-premise

application to Azure .NET development differences with the

Windows Azure Platform

Windows Azure

Applications

AppFabric

SQL Azure

Applications

Others Mobile Desktop Server

Fabric

Storage

Config

Compute

Application

AppFabric

Windows Azure

Applications

Applications

SQL Azure

Others Mobile

Desktop

Server

IIS7

Web Hosting Web Services

Storage Services

Public Internet

Web Role

Load Balancer

Self hosted

“Windows Services”

Infinite Loop

Storage Service

Public Internet

Worker Role

Load Balancer

Open - REST interface

HTTP or HTTPS

Authenticated using secret keys Can access from outside Azure All data replicated at least 3 times

Table Storage Blob Storage Queue Drive

Provide access rights to containers and blobs

Start

Expiry

Permission (r, w, d, l)

Resource (c, b)

No limits on number of Queues Message:

Max size 8kb

Operations:

▪ Enqueue

▪ Dequeue

▪ RemoveMessage

Queues guarantee a message will be processed at least once.

Allows recovery in the event of errors

Message come back to life if not Removed

Approximates First In First Out queue

Partition Key for Scale Row Key for performance

Non-RowKey queries result in a partition scan

Row Key and Partition Key as strings Data sorted by Row Key within a Partition

Denormalise the data for performance These aren’t SQL tables

PartitionKey (Category)

RowKey (Title)

Timestamp ReleaseDate

Action Fast & Furious … 2009

Action The Bourne Ultimatum

… 2007

… … … …

Animation Open Season 2 … 2009

Animation The Ant Bully … 2006

… … … …

Comedy Office Space … 1999

… … … …

SciFi X-Men Origins: Wolverine

… 2009

… … … …

War Defiance … 2008

Fast query by Partition Key and Row Key

PartitionKey (Category)

RowKey (Title)

ReleaseDate

Action Fast & Furious 2009

Action The Bourne Ultimatum

2007

… … …

Animation Open Season 2 2009

Animation The Ant Bully 2006

… … …

Comedy Office Space 1999

… … …

SciFi X-Men Origins: Wolverine

2009

PartitionKey (ReleaseDate)

RowKey (Title)

Category

2009 Fast & Furious Action

2007 The Bourne Ultimatum

Action

… … …

2009 Open Season 2 Animation

2006 The Ant Bully Animation

… … …

1999 Office Space Comedy

… … …

2009 X-Men Origins: Wolverine

SciFi

Film_ByCategory Film_ByReleaseDate

Example

PartitionKey

RowKey Title Date Approve Cost Centre

Description Amount

123 Client meeting

1/6/10 Y 123

123 1 Travel £15.00

123 2 Lunch £10.00

123 3 Drinks £25.00

456 Training course

5/8/10 N 123

.... .... .... .... .... .... .... ....

Motivation: Ensure that modifications to a master record and its

item records are performed in a transactional way.

Implementation : Multiple entity types stored in single table with the

same partition key can utilise the Windows Azure Table entity group transaction feature that provides batch transactions on entities.

Uses: When a transactional operation is required.

Retry when connections fail Expect network latency (e.g. SQL Azure) Be stateless Design for failure

Don’t rely on local storage

Allow for restart in inconsistent state

Be aware of the emerging patterns for Azure

http://bit.ly/9Wsrk

Choose you Table partition key carefully

Development Fabric Differences from development and live Test early and often

Limited registry and disk access Logging and Diagnostics Configuration

app and web config for runtime static configuration Azure configuration for simple strings Roll your own for more complex configuration

Deployment Only core .NET assemblies are pre-deployed in Azure. You

need to deploy any custom libraries yourself.

Transact-SQL Features Supported Transact-SQL Features Unsupported

Constants

Constraints

Cursors

Index management and rebuilding

indexes

Local temporary tables

Reserved keywords

Stored procedures

Statistics management

Transactions

Triggers

Tables, joins, and table variables

User-defined functions

Views, including sys.synonyms view

Spatial data and indexes (June 2010)

Common Language Runtime (CLR)

Database file placement

Database mirroring

Distributed queries

Distributed transactions

Filegroup management

Global temporary tables

SQL Server configuration options

SQL Server Service Broker

System tables

Trace Flags

Further reading http://www.azure.com/ http://blog.smarx.com/

Signup for Azure http://www.microsoft.com/windowsazure/offers/

(Credit card required) Ensure that you complete delete a deployment –

otherwise you will be charged! Join your local user group

UK (http://ukazurenet.com) Buy a book

http://tinyurl.com/azurebook

“Thinking of... Delivering Solutions on the Windows Azure Platform?”

ISBN: 0956155634

Marcus Tillett

T:@drmarcustillett

www.dotnetsolutions.co.uk