1 / 64

Windows Azure and SQL Data Services

Windows Azure and SQL Data Services. Eric Nelson Developer & Platform Group Microsoft Ltd eric.nelson@microsoft.com http://geekswithblogs.net/IUpdateable http://twitter.com/ericnel. SQL Data Services. Eric Nelson Developer & Platform Group Microsoft Ltd eric.nelson@microsoft.com

azriel
Download Presentation

Windows Azure and SQL Data Services

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Windows Azure andSQL Data Services Eric Nelson Developer & Platform Group Microsoft Ltd eric.nelson@microsoft.com http://geekswithblogs.net/IUpdateable http://twitter.com/ericnel

  2. SQL Data Services Eric Nelson Developer & Platform Group Microsoft Ltd eric.nelson@microsoft.com http://geekswithblogs.net/IUpdateable http://twitter.com/ericnel

  3. Windows Azure andSQL Data Services Eric Nelson Developer & Platform Group Microsoft Ltd eric.nelson@microsoft.com http://geekswithblogs.net/IUpdateable http://twitter.com/ericnel

  4. Windows Azure and a little SQL Data Services Eric Nelson Developer & Platform Group Microsoft Ltd eric.nelson@microsoft.com http://geekswithblogs.net/IUpdateable http://twitter.com/ericnel

  5. The new plan... • 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

  6. { Simple Walkthough} demo It is not that hard

  7. Cloud?

  8. Cloud Computing 101 • 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 RESTfulWebServices

  9. RESTful 101 listAllUsers() vshttp://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/eric/computers/ users HTTP Request eric URL GET bill VERB POST Payload PUT sarah JSON JSON XML XML DELETE tim HTTP Response Status Payload

  10. 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” • 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

  11. Azure Services Platform Azure™ Services Platform

  12. Azure Services Platform • 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,...

  13. Storage in the Cloud

  14. Azure Services Platform • 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

  15. Windows Azure and SDS

  16. Windows Azure and SDS

  17. Windows Azure and SDS

  18. Windows Azure and SDS

  19. The future of storage in the Cloud • 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

  20. Windows Azure

  21. Getting started 1/2 • 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

  22. Getting started 2/2 • 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

  23. {Walkthough Revisited} demo

  24. Three key design points • Many is better than one • Loose coupling • Simple stores scale

  25. Big, reliable, expensive machine

  26. 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

  27. A B D C

  28. Default.aspx(Take Order + Process Order) LB

  29. Tight coupling : Default.aspx.cs • publicpartialclass_Default : System.Web.UI.Page •     { • protectedvoid Button1_Click(objectsender,EventArgs e) •         { • var order = txtOrder.Text; • ProcessOrder(order); •         } • protectedvoidProcessOrder(string order) •         { • //Make some coffee! ... •         } •      }

  30. Web Role Worker Role LB Default.aspx(Take Order) Worker.cs(Process Order) Windows Azure Queues

  31. Loose coupling : Default.aspx.cs • publicpartialclass_Default : System.Web.UI.Page •     { • protectedvoid Button1_Click(objectsender,EventArgs e) •         { • var order = txtOrder.Text; • QueueStorageqStore = QueueStorage.Create(_account); • MessageQueueorderQ = qStore.GetQueue("OrderQueue"); • orderQ.PutMessage(newMessage(order)); • } •      }

  32. Loose coupling : WorkerRole.cs • public class WorkerRole : RoleEntryPoint •     { • public override void Start() •         { • QueueStorageqStore = QueueStorage.Create(_account); • MessageQueueorderQ = qStore.GetQueue("OrderQueue"); • while (true) •             { • Message msg=orderQ.GetMessage(); • if( msg != null) • ProcessOrder(msg.ContentAsString()); •             } •         } • protected void ProcessOrder(string order) •         { • //Make some coffee! ... •         }

  33. {Instances and Workers} demo

  34. Azure Application = WebRole + Worker Role + Storage n m Worker Role Web Role LB SQL Data Services Azure Storage (blob, table, queue)

  35. Windows Azure Storage • 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

  36. Windows Azure Data Storage Concepts Container Blobs Account • Table Entities http://<account>.blob.core.windows.net/<container> Queue Messages http://<account>.table.core.windows.net/<table> http://<account>.queue.core.windows.net/<queue>

  37. Windows Azure Tables • 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

  38. Table Data Model • 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

  39. Partition Example Partition 1 Partition 2 • Table Partition - all entities in table with same partition key value • Application controls granularity of partition

  40. Programming Model

  41. Example Table Definition • Example using ADO.NET Data Services • Table Entities are represented as Class Objects [DataServiceKey("PartitionKey", "RowKey")] 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 DateTimeCustomerSince { get; set; } public double Rating{ get; set; } public string Occupation { get; set; } }

  42. Create Customers Table • 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("TableName")] public class TableStorageTable { public string TableName { get; set; } } // serviceUri is “http://<Account>.table.core.windows.net/” DataServiceContextcontext = new DataServiceContext(serviceUri); TableStorageTabletable = new TableStorageTable("Customers"); context.AddObject("Tables", table); DataServiceResponseresponse = context.SaveChanges();

  43. Create And Insert Entity • Create a new Customer and Insert into Table • Customer cust =new Customer( • “Lee”, // Partition Key = Last Name • “Geddy”, // Row Key = First NameDateTime.UtcNow, // Customer Since • 2.0, // Rating • “Engineer”// Occupation); // Service Uri is “http://<Account>.table.core.windows.net/” DataServiceContextcontext = new DataServiceContext(serviceUri); context.AddObject(“Customers”, cust); DataServiceResponseresponse = context.SaveChanges();

  44. Query A Table • LINQ // Service Uri is “http://<Account>.table.core.windows.net/” DataServiceContextcontext = new DataServiceContext(serviceUri); varcustomers = from o in context.CreateQuery<Customer>(“Customers”) where o.PartitionKey == “Lee” select o; foreach(Customer customerin customers) { } • REST GET http://<Account>.table.core.windows.net/Customers? $filter= PartitionKeyeq ‘Lee’

More Related