bill wilder – brief bio bill wilder has been a professional software developer for more than 20...

43
Azure 101 Boston Azure User Group 23-September-2010 Copyright (c) 2010, Bill Wilder Boston Azure User Group http://bostonazure.org @bostonazure Bill Wilder http://blog.codingoutlou d.com @codingoutloud Boston West Toastmasters http://bwtoastmasters. com Not here with my day job Only Bill’s personal views Windows Azure: A really quick look at Tables, Blobs, Queues, SQL Azure & Compute

Upload: cecil-harper

Post on 05-Jan-2016

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure 101

Boston Azure User Group23-September-2010

Copyright (c) 2010, Bill Wilder

Boston Azure User Grouphttp://bostonazure.org@bostonazure

Bill Wilderhttp://blog.codingoutloud.com@codingoutloud

Boston West Toastmasters http://bwtoastmasters.com

Not here with my day jobOnly Bill’s personal views

Windows Azure: A really quick look atTables, Blobs, Queues, SQL Azure &

Compute

Page 2: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Agenda for Azure 101

• Azure’s Place in Cloud• Overview of Tables, Blobs, Queues, Drives• Overview of Compute Resources• Scenarios for combining capabilities– Azure Table Storage vs. Relational SQL Azure• What’s up with NoSQL?

– Roles & Queues• Cloud Scale

Page 3: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Cloud Platform

• The rise of focused, specialized services• Several “Scalable” Persistent Storage

abstractions• Illusion of infinite scale out• Same performance with x clients as with 10x

as with 100x as with 1000x as with …• Billing model: pay only for what you use– Friction-free access to add’l or less storage

Page 4: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Cloud-Native Applications• Effort focuses on business functionality– Development is highly productive– Time-to-market is short– Modification is straight-forward

• Infrastructure is not a limiting factor– Cost structure is a good fit– Downtime is not necessary– Scale is efficient

• Innovation / experimentation is enabled

Page 5: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

___________________ as a Service

Page 6: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Persistent Storage Services – Options

Type of Data Traditional Azure Way

Relational SQL Server SQL Azure

Blob File System, or SQL Server

Azure Blobs

File File System Azure Drives, or Azure Blobs

Reliable Queue MSMQ (maybe) Azure Queues

Non-Relational Azure Tables

Page 7: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Storage Services

• Family of specialized, complementary storage services– Abstractions– High level services

• Blobs + Queues + Tables + Drives1.Many features in common2.Plus each with its own differentiating features

Page 8: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Storage – Common Features

• RESTful API (http + XML + “resources”)http://bostonazure.table.core.windows.net/TableFoo?comp=list

• Operations - REST/http verb supportCreate = PUT Read = GETUpdate = POST Delete = DELETE

• Language agnostic• Client library provided for .NET by Microsoft–Many other client libraries available

Page 9: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Authentication Requirements

• PUT, POST, DELETE are always Authenticated• GET is usually Authenticated– Exception possible for Blobs – Blob GET access can be public if Blob Container

allows for Unauthenticated GET requests

• Sign http header using Access Key from Portal– Don’t need to code this (use Microsoft-

provided .NET client library)– Key lives in an Azure xml config file

Page 10: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Developer Portal for Keys

https://windows.azure.com/

Page 11: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Storage Keys for Authentication

Page 12: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Storage – Common Features

• Tables, Blobs, Queues, Drives all share the following features / characteristics

• Are all created under your Azure Storage Account

• Storage Account is usually created through the Developer Portal– Or API

Page 13: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Storage – Common Features

• Support for metadata (8k, unstructured)• Replicated so there are (at least) 3 copies– Within in a single data center– Strongly consistent programming model

• Easy, fast to dynamically add new containers– No limit to number of instances of blobs, tables,

table rows, or queues

• Pay As You Go billing model

Page 14: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Blob Storage

The File System for the Cloud• Blob Container Directory• Blob File

Page 15: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Blob Storage• The place to put ANY LARGE OBJECT• Private or Public• Public blobs can be anonymously accessed– Images, videos, CSS files– Need not be binary

• Public blobs can be cached in Azure CDN– 20 locations around the world– Different locations than data centers

• Time-limited signed-access available– “You have until tomorrow to download this video”

Page 16: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Blob Storage

• Two types of Azure Blobs1.“Block Blob”– Parallel upload scenarios– Resume download scenarios– Up to 200 GB

2.“Page Blob”– Random access scenarios– Azure Drives– Up to 1000 GB

Page 17: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Drive Storage

• Disk Drive simulation in cloud• Façade over an Azure Blob– Specifically, Page Blob type

• Legacy-focused, not “cloud native”• Limits same as Page Blob limits– 1000 GB = 1 TB

Page 18: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Table Storage

• Best place for granular, semi-structured data– No rigid database schema

• Fast and easy to instantiate– Strongly Consistent– No performance lag

• Programming model is WCF Data Services– All data access and data updates– LINQ

Page 19: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Table Storage

Storage Account

Table [*]

Entity [*, 1 MB data] PartitionKey + RowKey

Property [255x]Name/Value/Type

Up to 64k

Page 20: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Table Storage

• Partition Key– Along a “logical grouping” – a “shard”– PartitionKey value of up to 64 KB

• Row Key– Identify specific row within a partition– RowKey value is String of up to 64 KB

• Table access requires Partition Key + Row Key– Not to mention (cryptographic) Access Key (for the

digital signing of the http header)

Page 21: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Relational Data vs. Azure TablesApproach SQL Azure Azure Tables

Normalization Normalized Denormalized(Duplication) (No duplication) (Lots of duplication)

Structure Schema Flexible

Transactions Distributed Limited scope

Responsibility Database Developer

Knobs Many Few

Scale Up (or Sharding) Out

Cost Reasonable Less expensive

Page 22: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Queue Storage

• Service for RELIABLE message delivery• 7 days = default TTL for item to stay in queue• 30 seconds = default “invisibility window”• 8 KB = max size of a queued item• 500 = approx number of transactions a queue

can handle per second– Beware of “spinning” – may get throttled, disabled

• N = number of queues you can have (N >> 1)

Page 23: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Replication

Page 24: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

All Azure Storage is Replicated

• Resilient in case of failure– “All data replicated multiple times” – Sriram

Krishnan, Programming Windows Azure, p130+

• Supports scale-out– Replicate specific data if it gets too hot to keep up

• Geographic distribution of replication– Currently up to you

Page 25: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,
Page 26: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Pay As You Go – Storage

• Storage– $0.15 per GB stored per month– $0.01 per 10,000 storage transactions

• Applies equally to:– Queues– Tables– Blobs– Drives

Page 27: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Pay As You Go – Data Transfer

• North America and Europe regions– $0.10 per GB in– $0.15 per GB out

• Asia Pacific Region– $0.30 per GB in– $0.45 per GB out

• No charge for transfer within a data center

Page 28: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Pay As You Go – CDN

• Content Delivery Network (CDN)– $0.15 per GB for data transfers from European

and North American locations– $0.20 per GB for data transfers from other

locations– $0.01 per 10,000 transactions

• Same or less expensive than straight-to-blob costs

Page 29: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Does Compute

Compute Services• Web Roles• Worker Roles

• VM Role (coming?)

• Your Code Runs Here

Page 30: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Web Roles vs. Worker RolesWeb Role Worker Role

Runs in IIS 7(always listening)

Built using ASP.NET, MVCGood to handle interactive usersAddressable over InternetGood for hosting Web API (WCF)Runs Continuously

Page 31: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

“Out” is the New “Up”

• Scaling Out has hard limits at CPU, Memory– Architecturally more limiting

Page 32: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Storage Services in Concert

Page 33: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Key Pattern: Roles + Queues

WebRole(IIS)

WebRole(IIS)

WorkerRole

WorkerRole

Queues

BlobsTables

Page 34: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Canonical Example: Thumbnails

WebRole(IIS)

WebRole(IIS)

WorkerRole

WorkerRole

Queues

BlobsTables

Page 35: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Roles + Queues: API

WebRole(IIS)

WebRole(IIS)

WorkerRole

WorkerRole

Queues

queue.AddMessage( new CloudQueueMessage( statusUpdateMessage));

CloudQueueMessage statusUpdateMessage = queue.GetMessage( TimeSpan.FromSeconds(10));

… queue.DeleteMessage(statusUpdateMessage);

Page 36: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Adding to Queue - Conceptual

Page 37: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Azure Blob Storage

Adding to Queue - Actual

Page 38: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Geography

Page 39: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Geography Matters

• Select Data Center near customers• Keep data resources near compute resources

• Currently 6 data centers from which to choose• Additional 20 sites for CDN

Page 40: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Geography Matters

• Azure data centers1. North Central US2. South Central US3. West Europe4. North Europe5. East Asia6. Southeast Asia

• Anywhere options for: US, Europe, Asia

Data Center choices

Page 41: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Slides available from Bill’s blog

http://blog.codingoutloud.com

hmbl.me is URL shortener running on Azure:

http://hmbl.me/2FPW3L

http://blog.codingoutloud.com/2010/07/14/key-architectural-design-pattern-for-cloud-native-azure-apps

Page 42: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

BostonAzure.org

• Boston Azure cloud user group• Focused on Microsoft’s cloud solution• Next meeting: 6-8 PM Thurs Oct 21nd 2010– Hacking on “Boston Azure Project”– Ben Day on Azure + Silverlight: Better Together

• Meetings usually 4th Thursday of month– No cost; food; great topics; growing community

• Join email list: http://bostonazure.org• Follow on Twitter: @bostonazure

Page 43: Bill Wilder – brief bio Bill Wilder has been a professional software developer for more than 20 years. Last year he founded the Boston Azure User Group,

Bill Wilder@codingoutloudhttp://blog.codingoutloud.com