Eric Nelson
Developer & Platform Group
Microsoft Ltd
eric.nelson@microsoft.com
http://geekswithblogs.net/IUpdateable
http:...
Cloud
  101
  Microsoft and Cloud
  Azure Services Platform

Windows Azure
  Overview
  Many vs “the one”
  Web Role
  Wor...
{ Simple Walkthough }



It is not that hard
Cloud Computing
  Run/Store stuff in the cloud -
    Somebody else has the data center/headaches 
  Amazon.com key role i...
SQL Server Data Services (SSDS) – announced
at MIX 08 (March 2008)
  “SQL Server in the cloud”
ADO.NET Data Services - par...
It is an operating system for the cloud
It is designed for utility computing
It provides facilities to:
  Write your apps ...
Pre-requisites
    Vista or Server 2008
    Visual Studio 2008 SP1 or VS Web Express Version
    SQL Express 2005 or 2008 ...
Install the SDK
   Samples
   Development Fabric
Install the Visual Studio 2008 plug-in
   Project Templates
Run as Admin
...
Many is better than one
Loose coupling
Simple stores scale
Big,
 reliable,
expensive
 machine
Tech Preview offers one type of VM
    Platform: 64-bit Windows Server 2008
    CPU: 1.5-1.7 GHz x64 equivalent
    Memory...
A   A   A   B   B   C   D   E   E   E   E


F   G   G   G   G   G   H   I   J   K   L

M   N   O   O   O   P   Q   R   S  ...
A
        B




            D
    C
Unused
Buy more of
                                    capacity
 everything


                      Rearchitect
          ...
Default.aspx
     (Take Order + Process
LB




            Order)
public partial class _Default : System.Web.UI.Page
    {
        protected void Button1_Click(object sender,EventArgs e)
 ...
Default.aspx                             Worker.cs
LB




     (Take Order)                          (Process Order)




 ...
public partial class _Default : System.Web.UI.Page
    {
        protected void Button1_Click(object sender,EventArgs e)
 ...
public class WorkerRole : RoleEntryPoint
    {
        public override void Start()
        {

           QueueStorage qSt...
{Revisit, Instances and
Workers}
3

    2
Web Site
                             Web Site
                            Web Role
                              (ASPX, A...
Azure Storage   SQL Data Services
Vision




Access



Relational? (today)


Relational?
(tomorrow)
Analogy
Azure Storage        SQL Data Services
Vision                Highly scalable,
                      highly available
     ...
Azure Storage        SQL Data Services
Vision                Highly scalable,     Highly scalable,
                      h...
Azure Storage        SQL Data Services
Vision                Highly scalable,     Highly scalable,
                      h...
Web Site
                                 Web Site
                                Web Role
                              ...
Storage that is
  Durable, Scalable, Highly Available, Secure,
  Performant

Rich Data Abstractions
  Service communicatio...
Blobs
           Container
          http://<account>.blob.core.windows.net/<container>



               Table           ...
Massively Scalable Tables
  Billions of entities (rows) and TBs of data
  Automatically scales to thousands of servers
  a...
What tables don’t do        What tables can do

                            
         Not relational                 Che...
Data stored in Tables
   A Table is a set of Entities (rows)
   An Entity is a set of Properties (columns)
Entity has:
   ...
…..
Partition Key   Row Key   Property 3           Property N
Document        Version   Modification         Description
N...
Vessel Position Reporting System – SQL Server

   VesselId      Time            Latitude        Longitude         Speed
  ...
Solving this the Azure way
              PartitionKey
   VesselId      Time        Latitude   Longitude   Speed
   xxx-xx1...
Stored in-order:
                            RowKey needs to
Just need to do a
                              be a string
 ...
ADO.NET Data Services REST Interface
Client
.NET Framework 3.5 SP1 Use any HTTP stack

Data represented         Data repre...
Example using ADO.NET Data Services
    Table Entities are represented as Class Objects
[DataServiceKey(quot;PartitionKeyq...
Every Account has a master table called “Tables”
       It is used to keep track of the tables in your account
       To u...
Create a new Customer and Insert into
    Table
Customer cust = new Customer(
‚Lee‛,                 //   Partition Key = ...
LINQ
// Service Uri is ‚http://<Account>.table.core.windows.net/‛
DataServiceContext context = new DataServiceContext(serv...
Customer cust = (
    from c in context.CreateQuery<Customer> (‚Customers‛)
    where c.PartitionKey == ‚Lee‛ // Partition...
Account   Container    Blob      Block
                      IMG001.
                        JPG
           pictures
     ...
Uploading a large blob

                                        blobName = “TheBlob.wmv”;
             10 GB Movie
       ...
Applications are no longer restricted to run
in medium trust
  P/Invoke any native binary
  Use more of the .NET stack, e....
Your “cloud project” consists of applications:
   0 or more compute services
   0 or more storage accounts
Windows Azure i...
Developer CTP for Enable Full trust & Fast CGI
                      Geo-location support
Services SDKs, and              ...
Many is better than one
  Let Microsoft worry about this
Loose coupling
  Web Role and Worker Role
Simple stores scale
  T...
2009     •   Play with Windows Azure – http://www.azure.com
          •   Invest time in ADO.NET Data Services (3.5 SP1)
 ...
www.azure.com
http://geekswithblogs.net/IUpdateable
© 2008 Microsoft Ltd. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registe...
ServiceDefinition.csdef
<ServiceDefinition name=quot;DemoServicequot;>
  <WebRole name=quot;WebRolequot;>
    <Configurati...
<?xml version=quot;1.0quot;?>
<ServiceConfiguration serviceName=‚DemoService‛>
 <Role name=quot;WebRolequot;>
      <Insta...
Default .NET HTTP connections is set to 2
  ServicePointManager.DefaultConnectionLimit = X;
Turn off 100-continue (saves o...
Be prepared for partial results
from your queries
   Check for the continuation token
Storing different types of entities ...
SaaS = Software as a Service
  Aka “On Demand” vs “On Premise” software
    Many customers hate “On Premise” hassle
  Inde...
listAllUsers() vs http://mysite.com/users/ ?
addUser() vs POST http://mysite.com/users/
deleteUser() vs DELETE http://mysi...
Windows Azure Overview
Windows Azure Overview
Windows Azure Overview
Windows Azure Overview
Windows Azure Overview
Windows Azure Overview
Windows Azure Overview
Windows Azure Overview
Windows Azure Overview
Upcoming SlideShare
Loading in...5
×

Windows Azure Overview

3,551

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,551
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
86
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Windows Azure Overview"

  1. 1. Eric Nelson Developer & Platform Group Microsoft Ltd eric.nelson@microsoft.com http://geekswithblogs.net/IUpdateable http://twitter.com/ericnel
  2. 2. Cloud 101 Microsoft and Cloud Azure Services Platform Windows Azure Overview Many vs “the one” Web Role Worker Role Storage in the Cloud Windows Azure Storage + a little on SQL Data Services
  3. 3. { Simple Walkthough } It is not that hard
  4. 4. Cloud Computing Run/Store stuff in the cloud - Somebody else has the data center/headaches  Amazon.com key role in Cloud Computing Amazon S3 (Simple Storage Service) – objects Amazon EC2 (Elastic Compute Cloud) – virtual machines WebServices and RESTful WebServices
  5. 5. SQL Server Data Services (SSDS) – announced at MIX 08 (March 2008) “SQL Server in the cloud” ADO.NET Data Services - part of .NET Framework 3.5 SP1(July 2008) Not just about Cloud but all about REST Used by Windows Azure Being explored by SQL Data Services Azure Services Platform – announced at PDC 08 (October 2008) Windows Azure “O.S. for the Cloud” SQL Services + more
  6. 6. It is an operating system for the cloud It is designed for utility computing It provides facilities to: Write your apps (developer experience) Host your apps (compute) Manage your apps (service management) Store your data (storage)
  7. 7. Pre-requisites Vista or Server 2008 Visual Studio 2008 SP1 or VS Web Express Version SQL Express 2005 or 2008 (if you already have a full version of SQL Server running, you must install Express as a new instance) .NET 3.5 SP1 IIS 7 with ASP.NET and WCF HTTP activation enabled http://www.programmerfish.com/how-to-create-and-deploy-a-simple-hello- world-application-on-windows-azure
  8. 8. Install the SDK Samples Development Fabric Install the Visual Studio 2008 plug-in Project Templates Run as Admin Optional Get an account www.azure.com Enroll, wait, get invite(token), start deploying
  9. 9. Many is better than one Loose coupling Simple stores scale
  10. 10. Big, reliable, expensive machine
  11. 11. Tech Preview offers one type of VM Platform: 64-bit Windows Server 2008 CPU: 1.5-1.7 GHz x64 equivalent Memory: 1.7 GB Network: 100 Mbps Transient local storage: 250 GB
  12. 12. A A A B B C D E E E E F G G G G G H I J K L M N O O O P Q R S T U Q Q Q
  13. 13. A B D C
  14. 14. Unused Buy more of capacity everything Rearchitect Database to scale out Load Buy bigger SQL Box Servers Add some Web Servers
  15. 15. Default.aspx (Take Order + Process LB Order)
  16. 16. 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! ... } }
  17. 17. Default.aspx Worker.cs LB (Take Order) (Process Order) Windows Azure Queues
  18. 18. 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(quot;OrderQueuequot;); orderQ.PutMessage(new Message(order)); } }
  19. 19. public class WorkerRole : RoleEntryPoint { public override void Start() { QueueStorage qStore = QueueStorage.Create(_account); MessageQueue orderQ = qStore.GetQueue(quot;OrderQueuequot;); while (true) { Message msg = orderQ.GetMessage(); if( msg != null) ProcessOrder(msg.ContentAsString()); } } protected void ProcessOrder(string order) { //Make some coffee! ... }
  20. 20. {Revisit, Instances and Workers}
  21. 21. 3 2
  22. 22. Web Site Web Site Web Role (ASPX, ASMX, (ASPX, ASMX, WCF) (ASPX, WCF) WCF) SQL Data Services L B Worker Worker Service Role Internet Your Service Queue L B Blobs Tables Storage Windows Azure Datacenter
  23. 23. Azure Storage SQL Data Services Vision Access Relational? (today) Relational? (tomorrow) Analogy
  24. 24. Azure Storage SQL Data Services Vision Highly scalable, highly available store in the Cloud Access Uses ADO.NET Data Services - REST Relational? (today) No Relational? No (tomorrow) Analogy
  25. 25. Azure Storage SQL Data Services Vision Highly scalable, Highly scalable, highly available highly available store in the Cloud relational store in the Cloud Access Uses ADO.NET SqlClient + TSQL (Use Azure Web Role + ADO.NET Data Services - Data Services if REST is required) REST Yes – but with some Relational? (today) No limitations Yes – with less and Relational? No (tomorrow) less limitations Analogy
  26. 26. Azure Storage SQL Data Services Vision Highly scalable, Highly scalable, highly available highly available store in the Cloud relational store in the Cloud Access Uses ADO.NET SqlClient + TSQL (Use Azure Web Role + ADO.NET Data Services - Data Services if REST is required) REST Yes – but with some Relational? (today) No limitations Yes – with less and Relational? No (tomorrow) less limitations RDBMS – as it is  Analogy File System
  27. 27. Web Site Web Site Web Role (ASPX, ASMX, (ASPX, ASMX, WCF) (ASPX, WCF) WCF) SQL Data Services L Easy B Worker Worker Service Role Internet Your Service Queue L Trickier B Blobs Tables Storage Windows Azure Datacenter
  28. 28. Storage that is Durable, Scalable, Highly Available, Secure, Performant Rich Data Abstractions Service communication: queues, locks, … Large user data items: blobs, blocks, … Service state: tables, caches, … Simple and Familiar Programming Interfaces REST Accessible and ADO.NET
  29. 29. Blobs Container http://<account>.blob.core.windows.net/<container> Table Entities Account http://<account>.table.core.windows.net/<table> Queue Messages http://<account>.queue.core.windows.net/<queue>
  30. 30. Massively Scalable Tables Billions of entities (rows) and TBs of data Automatically scales to thousands of servers as traffic grows Highly Available Can always access your data Durable Data is replicated at least 3 times
  31. 31. What tables don’t do What tables can do   Not relational Cheap  No Referential Integrity  Very Scalable  If theseNo Joins  Flexible are  importantData  Limitedto you, Queries Durable use SQL   ServicesGroup by Store LOTS of stuff  No  No Aggregations  No Transactions  No Transactions
  32. 32. Data stored in Tables A Table is a set of Entities (rows) An Entity is a set of Properties (columns) Entity has: PartitionKey – enables scalability RowKey – unique id within the partition the only indexed property Timestamp – for optimistic concurrency 255 properties total Max size of 1MB
  33. 33. ….. Partition Key Row Key Property 3 Property N Document Version Modification Description Name Time ….. Examples Doc V1.0 8/2/2007 Committed version Partition Alice’s working version Examples Doc V2.0.1 9/28/2007 1 FAQ Doc V1.0 5/2/2007 Committed version Alice’s working version Partition FAQ Doc V1.0.1 7/6/2007 2 Sally’s working version FAQ Doc V1.0.2 8/1/2007  
  34. 34. Vessel Position Reporting System – SQL Server VesselId 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 10:15 14 Nov 01.23 51.23 10 To find last pos report for vessel in SQL: select TOP(1) * from PosRpts order by [Time] DESC where VesselId = ???
  35. 35. Solving this the Azure way PartitionKey VesselId 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 10:15 14 Nov 01.23 51.23 10 PartitionKey
  36. 36. Stored in-order: RowKey needs to Just need to do a be a string top on the partition PartitionKey xxx-xx1 RowKey Latitude Longitude Speed 10:15 14 Nov 01.23 53.24 0 2521756430999999999 10:05 14 Nov 04.45 54.32 5 2521756436999999999 Makes it 14 Nov 09:55 02.32 52.34 4 2521756442999999999 descending (DateTime.MaxValue – time).Ticks.ToString () time.Ticks.ToString ()
  37. 37. ADO.NET Data Services REST Interface Client .NET Framework 3.5 SP1 Use any HTTP stack Data represented Data represented in Atom as .NET objects (XML) DataServiceContext HTTP verbs for updates methods for updates LINQ to define queries URLs to define queries
  38. 38. Example using ADO.NET Data Services Table Entities are represented as Class Objects [DataServiceKey(quot;PartitionKeyquot;, quot;RowKeyquot;)] public class Customer { // Partition key – Customer Last name public string PartitionKey { get; set; } // Row Key – Customer First name public string RowKey { get; set; } // User defined properties here public DateTime CustomerSince { get; set; } public double Rating { get; set; } public string Occupation { get; set; } }
  39. 39. Every Account has a master table called “Tables” It is used to keep track of the tables in your account To use a table it has to be inserted into “Tables” [DataServiceKey(quot;TableNamequot;)] public class TableStorageTable { public string TableName { get; set; } } // serviceUri is ‚http://<Account>.table.core.windows.net/‛ DataServiceContext context = new DataServiceContext(serviceUri); TableStorageTable table = new TableStorageTable(quot;Customersquot;); context.AddObject(quot;Tablesquot;, table); DataServiceResponse response = context.SaveChanges();
  40. 40. Create a new Customer and Insert into Table Customer cust = new Customer( ‚Lee‛, // Partition Key = Last Name ‚Geddy‛, // Row Key = First Name DateTime.UtcNow, // Customer Since 2.0, // Rating ‚Engineer‛ // Occupation); // Service Uri is ‚http://<Account>.table.core.windows.net/‛ DataServiceContext context = new DataServiceContext(serviceUri); context.AddObject(‚Customers‛, cust); DataServiceResponse response = context.SaveChanges();
  41. 41. LINQ // Service Uri is ‚http://<Account>.table.core.windows.net/‛ DataServiceContext context = new DataServiceContext(serviceUri); var customers = from o in context.CreateQuery<Customer>(‚Customers‛) where o.PartitionKey == ‚Lee‛ select o; foreach (Customer customer in customers) { }  GET http://<Account>.table.core.windows.net/Customers? $filter= PartitionKey eq ‘Lee’
  42. 42. Customer cust = ( from c in context.CreateQuery<Customer> (‚Customers‛) where c.PartitionKey == ‚Lee‛ // Partition Key = Last Name && c.RowKey == ‚Geddy‛ // Row Key = First Name select c) .FirstOrDefault(); cust.Occupation = ‚Musician‛; context.UpdateObject(cust); DataServiceResponse response = context.SaveChanges(); context.DeleteObject(cust); DataServiceResponse response = context.SaveChanges();
  43. 43. Account Container Blob Block IMG001. JPG pictures IMG002. JPG Account Block 1 movies MOV1.AVI Block 2 Block 3
  44. 44. Uploading a large blob blobName = “TheBlob.wmv”; 10 GB Movie PutBlock(blobName, blockId1, block1Bits); Block Id 2 Block Id N Block Id 1 Block Id 3 PutBlock(blobName, blockId2, block2Bits); ………… PutBlock(blobName, blockIdN, blockNBits); PutBlockList(blobName, blockId1,…,blockIdN); TheBlob.wmv Windows Azure Storage
  45. 45. Applications are no longer restricted to run in medium trust P/Invoke any native binary Use more of the .NET stack, e.g. more of WCF We support FastCGI, so you can Add native handlers for languages to your app Use the fastCGI path from IIS to run your app e.g. PHP
  46. 46. Your “cloud project” consists of applications: 0 or more compute services 0 or more storage accounts Windows Azure is in multiple “locales” You can: Choose a locale for any of your applications Create an “affinity group” to co-locate a set of applications from your cloud project Available thru developer portal in April
  47. 47. Developer CTP for Enable Full trust & Fast CGI Geo-location support Services SDKs, and SDS Public CTP Windows Azure .NET Services Open CTP Tools .NET Services Live Framework Open CTP SQL Services SDS Invitation-only CTP
  48. 48. Many is better than one Let Microsoft worry about this Loose coupling Web Role and Worker Role Simple stores scale Table, Blob, Queue
  49. 49. 2009 • Play with Windows Azure – http://www.azure.com • Invest time in ADO.NET Data Services (3.5 SP1) • Invest time in LINQ • Understand REST – good and bad practices “Learn” • Watch the MIX 09 recordings http://live.visitmix.com 2010 • Live applications running on Windows Azure • (There already are e.g. http://www.aws.net/services/cloud-services/case- “Do” study )
  50. 50. www.azure.com http://geekswithblogs.net/IUpdateable
  51. 51. © 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.
  52. 52. ServiceDefinition.csdef <ServiceDefinition name=quot;DemoServicequot;> <WebRole name=quot;WebRolequot;> <ConfigurationSettings> <Setting name=quot;Colorquot;/> </ConfigurationSettings> </WebRole> </ServiceDefinition> ServiceConfiguration.cscfg <ServiceConfiguration serviceName=quot;DemoServicequot;> <Role name=quot;WebRolequot;> <ConfigurationSettings> <Setting name =quot;Colorquot; value =quot;Redquot;/> </ConfigurationSettings> </Role> </ServiceConfiguration>
  53. 53. <?xml version=quot;1.0quot;?> <ServiceConfiguration serviceName=‚DemoService‛> <Role name=quot;WebRolequot;> <Instances count=quot;1quot;/> <ConfigurationSettings> <Setting name =quot;LogLevelquot; value =quot;Verbosequot;/> </ConfigurationSettings> </Role> </ServiceConfiguration> ... if (RoleManager.GetConfigurationSetting(quot;LogLevelquot;) == quot;Verbosequot;) RoleManager.WriteToLog(quot;Informationquot;, quot;Some log messagequot;);
  54. 54. Default .NET HTTP connections is set to 2 ServicePointManager.DefaultConnectionLimit = X; Turn off 100-continue (saves one round trip) ServicePointManager.Expect100Continue = false; Turn tracking off for query results that are not going to be modified MergeOption = MergeOption.NoTracking To improve performance of ADO.NET de-serialization Name the entity class the same as the table name, or Use DataServiceContext.ResolveType to return the type of the entity
  55. 55. Be prepared for partial results from your queries Check for the continuation token Storing different types of entities in same table Have part of the RowKey represent the kind type In a single query can retrieve all of the related objects of different kinds When entity group transactions are supported Can perform transactions across different typed entities in same partition
  56. 56. SaaS = Software as a Service Aka “On Demand” vs “On Premise” software Many customers hate “On Premise” hassle Independent Software Vendors (ISVs) explored SalesForce.com championed this model – “No Software” Single tenant vs Multi tenant etc S+S = Software + Services Microsoft marketing department documenting reality Powerful client software working with powerful cloud based services Think Xbox Live, Itunes, Skype, Messenger
  57. 57. listAllUsers() vs http://mysite.com/users/ ? addUser() vs POST http://mysite.com/users/ deleteUser() vs DELETE http://mysite.com/users/eric updateUser() vs PUT http://mysite.com/users/eric listUserComputers() vs http http://mysite.com/users/eric/computers/ users HTTP Request eric URL VERB bill GET Payload POST sarah PUT tim XML DELETE JSON HTTP Response Status Payload XML JSON
  1. Gostou de algum slide específico?

    Recortar slides é uma maneira fácil de colecionar informações para acessar mais tarde.

×