Upload
cecil-harper
View
215
Download
2
Tags:
Embed Size (px)
Citation preview
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
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
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
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
___________________ as a Service
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
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
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
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
Storage Keys for Authentication
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
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
Azure Blob Storage
The File System for the Cloud• Blob Container Directory• Blob File
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”
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
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
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
Azure Table Storage
Storage Account
Table [*]
Entity [*, 1 MB data] PartitionKey + RowKey
Property [255x]Name/Value/Type
Up to 64k
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)
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
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)
Replication
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
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
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
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
Azure Does Compute
Compute Services• Web Roles• Worker Roles
• VM Role (coming?)
• Your Code Runs Here
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
“Out” is the New “Up”
• Scaling Out has hard limits at CPU, Memory– Architecturally more limiting
Azure Storage Services in Concert
Key Pattern: Roles + Queues
WebRole(IIS)
WebRole(IIS)
WorkerRole
WorkerRole
Queues
BlobsTables
Canonical Example: Thumbnails
WebRole(IIS)
WebRole(IIS)
WorkerRole
WorkerRole
Queues
BlobsTables
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);
Adding to Queue - Conceptual
Azure Blob Storage
Adding to Queue - Actual
Geography
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
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
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
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
Bill Wilder@codingoutloudhttp://blog.codingoutloud.com