Presentation is loading. Please wait.

Presentation is loading. Please wait.

 Brad Calder Director/Architect Microsoft Corporation ES04.

Similar presentations


Presentation on theme: " Brad Calder Director/Architect Microsoft Corporation ES04."— Presentation transcript:

1  Brad Calder Director/Architect Microsoft Corporation ES04

2

3

4

5 Account Blob Table Queue

6

7 BlobContainerAccount sally pictures IMG001.JPG IMG002.JPG movies MOV1.AVI

8 BlobContainerAccount sally pictures IMG001.JPG IMG002.JPG movies MOV1.AVI

9 BlobContainerAccount sally pictures IMG001.JPG IMG002.JPG movies MOV1.AVI

10

11

12 10 GB Movie Windows Azure Storage Block Id 1 Block Id 2 Block Id 3 Block Id N blobName = “TheBlob.wmv”; PutBlock(blobName, blockId1, block1Bits); PutBlock(blobName, blockId2, block2Bits); ………… PutBlock(blobName, blockIdN, blockNBits); PutBlockList(blobName, blockId1,…,blockIdN); blobName = “TheBlob.wmv”; PutBlock(blobName, blockId1, block1Bits); PutBlock(blobName, blockId2, block2Bits); ………… PutBlock(blobName, blockIdN, blockNBits); PutBlockList(blobName, blockId1,…,blockIdN); TheBlob.wmv Benefit: Efficient continuation and retry Parallel and out of order upload of blocks

13 Block Id 1Block Id 3Block Id 2 BlobName = ExampleBlob.wmv Block Id 4 Block Id 2Block Id 3 Block Id 4 Committed and readable version of blob Example Uploading Blocks Out of Order Same Block IDs Unused Blocks

14 BlockBlobContainerAccount sally pictures IMG001. JPG IMG002. JPG movies MOV1.AVI Block 1 Block 2 Block 3

15

16

17 PUT http://dvd.blob.core.windows.net/movies/TheBlob.wmv ?comp=block &blockid=BlockId1 &timeout=60 HTTP/1.1 Content-Length: 4194304 Content-MD5: HUXZLQLMuI/KZ5KDcJPcOA== Authorization: SharedKey dvd: F5a+dUDvef+PfMb4T8Rc2jHcwfK58KecSZY+l2naIao= x-ms-date: Mon, 27 Oct 2008 17:00:25 GMT ……… Block Data Contents ……… AccountContainer Blob Name

18 PUT http://dvd.blob.core.windows.net/movies/TheBlob.wmv ?comp=blocklist &timeout=120 HTTP/1.1 Content-Length: 161213 Authorization: SharedKey dvd: QrmowAF72IsFEs0GaNCtRU143JpkflIgRTcOdKZaYxw= x-ms-date: Mon, 27 Oct 2008 17:00:25 GMT BlockId1 BlockId2 ……………… AccountContainer Blob Name

19 GET http://dvd.blob.core.windows.net/movies/TheBlob.wmv HTTP/1.1 Authorization: SharedKey dvd: RGllHMtzKMi4y/nedSk5Vn74IU6/fRMwiPsL+uYSDjY= X-ms-date: Mon, 27 Oct 2008 17:00:25 GMT Get whole blob GET http://dvd.blob.core.windows.net/movies/TheBlob.wmv ?timeout=60 HTTP/1.1 Range: bytes=1024000-2048000 Get a range of the blob

20 Container “movies” has: Action/Rocky.avi Action/Rocky2.avi Drama/Crime/GodFather.avi Drama/Crime/GodFather2.avi Drama/LordOfRings.avi Thriller/TheBlob.wmv List top level “directories” REST Request: GET http://dvd.blob.windows.net/movies ?comp=list &delimiter=/ Results: Action Drama Horror Container “movies” has: Action/Rocky1.wmv Action/Rocky2.wmv Action/Rocky3.wmv Action/Rocky4.wmv Action/Rocky5.wmv Drama/Crime/GodFather1.wmv Drama/Crime/GodFather2.wmv Drama/Memento.wmv Horror/TheBlob.wmv

21 Container “movies” has: Action/Rocky1.avi Action/Rocky2.avi ……… Action/Rocky5.avi Drama/Crime/GodFather1.avi Drama/Crime/GodFather2.avi Drama/Gladiator.avi Horror/TheBlob.wmv List directory “Drama”: REST Request: GET http://dvd.blob.windows.net/movies ?comp=list &prefix=Drama/ &delimiter=/ Results: Drama/Crime Drama/Memento.wmv Container “movies” has: Action/Rocky1.wmv Action/Rocky2.wmv Action/Rocky3.wmv Action/Rocky4.wmv Action/Rocky5.wmv Drama/Crime/GodFather1.wmv Drama/Crime/GodFather2.wmv Drama/Memento.wmv Horror/TheBlob.wmv

22 Container “movies” has: Action/Rocky1.wmv Action/Rocky2.wmv Action/Rocky3.wmv Action/Rocky4.wmv Action/Rocky5.wmv Drama/Crime/GodFather1.wmv Drama/Crime/GodFather2.wmv Drama/Memento.wmv Horror/TheBlob.wmv Max Results and Next Marker REST Request: GET http://dvd.blob.windows.net/movies ?comp=list &prefix=Action &maxresults=3 Results: Action/Rocky1.wmv Action/Rocky2.wmv Action/Rocky3.wmv OpaqueMarker1

23 Using Continuation Marker REST Request: GET http://dvd.blob.windows.net/movies ?comp=list &prefix=Action &maxresults=3 &marker=OpaqueMarker1 Results: Action/Rocky4.wmv Action/Rocky5.wmv Container “movies” has: Action/Rocky1.wmv Action/Rocky2.wmv Action/Rocky3.wmv Action/Rocky4.wmv Action/Rocky5.wmv Drama/Crime/GodFather1.wmv Drama/Crime/GodFather2.wmv Drama/Memento.wmv Horror/TheBlob.wmv

24

25

26

27

28

29

30 Partition Key Document Name Row Key Version Property 3 Modification Time …..Property N Description Examples DocV1.08/2/2007…..Committed version Examples DocV2.0.19/28/2007Alice’s working version FAQ DocV1.05/2/2007Committed version FAQ DocV1.0.17/6/2007Alice’s working version FAQ DocV1.0.28/1/2007Sally’s working version Partition 1 Partition 2

31

32 Partition Key Document Name Row Key Version Property 3 Modification Time …..Property N Description Examples DocV1.08/2/2007…..Committed version Examples DocV2.0.19/28/2007Alice’s working version FAQ DocV1.05/2/2007Committed version FAQ DocV1.0.17/6/2007Alice’s working version FAQ DocV1.0.28/1/2007Sally’s working version Partition 1 Partition 2

33

34 Partition Key Document Name Row Key Version Property 3 Modification Time …..Property N Description Examples DocV1.08/2/2007…..Committed version Examples DocV2.0.19/28/2007Alice’s working version FAQ DocV1.05/2/2007Committed version FAQ DocV1.0.17/6/2007Alice’s working version FAQ DocV1.0.28/1/2007Sally’s working version Partition 1 Partition 2

35

36 Partition Key Document Name Row Key Version Property 3 Modification Time …..Property N Description Examples DocV1.08/2/2007…..Committed version Examples DocV2.0.19/28/2007Alice’s working version FAQ DocV1.05/2/2007Committed version FAQ DocV1.0.17/6/2007Alice’s working version FAQ DocV1.0.28/1/2007Sally’s working version Partition 1 Partition 2

37

38

39

40 [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 DateTime CustomerSince { get; set; } public double Rating { get; set; } public string Occupation { get; set; } }

41 [DataServiceKey("TableName")] public class TableStorageTable { public string TableName { get; set; } } TableStorageTable table = new TableStorageTable("Customers"); context.AddObject("Tables", table); DataServiceResponse response = context.SaveChanges(); // serviceUri is “http://.table.core.windows.net/” DataServiceContext context = new DataServiceContext(serviceUri);

42 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://.table.core.windows.net/” DataServiceContext context = new DataServiceContext(serviceUri);

43 DataServiceContext context = new DataServiceContext(“http://myaccount.table.core.windows.net”); var customers = from o in context.CreateQuery (“Customers”) where o.PartitionKey == “Lee” select o; foreach (Customer customer in customers) { } GET http://myaccount.table.core.windows.net/Customers? $filter= PartitionKey eq ‘Lee’

44 context.DeleteObject(cust); DataServiceResponse response = context.SaveChanges(); cust.Occupation = “Musician”; context.UpdateObject(cust); DataServiceResponse response = context.SaveChanges(); Customer cust = ( from c in context.CreateQuery (“Customers”) where c.PartitionKey == “Lee” // Partition Key = Last Name && c.RowKey == “Geddy” // Row Key = First Name select c).FirstOrDefault();

45

46

47

48 Cloud Storage (blob, table, queue) Web Role LB n Worker Role m

49

50

51

52 2 2 1 1 C1C1 C1C1 C2C2 C2C2 1 1 2 2 3 3 4 4 Producers Consumers P2P2 P2P2 P1P1 P1P1 3 3 2. Dequeue(Q, 30 sec)  msg 2 1. Dequeue(Q, 30 sec)  msg 1 1 1 2 2

53 C1C1 C 1 C2C2 C2C2 3 4 4 Producers Consumers P2P2 P2P2 P1P1 P1P1 1 1 2 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 1. Dequeue(Q, 30 sec)  msg 1 5. C 1 crashed 1 1 2 2 1 1 6. msg1 visible 30 seconds after Dequeue Benefit: Insures that every message can be processed at least once 3 3

54

55

56

57

58

59 Account Container Blobs Table Entities Queue Messages http://.blob.core.windows.net/ http://.table.core.windows.net/ http://.queue.core.windows.net/

60

61 Please fill out your evaluation for this session at: This session will be available as a recording at: www.microsoftpdc.com

62

63 © 2008 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.

64


Download ppt " Brad Calder Director/Architect Microsoft Corporation ES04."

Similar presentations


Ads by Google