Windows Azure and a little SQL Data Services

  • 1,516 views
Uploaded on

User group talk on storing data in the cloud. Main focus is on Table storage in Windows Azure but with reference to SQL Data Services.

User group talk on storing data in the cloud. Main focus is on Table storage in Windows Azure but with reference to SQL Data Services.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,516
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
50
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • 06/08/09 08:47 © 2007 Microsoft Corporation. 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.

Transcript

  • 1. Eric Nelson Developer & Platform Group Microsoft Ltd [email_address] http://geekswithblogs.net/IUpdateable http://twitter.com/ericnel
  • 2.
    • Cloud
      • 101
      • Microsoft and Cloud
      • Azure Services Platform
    • Storage in the Cloud
      • Windows Azure Storage + SQL Data Services
    • Windows Azure
      • Overview
      • Focus on storage
    • SQL Data Services
      • Futures
  • 3. It is not that hard
  • 4.  
  • 5.
    • 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
        • SalesForce.com really do this...
    • Cloud Computing
      • Run/Store stuff in the cloud -
        • Somebody else has the data center
      • Amazon.com key role in Cloud Computing
        • Amazon S3 (Simple Storage Service) – objects
        • Amazon EC2 (Elastic Compute Cloud) – virtual machines
    • WebServices and RESTful WebServices
  • 6. 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 eric bill sarah tim HTTP Request URL VERB Payload HTTP Response Status GET POST PUT DELETE XML JSON Payload XML JSON
  • 7.
    • 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
  • 8.  
  • 9.
    • Azure Services Platform – marketing name 
      • Brings together many products from many teams
    • Windows Azure – Operating System
      • Compute
      • Storage
    • SQL Services
      • SQL Data Services (SDS)
        • Formally SSDS
      • SQL Labs – more on that later
    • .NET Services – Enterprise focus
      • Access Control
      • Service Bus
      • Workflow Service
    • Live Services – Consumer focus
      • Live Mesh,...
  • 10.  
  • 11.
    • Azure Services Platform – marketing name 
      • Brings together many products from many teams
    • Windows Azure – Operating System
      • Compute
      • Storage
    • SQL Services
      • SQL Data Services (SDS)
        • Formally SSDS
      • SQL Labs – more on that later
    • .NET Services – Enterprise focus
      • Access Control
      • Service Bus
      • Workflow Service
    • Live Services – Consumer focus
      • Live Mesh,...
    2 3
  • 12. Azure Storage SDS Vision Access Relational? (today) Relational? (tomorrow) Analogy
  • 13. Azure Storage SDS Vision Highly scalable, highly available store in the Cloud Access Uses ADO.NET Data Services - REST Relational? (today) No Relational? (tomorrow) No Analogy
  • 14. Azure Storage SDS Vision Highly scalable, highly available store in the Cloud Highly scalable, highly available relational store in the Cloud Access Uses ADO.NET Data Services - REST Uses custom WCF – REST or SOAP Relational? (today) No Yes – but with many limitations Relational? (tomorrow) No Yes – with less limitations Analogy
  • 15. Azure Storage SDS Vision Highly scalable, highly available store in the Cloud Highly scalable, highly available relational store in the Cloud Access Uses ADO.NET Data Services - REST Uses custom WCF – REST or SOAP Relational? (today) No Yes – but with many limitations Relational? (tomorrow) No Yes – with less limitations Analogy File System RDBMS
  • 16.
    • MIX 09 in March is our next major conference
      • Expect announcements
      • Windows Azure will go live in 2009?
    • Will continue to have two storage solutions
      • Similar to why we have file system and databases
  • 17.  
  • 18.
    • 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
  • 19.
    • 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
  • 20.  
  • 21.
    • Many is better than one
    • Loose coupling
    • Simple stores scale
  • 22. Big, reliable, expensive machine
  • 23.  
  • 24. A A A B B C F G G G G G M N O O O P D E E E H I J K Q R S T E L U Q Q Q
  • 25. A B C D
  • 26.  
  • 27. LB
  • 28.
    • 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! ...
    •         }
    •      }
  • 29. Windows Azure Queues LB
  • 30.
    • 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));        
    • }
    •      }
  • 31.
    • 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! ...
    •         }
  • 32.  
  • 33. Azure Storage (blob, table, queue) Web Role LB n Worker Role m SQL Data Services
  • 34.
    • 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
  • 35. http://<account>. blob .core.windows.net/<container> http://<account>. table .core.windows.net/<table> http://<account>. queue .core.windows.net/<queue> Account Container Blobs Table Entities Queue Messages
  • 36.
    • 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
  • 37.
    • Table
      • A Storage Account can create many tables
      • Table name is scoped by Account
    • Data is stored in Tables
      • A Table is a set of Entities (rows)
      • An Entity is a set of Properties (columns)
    • Entity
      • Two “key” properties that together are the unique ID of the entity in the Table
        • PartitionKey – enables scalability
        • RowKey – uniquely identifies the entity within the partition
  • 38. Partition Key Document Name Row Key Version Property 3 Modification Time … .. Property N Description 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 1 Partition 2
  • 39. ADO.NET Data Services Client REST Interface .NET Framework 3.5 SP1 Use any HTTP stack Data represented as .NET objects Data represented in Atom (XML) DataServiceContext methods for updates HTTP verbs for updates LINQ to define queries URLs to define queries
  • 40.
    • Example using ADO.NET Data Services
    • Table Entities are represented as Class Objects
    [ DataServiceKey ( &quot;PartitionKey&quot; , &quot;RowKey&quot; )] 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 ; } }
  • 41.
    • 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;TableName&quot; )] public class TableStorageTable { public string TableName { get ; set ; } } TableStorageTable table = new TableStorageTable ( &quot;Customers&quot; ) ; context.AddObject ( &quot;Tables&quot; , table); DataServiceResponse response = context.SaveChanges(); // serviceUri is “http://<Account>.table.core.windows.net/” DataServiceContext context = new DataServiceContext (serviceUri);
  • 42.
    • 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 ); context.AddObject( “Customers” , cust); DataServiceResponse response = context.SaveChanges(); // Service Uri is “http://<Account>.table.core.windows.net/” DataServiceContext context = new DataServiceContext (serviceUri);
  • 43.
    • 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’
  • 44. 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(); context.DeleteObject(cust); DataServiceResponse response = context.SaveChanges(); cust.Occupation = “Musician” ; context.UpdateObject(cust); DataServiceResponse response = context.SaveChanges();
  • 45. Block Blob Container Account Account pictures IMG001. JPG IMG002. JPG movies MOV1.AVI Block 1 Block 2 Block 3
  • 46.  
  • 47.
    • Many is better than one
      • Let Microsoft worry about this
    • Loose coupling
      • Web Role and Worker Role
    • Simple stores scale
      • Table , Blob , Queue
  • 48.  
  • 49. Language patterned after LINQ syntax from e in container where e.Kind == “FunCar” && e[ “Zip” ] == 98053 && e[ “Model” ] == “Mini Cooper” select e Property Type Value Metadata ID EntityId VWGOLF-01 Kind EntityKind Car FlexProps Description String Reliable, one owner, … Price Numeric 12000.00 ListingDate Datetime 01-01-2008 LocationZip String 98052 Property Type Value Metadata ID EntityId MINICOOPER-264 Kind EntityKind FunCar FlexProps Description String Reliable, one owner, … Price Numeric 12000.00 ListingDate String 1 st January, 2008 LocationZip String 98052 EngineSize Numeric 1600
  • 50.
    • Plenty of good Feedback on the CTP
      • Simple to use
      • Liked the REST interface to data
      • New app developers happy with “semi-relational”
    • BUT also
      • Azure Storage and SDS too similar
      • Azure Storage and SDS too different
      • What about existing apps that rely on relational?
      • I want TSQL please
      • I want full relational please
  • 51.
    • http://www.microsoft.com/azure/sqllabs.mspx
    • ADO.NET Data Services access
      • To SQL Data Services
    • Data Mining in the cloud – try today
      • http://www.sqlserverdatamining.com/cloud/
      • Works against SDS
    • Reporting in the cloud
      • Works against SDS
    • Sync Enabled Cloud Hub
      • Sync to Access, SQL Express, SQL Compact, ...
  • 52.
    • Just a CTP for feedback – we got plenty 
    • My recommendation
      • Do not learn SQL Data Services – just yet!
      • Learn ADO.NET Data Services
      • Stick with Windows Azure Storage for the moment
    • Watch for MIX 09 Announcements
  • 53.  
  • 54.
    • http://geekswithblogs.net/IUpdateable
    • Or
    • http://iupdateable.com
  • 55.  
  • 56.            
  • 57.
    •   <? xml version = &quot; 1.0 &quot; ?>
    • < ServiceConfiguration serviceName = “ DemoService ” >
    •   < Role name = &quot; WebRole &quot; >
    •     < Instances count = &quot; 1 &quot; />
    •     < ConfigurationSettings >
    •       < Setting name = &quot; LogLevel &quot; value = &quot; Verbose &quot; />
    •     </ ConfigurationSettings >
    •   </ Role >
    • </ ServiceConfiguration >
    • ...
                if ( RoleManager .GetConfigurationSetting( &quot;LogLevel&quot; ) == &quot;Verbose&quot; )         RoleManager .WriteToLog( &quot;Information&quot; , &quot;Some log message&quot; );
  • 58.  
  • 59.  
  • 60.  
  • 61.