Building Cloud-Native Applications with Microsoft Windows Azure
-
Upload
bill-wilder -
Category
Technology
-
view
2.294 -
download
1
description
Transcript of Building Cloud-Native Applications with Microsoft Windows Azure
![Page 1: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/1.jpg)
Cloud-Native Azure
Vermont Code Camp 211-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
Building Cloud-Native applications using Windows Azure
![Page 2: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/2.jpg)
Agenda
?
![Page 3: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/3.jpg)
What is “the cloud”?
?
![Page 4: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/4.jpg)
The Cloud Opportunity
1. Replace “your” infrastructure with “their” infrastructure
2. Save money, shift risk, shorten time-to-market
![Page 5: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/5.jpg)
The Cloud Provides…
1. Efficient Scalability2. Elasticity on Demand3. Complexity Reduction
through Abstraction4. A few new challenges
![Page 6: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/6.jpg)
Containers!http://www.microsoft.com/showcase/en/us/details/36db4da6-8777-431e-aefb-316ccbb63e4e
![Page 7: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/7.jpg)
Global investment in Data Centers• Vendors build out – so you don’t have to• (increasingly…) “Containers” packed with• Fast, multi-core processors• Cheap, commodity hardware (memory, disk)
– Google’s famously bare-bones hardware
• Locations selected for efficiency considering– Cheap cooling, Cheap electricity– Geographical coverage
• Competitive bidding optimizes for Containers– Delivery “ready to plug-in” & “ready to unplug”
![Page 8: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/8.jpg)
![Page 9: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/9.jpg)
Most $$$ part of Software System?
![Page 10: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/10.jpg)
Massive Automation, Efficiency
• Cross-Data Center Monitoring• Software and Hardware Virtualization
• Automated Deployment (across Data Centers)• HUGE win for customers lowering real costs
– Operational efficiency – you them– 100:1 10,000:1
![Page 11: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/11.jpg)
Application Ownership
Slide stolen from Chris Bowen’s talk: Windows Azure: What? Why? And a Peek Under the Hood 13
Application Development
Network Addressing
Network Load Balancing
Hardware Repair
OS updates & Patches
OS Installation
Computational Scalability
Storage Scalability
Hardware Provisioning
Staging / Production
High Availability
Fault Tolerance
Data Center Management
Stuff We MightRather Not Deal With
Stuff We Like
![Page 12: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/12.jpg)
Utility Computing
• http://commons.wikimedia.org/wiki/File:Thai_plug.jpg
![Page 13: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/13.jpg)
Business Model Innovation
• DIFFERENTIATOR is business model that permits bursting system capacity up and down on demand without penalty– Just like electricity (without the brownouts?)
• Avoids need for Elasticity of Customer’s Work Force– No such thing as hire/fire at Internet speed
![Page 14: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/14.jpg)
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 15: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/15.jpg)
Azure Cloud Platform• The rise of focused, specialized services
– Really good at one thing– True of other Cloud Platforms
• “Scalable” Persistent Storage abstractions– Set of Services– 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 16: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/16.jpg)
Azure Storage Services in Concert
![Page 17: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/17.jpg)
Scaling Out
![Page 18: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/18.jpg)
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 ContinuouslyMaps to VM
![Page 19: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/19.jpg)
Azure Services – Examples
• Web Roles• Worker Roles• Queues
• Combining Roles and Queues– Asynchronous Work Queue Pattern
• Scale Out• Resilient to failure
![Page 20: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/20.jpg)
Key Pattern: Roles + Queues
WebRole(IIS)
WebRole(IIS)
WorkerRole
WorkerRole
Queues
BlobsTables
![Page 21: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/21.jpg)
Canonical Example: Thumbnails
WebRole(IIS)
WebRole(IIS)
WorkerRole
WorkerRole
Queues
BlobsTables
![Page 22: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/22.jpg)
Adding to Queue - Conceptual
![Page 23: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/23.jpg)
Azure Blob Storage
Adding to Queue - Actual
![Page 24: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/24.jpg)
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 25: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/25.jpg)
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 26: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/26.jpg)
![Page 27: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/27.jpg)
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 28: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/28.jpg)
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 29: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/29.jpg)
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 30: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/30.jpg)
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 32: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/32.jpg)
Storage Keys for Authentication
![Page 33: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/33.jpg)
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 34: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/34.jpg)
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 35: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/35.jpg)
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 36: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/36.jpg)
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 37: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/37.jpg)
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 38: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/38.jpg)
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 39: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/39.jpg)
Azure Table Storage
Storage Account
Table [*]
Entity [*, 1 MB data] PartitionKey + RowKey
Property [255x]Name/Value/Type
Up to 64k
![Page 40: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/40.jpg)
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 41: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/41.jpg)
Relational Data vs. Azure TablesApproach SQL Azure Azure TablesNormalization Normalized Denormalized(Duplication) (No duplication) (Lots of duplication)
Structure Schema FlexibleTransactions Distributed Limited scopeResponsibility Database DeveloperKnobs Many FewScale Up (or Sharding) OutCost Reasonable Very
reasonable
![Page 42: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/42.jpg)
![Page 43: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/43.jpg)
Pay As You Go – Data TransferSQL Azure and Azure Storage
• Data in motion…• North America and Europe regions
– $0.10 per GB in– $0.15 per GB out
• (different costs in Asia)• No charge for transfer within a data center
![Page 44: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/44.jpg)
Pay As You Go – StorageAzure Storage
• Data at rest…• Storage
– $0.15 per GB stored per month– $0.01 per 10,000 storage transactions
• Applies equally to:– Queues– Tables– Blobs
![Page 45: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/45.jpg)
SQL Azure Pricing
• Data at rest…• 1 GB relational database = $10 / month• 10 GB relational database = $100 / month• 50 GB version coming
![Page 46: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/46.jpg)
SQL Azure vs. Azure Storage
• Review and Simple Analysis…• 1 GB storage per month:
– $10 = SQL Azure – $0.15 = Azure Storage
• 10/0.15 = 66.67x
• Are the features worth the cost?
![Page 47: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/47.jpg)
Geography
![Page 48: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/48.jpg)
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 49: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/49.jpg)
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 50: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/50.jpg)
Not new, but…
![Page 51: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/51.jpg)
Accessible to mere mortalsLess complex, more cost-effective competitive pressure …
Your competitors are going to be doing it
![Page 52: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/52.jpg)
Questions?
?
![Page 53: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/53.jpg)
BostonAzure.org
• Boston Azure cloud user group• Focused on Microsoft’s cloud solution• Next meeting: 6-8 PM Thurs Sept 23nd 2010
– Hacking on “Boston Azure Project”– Intro to Cloud Computing on Windows Azure
• Meetings usually 4th Thursday of month– No cost; food; great topics; growing community; wifi
• Join email list: http://bostonazure.org• Follow on Twitter: @bostonazure
![Page 54: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/54.jpg)
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 55: Building Cloud-Native Applications with Microsoft Windows Azure](https://reader036.fdocuments.us/reader036/viewer/2022081518/54b2ed1d4a795909758b45b1/html5/thumbnails/55.jpg)
Bill Wilder@codingoutloudhttp://blog.codingoutloud.com