windows azure - ericnel
DESCRIPTION
Introduction to the Azure Services Platform for Future of Web Applications tour, June 3rd 2009TRANSCRIPT
Windows AzureDeveloping and deploying your first Cloud Service
Eric NelsonDeveloper & Platform GroupMicrosoft [email protected] http://geekswithblogs.net/IUpdateable http://twitter.com/ericnel
The plan...
Cloud101Microsoft and CloudIntroduce Azure Services Platform
Windows AzureWeb RoleWorker Role
Storage in the CloudSQL Data ServicesWindows Azure Storage
Table, Blob
Cloud?
Cloud Computing 101
Cloud ComputingRun/Store stuff in the cloud -
Somebody else has the data center/headaches
Infrastructure as a Service (IaaS)Example: Amazon Elastic Compute Cloud (EC2)
Platform as a Service (PaaS)Example: Force.com,Google App Engine
Windows Azure is a PaaS
2008 and 2009 – exciting for Cloud Computing with Microsoft
SQL Server Data Services (SSDS) – announced at MIX 08 (March 2008)
“SQL Server in the cloud”
Azure Services Platform – announced at PDC 08 (October 2008)
Windows Azure “O.S. for the Cloud”+ additional servicesRESTful – enabling “any client” access
Azure Services Platform
ServiceBus
AccessControl
Workflow
…
Database
Reporting
Analytics
…
Compute Storage Manage
Identity
Devices
Contacts
…
…
…
Your Applications
An internet-scale cloud services platform hosted in Microsoft data centers, which provides an operating system and a set
of developer services that can be used individually or together.
Azure Services Platform
ServiceBus
AccessControl
Workflow
…
Database
Reporting
Analytics
…
Compute Storage Manage
Identity
Devices
Contacts
…
…
…
Your Applications
An internet-scale cloud services platform hosted in Microsoft data centers, which provides an operating system and a set
of developer services that can be used individually or together.
In 50 minute
s
Windows Azure
It is an operating system for the cloudIt is designed for utility computing
Many is better than oneLoose couplingSimple stores scale
It provides facilities to:Write your apps (developer experience)Host your apps (compute)Manage your apps (service management)Store your data (storage)
What Is Windows Azure?
{ Simple Walkthough }
It is not that hard
demo
A B
C
Sidebar: What are these?
D
Default.aspx(Take Order + Process
Order)
LB
Tight coupling : Default.aspx.cs
public partial class _Default : System.Web.UI.Page { protected void Button1_Click(object sender,EventArgs e) { var order = txtOrder.Text; ProcessOrder(order); }
protected void ProcessOrder(string order) { //Make some coffee!
... }
}
Default.aspx(Take Order)
Windows Azure Queues
LB
Worker.cs(Process Order)
Loose coupling : Default.aspx.cs
public partial class _Default : System.Web.UI.Page { protected void Button1_Click(object sender,EventArgs e) { var order = txtOrder.Text;
QueueStorage qStore = QueueStorage.Create(_account);
MessageQueue orderQ = qStore.GetQueue("OrderQueue");
orderQ.PutMessage(new Message(order)); }
}
Loose coupling : WorkerRole.cs
public class WorkerRole : RoleEntryPoint { public override void Start() {
QueueStorage qStore = QueueStorage.Create(_account); MessageQueue orderQ = qStore.GetQueue("OrderQueue"); while (true) { Message msg = orderQ.GetMessage();
if( msg != null) ProcessOrder(msg.ContentAsString()); } } protected void ProcessOrder(string order) {
//Make some coffee! ...
}
{Revisit, Instances and Workers}
demo
Storage in the Cloud
Windows Azure Datacenter
Your Service
Typical Azure Application = WebRole + Worker Role + Storage
LB
Internet
Web Site(ASPX, ASMX,
WCF)
Web Site(ASPX, ASMX,
WCF)Web Role
(ASPX, WCF)
Worker Service
Worker Role
LB
StorageTables Blobs
Queue
SQ
L D
ata
Serv
ices2
1
Windows Azure Datacenter
Azure Application = many options
Internet
Application ONE
Web Site(ASPX, ASMX, WCF)
Web Site(ASPX, ASMX, WCF)Web Role
Worker ServiceWorker Role
ONE StorageTables Blobs
Queue SQL Data ServicesDatabase ONE
Application TWO
Web Site(ASPX, ASMX, WCF)
Web Site(ASPX, ASMX, WCF)Web Role
Worker ServiceWorker Role
TWO StorageTables Blobs
Queue
Application THREE
Web Site(ASPX, ASMX, WCF)
Web Site(ASPX, ASMX, WCF)Web Role
Worker ServiceWorker Role
SQL Data Services
Database THREE
FOUR StorageTables Blobs
Queue
Windows Azure and SDS
Azure Storage SQL Data Services
Vision
Access
Relational? (today)
Relational? (tomorrow)
Analogy
Windows Azure and SDS
Azure Storage SQL Data Services
Vision Massively scalable, highly available store in the Cloud
Access REST(Uses ADO.NET Data Services)
Relational? (today)
No
Relational? (tomorrow)
No
Analogy
Windows Azure and SDS
Azure Storage SQL Data Services
Vision Massively scalable, highly available store in the Cloud
Highly scalable, highly available relational store in the Cloud
Access REST(Uses ADO.NET Data Services)
SqlClient + TSQL(Use Azure Web Role + ADO.NET Data Services if REST is required)
Relational? (today)
No Yes – but with some limitations
Relational? (tomorrow)
No Yes – with less and less limitations
Analogy
Windows Azure and SDS
Azure Storage SQL Data Services
Vision Massively scalable, highly available store in the Cloud
Highly scalable, highly available relational store in the Cloud
Access REST(Uses ADO.NET Data Services)
SqlClient + TSQL(Use Azure Web Role + ADO.NET Data Services if REST is required)
Relational? (today)
No Yes – but with some limitations
Relational? (tomorrow)
No Yes – with less and less limitations
Analogy File System RDBMS – as it is!
Windows Azure Datacenter
Your Service
Azure Application = WebRole + Worker Role + Storage
LB
Internet
Web Site(ASPX, ASMX,
WCF)
Web Site(ASPX, ASMX,
WCF)Web Role
(ASPX, WCF)
Worker Service
Worker Role
LB
StorageTables Blobs
Queue
SQ
L D
ata
Serv
ices
Easy
Trickier
Symmetrical APIs – nearly
CloudOn Premise
Application C#, VB, Ruby, PHP
etc
Relational Data
TSQL
Windows Azure Storage
Storage that isDurable, Scalable, Highly Available, Secure, Performant
Rich Data AbstractionsService communication: queues, locks, …Large user data items: blobs, blocks, …Service state: tables, caches, …
Simple and Familiar Programming Interfaces
REST Accessible and ADO.NET
Blob
Entities
Messages
Windows Azure Data Storage Concepts
http://<account>.blob.core.windows.net/<container>
http://<account>.table.core.windows.net/<table>
http://<account>.queue.core.windows.net/<queue>
Account
Container
Table
Queue
Blob Storage
BlockBlobContainerAccount
Account
pictures
IMG001.JPG
IMG002.JPG
movies MOV1.AVI
Block 1
Block 2
Block 3
Table Storage
Massively Scalable TablesBillions of entities (rows) and TBs of dataAutomatically scales to thousands of servers as traffic grows
Highly AvailableCan always access your data
DurableData is replicated at least 3 times
Tables - CapabilitiesWhat tables don’t do
Not relationalNo Referential Integrity
No JoinsLimited Queries
No Group byNo AggregationsNo TransactionsNo Transactions
What tables can do
CheapVery Scalable
FlexibleDurable
If these are important to you, use SQL Data Services Store LOTS of stuff
Table Data Model
Data stored in TablesA Table is a set of Entities (rows)An Entity is a set of Properties (columns)
Entity has:PartitionKey – enables scalabilityRowKey – unique id within the partition
the only indexed property Timestamp – for optimistic concurrency255 properties totalMax size of 1MB
Partition KeyDocument Name
Row KeyVersion
Property 3Modification Time
…..
Property NDescription
Examples Doc V1.0 8/2/2007 ….. Committed version
Examples Doc V2.0.1 9/28/2007 Alice’s working version
FAQ Doc V1.0 5/2/2007 Committed version
FAQ Doc V1.0.1 7/6/2007 Alice’s working version
FAQ Doc V1.0.2 8/1/2007 Sally’s working version
Partition Example
Partition 1
Partition 2
Table Partition - all entities in table with same partition key value
Application controls granularity of partition
Working with Tables
Vessel Position Reporting System – SQL Server
VesselId
xxx-xx1
Time
10:15 14 Nov
Latitude
01.23
Longitude
53.24
Speed
0
xxx-xx1 10:05 14 Nov 04.45 54.32 5
xxx-xx1 09:55 14 Nov 02.32 52.34 4
xxx-xx2 10:15 14 Nov 01.23 51.23 10
To find last pos report for vessel in SQL:
select TOP(1) * from PosRptsorder by [Time] DESCwhere VesselId = ???
Working with Tables
Solving this the Azure wayPartitionKey
Time Latitude Longitude Speed
xxx-xx1 10:15 14 Nov 01.23 53.24 0
xxx-xx1 10:05 14 Nov 04.45 54.32 5
xxx-xx1 09:55 14 Nov 02.32 52.34 4
xxx-xx2 01.23 51.23 1010:15 14 Nov
PartitionKey
VesselId
Working with Tables
PartitionKey
RowKey Latitude Longitude Speed
xxx-xx1
10:15 14 Nov 01.23 53.24 0
10:05 14 Nov 04.45 54.32 5
09:55 14 Nov 02.32 52.34 4
RowKey needs to be a string
2521756430999999999
2521756436999999999
2521756442999999999
(DateTime.MaxValue – time).Ticks.ToString ()
Stored in-order:Just need to do a
top on the partition
time.Ticks.ToString ()
Makes it descending
Azure Services Platform Roadmap
First CTPDeveloper CTP for Services SDKs, and
Tools
Fall 2008 Spring 2009
Updated CTPsEnable Full trust & Fast CGI
Geo-location support.NET Services Open CTP
Live Framework Open CTPSDS Invitation-only CTP
Fall 2009
Commercial AvailabilityWindows Azure.NET ServicesSQL Services
Summer 2009
Pricing and SLA confirmationSDS Public CTP
Windows Azure Summary
Many is better than oneLet Microsoft worry about this
Loose couplingWeb Role and Worker Role
Storage choiceAzure Storage: Simple stores scale
Table, Blob, Queue
SQL Data Services: Full RDBMSStored Procedures, Schema, Transactions, Views etc
What next?•Play with Windows Azure – http://www.azure.com•Understand REST – good and bad practices•Watch the MIX 09 recordings http://live.visitmix.com•Slides at http://geekswithblogs.net/IUpdateableLearn•Students can get Visual Studio through Microsoft DreamSpark•Startups get tools and more via BizSpark•Developers can also use the free Visual Studio Express•Or just use none Microsoft tools and languages e.g. PHP http://phpazure.codeplex.com/
Need tools?
• http://www.newcloudapp.com/ Win
© 2008 Microsoft Ltd. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the
date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.