Saranya Sriram Developer Evangelist Microsoft Corporation India
Microsoft s Cloud ReCap Azure Services Platform
Agenda Data is King Motivation? Why data outside your premise? Microsoft s Data Storage offerings Windows Azure SQL Services Programming & Coding for data on cloud OS What we will not learn? Deep Dive into SQL Services Any SQL Services 2008 specifics Architectural considerations to model data in real life
Today s discussion next 60 minutes Windows Azure Storage Services SQL Data
HTTP Blobs Tables Queues Application Windows Azure Storage Service Compute Storage Fabric
Windows Azure Storage Storage that is Durable Scalable (capacity and throughput) Highly Available Security Performance Efficient Pay for what you use 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
Windows Azure Storage Account User creates a globally unique storage account Received a 256 bit secret key when creating account Geo-location & Co-location coming soon Provides security for accessing the store Use secret key to create HMACSHA256 signature for each request Use signature to authenticate request at server Account Blob Table Queue
Blobs Storage Storage Account An account can have many Containers Container A container is a set of blobs Sharing policies are set at the container level Public READ or Private Associate Metadata with Container Metadata is <name, value> pairs Up to 8KB per container List the blobs in a container Account sally Container pictures movies Blob IMG001.JPG IMG002.JPG MOV1.AVI
Slide Share for Tech Ed India 2009 - Basic
Table Storage 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 Account sally Table users photo index Entity
Windows Azure Storage A closer look at tables Table Table Table... Entity Entity Entity... Storage Accounts Property Property Property Name Type Value
Tables - Capabilities What tables don t do Not relational No Referential Integrity No Joins If these are important to you, use: Limited Queries No Group by No Aggregations No Transactions No Transactions What tables can do Cheap Very Scalable Flexible Durable What tables contain Partition key & Row key Timestamp 255 properties for your data & data of size 1MB
Query a Table LINQ DataServiceContext context = new DataServiceContext( http://myaccount.table.core.windows.net ); var customers = from o in context.createquery<customer>( Customer ) where o.partitionkey == Lee select o; foreach (Customer customer in customers) { } GET http://myaccount.table.core.windows.net/customer? $filter= PartitionKey eq Lee
Slide Share for Tech Ed India 2009 - Revisited
Queue Storage An account can create many queues Queue Name is scoped by the account A Queue contains messages No limit on number of messages stored in a queue A message is stored for at most a week in a queue http://<account>.queue.core.windows.net/<queuename> Messages Message size <= 8 KB To store larger data, store data in blob/entity storage, and the blob/entity name in the message
Dequeue and Delete Messages Producers Consumers P 2 C 1 1. Dequeue(Q, 30 sec) msg 1 4 3 2 1 P 1 C 2 2. Dequeue(Q, 30 sec) msg 2
Dequeue and Delete Messages Producers Consumers P 2 1 C 1 1. Dequeue(Q, 30 sec) msg 1 5. C 1 crashed P 1 4 3 2 1 2 C 2 2. Dequeue(Q, 30 sec) msg 2 3. C2 consumed msg 2 4. Delete(Q, msg 2) 7. Dequeue(Q, 30 sec) msg 1 6. msg1 visible 30 seconds after Dequeue
Slide Share for Tech Ed India 2009 - Revisited
Windows Azure Data Storage Concepts Container Blobs http://<account>.blob.core.windows.net/<container> Account Table Entities http://<account>.table.core.windows.net/<table> Queue Messages http://<account>.queue.core.windows.net/<queue>
Slide Share for Tech Ed India 2009 - Upload onto the Azure Storage & take REST
Takeaways Enables developers to access storage Massively scalable, durable, and available Anywhere at anytime access Automatically scale to meet peek traffic demands Only pay for what the service uses Easy to use REST and.net Interfaces Blobs, tables, and queues
SQL Data Services Others (Future) Applications.NET Services SQL Services SQL Services Windows Azure Live Services Applications Windows Server Windows Vista/XP Windows Mobile Others
Service Data Platform: Device to Cloud Protection Caching Analysis Query RDBMS Mining Sync Load Reporting Integration Search Backup Model & policy based development and management Type In Memory Multi Dim Relational BLOB XML File Place
Extending SQL Data Platform to Cloud Reporting Business Intelligence Reference Data Symmetric Programming Model Data Hub Aggregation Initial services core RDBMS capabilities as a service (SDS), Data Sync and Data Hub Future Offerings Additional data platform capabilities as a service: BI/DSS, DW New services: Reference Data, Secure Data Hub Enable new uses of data to deliver differentiated business value
The New SQL Data Services Familiar SQL Server relational model Uses existing APIs & tools Built for the Cloud with availability and scale Accessible to all from PHP, Ruby, and Java Focus on combining the best features of SQL Server running at scale with low friction
Accessing SDS User Database connstringbuilder.initialcatalog = "mydatabase"; // Specify your user database to connect Master/Server Database connstringbuilder.datasource = "myserver.data.dev.mscds.com ; // Specify the DNS name of my SDS server master db) connstringbuilder.userid = "jeff@myserver"; // Specify my user id
SQL Client (ADO.net) code snippet Just change the connection string values: static void Main(string[] args) { SqlConnectionStringBuilder connstringbuilder = new SqlConnectionStringBuilder(); connstringbuilder.datasource = "myserver.data.dev.mscds.com connstringbuilder.initialcatalog = "mydatabase"; connstringbuilder.encrypt = true; connstringbuilder.trustservercertificate = true; connstringbuilder.userid = "jeff@myserver"; connstringbuilder.password = "****"; string createtablesql = @"CREATE TABLE [dbo].[tbl_person] ( [FirstName] NVARCHAR(64) NOT NULL, [LastName] NVARCHAR(64) NOT NULL CONSTRAINT [personname_pk] PRIMARY KEY CLUSTERED ( [FirstName] ASC, [LastName] ASC ) )"; using (SqlConnection conn = new SqlConnection(connStringBuilder.ToString())) { conn.open(); using (SqlCommand cmd = conn.createcommand()) { cmd.commandtext = createtablesql; cmd.commandtype = CommandType.Text; cmd.executenonquery(); conn.close(); } } }
Example of SQL Compatibility In Scope for v1 (likely) Tables, indexes and views Stored Procedures Triggers Constraints Table variables, session temp tables (#t) Out of Scope for v1 (likely) Distributed Transactions Distributed Query CLR Service Broker Spatial Physical server or catalog DDL and views
Takeaways Foundation of the SDS relational platform Built using core SQL Server product codebase Delivery of rich relational database service PDC 09 Key capability of the Azure platform Supports broad spectrum of scenarios
Azure Services Platform Roadmap First CTP Developer CTP for Services SDKs, and Tools Updated CTPs Enable Full trust & Fast CGI Geo-location support.net Services Open CTP Live Framework Open CTP SDS Invitation-only CTP Pricing and SLA confirmation SDS Public CTP Commercial Availability Windows Azure.NET Services SQL Services Fall 2008 Spring 2009 Summer 2009 Fall 2009
Getting Started & Resources 1. Download the SDKs and tools from http://www.microsoft.com/azure 2. Get invitation for Windows Azure and start coding 3. Review the hands-on labs and videos available on the site 3. SSDS blog: http://blogs.msdn.com/ssds 4. Azure Services Training Kit Downloadable hands-on labs, demos, and presentations http://www.azure.com 5. Check Mix09 and PDC 08 sessions
Related Content Breakout Sessions (session codes and titles) 1. Cloud Track Introduction to cloud computing and Windows Azure 2. Cloud Track.NET services 3. Cloud Track - Code Camp
2009 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.