storage in the windows azure platform - ericnel

37
Windows Azure Platfor Windows Azure Platfor Storing data in the cloud Eric Nelson Microsoft UK Email: [email protected] Blog: http://geekswithblogs.net/iupdateable Twitter: http://twitter.com/ericnel and http://twitter.com/ukmsdn Podcast: http://bit.ly/msdnpodcast Newsletter: http://msdn.microsoft.com/en-gb/flash

Upload: ukdpe

Post on 10-May-2015

1.979 views

Category:

Technology


2 download

DESCRIPTION

Windows Azure Storage and SQL Azure. Delivered at UK Azure Net meeting 6th of Oct 2009

TRANSCRIPT

Page 1: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformWindows Azure Platform

Storing data in the cloud

Eric NelsonMicrosoft UK

Email: [email protected] Blog: http://geekswithblogs.net/iupdateableTwitter: http://twitter.com/ericnel and http://twitter.com/ukmsdnPodcast: http://bit.ly/msdnpodcast Newsletter: http://msdn.microsoft.com/en-gb/flash

Page 2: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

2

Windows Azure Platform

• Storage in the Cloud• Queues

• Blobs

• Tables• Relational

Agenda

Page 3: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

Page 4: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

STORAGE IN THE CLOUD…

Windows Azure Storage and SQL Azure

Page 5: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformSolve using the Cloud aka Windows Azure Platform

Web Role

AzureStorag

e

Browser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

Worker Role

Worker RoleN

L B

p1 p2 p3

You don’t see this bit

You don’t see this bit

You don’t see this bit

Worker Role

or…Maybe you do

Page 6: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformSolve using the Cloud aka Windows Azure Platform

Web Role

AzureStorag

e

Browser

Browser

Browser

Browser

Browser

Web Role

Web Role

N L B

Worker Role

Worker RoleN

L B

p1 p2 p3

You don’t see this bit

You don’t see this bit

You don’t see this bit

Worker Role

Ok, you

definitely do

SQLAzure

Page 7: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

3 Important Services• Windows Azure– Compute and

Storage• SQL Azure– Storage

• .NET Services– Connecting

3 Critical Concepts• Computation– Web and Worker

• Storage– Table, Blob,

Relational• Messaging– Queues, Service Bus

Page 8: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

BLOBS, TABLES, RELATIONAL

Page 9: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

QUEUES

Page 10: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

BLOBS, TABLES, RELATIONAL

Page 11: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

BLOBS, TABLES, RELATIONAL

Page 12: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

12

Windows Azure Platform

Provides structured storage• Massively scalable tables (TBs of data)• Self scaling• Highly available• Durable

Familiar and easy-to-use API, layered• .NET classes and LINQ• ADO.NET Data Services – .NET 3.5 SP1• REST – with any platform or language

Introduction to Tables

Page 13: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

13

Windows Azure Platform

No join No group by No order by “No Schema”

Not a Relational Database

Page 14: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

14

Windows Azure Platform

Table• A Table is a set of Entities (rows)• An Entity is a set of Properties (columns)

Entity• Two “key” properties form unique ID• PartitionKey – enables scale• RowKey – uniquely ID within a partition

Data Model

Page 15: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

15

Windows Azure Platform

Getting all of dunnry’s blog posts is fast• Single partition

Getting all posts after 2008-03-27 is slow• Traverse all partitions

Key Example – Blog PostsPartition Key

AuthorRow Key

PermalinkProperty 3ChangedOn

Property 4Title

smarx i-love-tables 2009-07-04 I Love Tables!

smarx tables-are-awesome 2009-07-12 Tables are

Awesome!

dunnry cheetos 2008-03-27 I Love Cheetos

dunnry blogging-again 2009-07-15 Finally Blogging

Again

dunnry phluffyfotos 2008-04-09 PhluffyFotos!

Partition 1

Partition 2

Page 16: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformQuery a Table

Worker Role

AzureTable

Storage

http://account.table.core.windows.net

REST: GET http://account.table.core.windows.net/Customer?$filter=%20PartitionKey%20eq%20value LINQ:var customers = from o in context.CreateQuery<customer>(“Customer”) where o.PartitionKey == value select o;

Page 17: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

DEMO: WINDOWS AZURE STORAGE

Page 18: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

18

Windows Azure Platform

Different Entity types in the same table E.g. PK = CustomerId

• Customer, Order and OrderDetails in the same table

Lessons LearnedAzure Storage – Entity Group Transactions

PK RK

Cust1 Cust1 Name=“MSFT” Desc=“...”

Cust1 Order1 Date=“25/12/09”

Cust1 OrdeDetail1 Product=12 Quantity=6

Cust1 OrderDetail2 Product=13 Quantity=1

Cust2 Cust2 Name=“IBM” Desc=“...”

Page 19: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

BLOBS, TABLES, RELATIONAL

Page 20: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

SQL Azure (July 2009)aka SQL Data Services

aka SQL Server Data Services

Page 21: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformOn Premise Programming Model

SQL Server

Client RDBMS

TDSData

This is what we do on-premise...

Page 22: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformSame for the cloud?

SQL Server

Client RDBMS

TDSData

So, is this is what we would like to do in the cloud...

Page 23: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformSQL Azure can do this

SQL Azure

Client RDBMS

TDSData

Page 24: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformSQL Azure can also do this

SQL Azure

Browser RDBMS

TDSWeb Role

HTTP

Page 25: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformAnd this!

SQL Azure

Browser RDBMS

TDS

Web RoleHTTP

Worker Role

Queue

Page 26: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformWhich means you can easily migrate from this

Browser RDBMS

Web TierHTTP

Bus. Logic

“The Data Center”

SQL Server

TDS

Page 27: Storage in the Windows Azure Platform - ericnel

Windows Azure PlatformTo this… Windows Azure and SQL Azure

SQL Azure

Browser RDBMS

TDS

Web RoleHTTP

Worker Role

Queue

“The Cloud”

Page 28: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

DEMO: SQL AZURE

Page 29: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

29

Windows Azure Platform

From the database “down” it’s just SQL Server• Well, almost …• Many tools don’t work today

• System catalog is different

Above the database is taken care of for you• You can’t really change anything

Lessons LearnedSQL Azure

Page 30: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

30

Windows Azure Platform

Tooling• SSMS partially works – “good enough”• Can not create connection using Visual Studio designer• Other tools may work better• No BCP (currently)

DDL• Must be a clustered index on every table• No physical file placement• No indexed views• No “not for replication” constraint allowed• No Extended properties• Some index options missing (e.g. allow_row_locks, sort_in_tempdb ..)• No set ansi_nulls on

Lessons LearnedSQL Azure

Page 31: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

31

Windows Azure Platform

Types• No spatial or hierarchy id• No Text/images support.

• Use nvarchar(max)• XML datatype and schema allowed but no XML index or schema

collection.

Security• No integrated security

Lessons LearnedSQL Azure

Page 32: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

32

Windows Azure Platform

Development• No CLR• Local temp tables are allowed • Global temp tables are not allowed• Cannot alter database inside a connection• No UDDT’s• No ROWGUIDCOL column property

Lessons LearnedSQL Azure

Page 33: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

33

Windows Azure Platform

SQL Server is very familiar• SQL Azure *is* SQL Server in the cloud

Windows Azure Storage is…very different Make the right choice

• Understand Azure storage• Understand SQL Azure• Understand they are totally different

You can use both

Lessons LearnedSQL Azure vs Windows Azure Tables

Page 34: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

34

Windows Azure Platform

SQL Azure is not always the best storage option SQL Azure costs more

• Delivers a *lot* more functionality

SQL Azure is more limited on scale

Lessons Learned SQL Azure vs Windows Azure Tables

Page 35: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

35

Windows Azure Platform

Can be done• Many 10GB databases

Not fun

Lessons Learned SQL Azure and Sharding

Page 36: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

IN SUMMARY

Page 37: Storage in the Windows Azure Platform - ericnel

Windows Azure Platform

Resources

• Slides, links and more– http://geekswithblogs.net/iupdateable– Azure Training Kit (August update)

• www.azure.com– Sign up, links to resources etc

• http://www.cerebrata.com