Come hear about the highly available and massively scalable cloud storage service that is provided by Windows Azure. Learn how to create and access the different types of Windows Azure storage available, including blobs, tables, and queues.
15. blobName = “TheBlob.wmv”;
10 GB Movie
PutBlock(blobName, blockId1, block1Bits);
Block Id 2
Block Id N
Block Id 1
Block Id 3
PutBlock(blobName, blockId2, block2Bits);
…………
PutBlock(blobName, blockIdN, blockNBits);
PutBlockList(blobName,
blockId1,…,blockIdN);
TheBlob.wmv Windows Azure
Storage
16. BlobName =
ExampleBlob.wmv Block Id 4
Block Id 4
Block Id 2
Block Id 1
Block Id 3
Sequence of Operations
PutBlock BlockId1
PutBlock BlockId3
PutBlock BlockId4
PutBlock BlockId2
PutBlock BlockId4
Block Id 2
Block Id 3
Block Id 4
PutBlockList BlockId2,
BlockId3, BlockId4
Committed and readable version of blob
21. Blobs
Tables – Provide structured storage.
A table is a set of entities, which
contain a set of properties
Queues
22.
23. Account Table Entity
Name =…
Email = …
users
Name =…
Email = …
sally
Photo ID =…
Date =…
photo index
Photo ID =…
Date =…
24.
25.
26. … Property N
Partition Key Row Key Property 3
Document Version Modification Description
Name Time
… Committed version
Example Doc V1.0 8/2/2007
Partition
Alice’s working version
Example Doc V2.0.1 9/28/2007 1
FAQ Doc V1.0 5/2/2007 Committed version
Alice’s working version Partition
FAQ Doc V1.0.1 7/6/2007
2
Sally’s working version
FAQ Doc V1.0.2 8/1/2007
27.
28.
29.
30.
31. [DataServiceKey(quot;PartitionKeyquot;, quot;RowKeyquot;)]
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; }
}
32. Customer cust = new Customer(
‚Lee‛, // Partition Key = Last Name
‚Geddy‛, // Row Key = First Name
DateTime.UtcNow, // Customer Since
2.0, // Rating
‚Engineer‛ // Occupation);
// Service Uri is ‚http://<Account>.table.core.windows.net/‛
DataServiceContext context = new DataServiceContext(serviceUri);
context.AddObject(‚Customer‛, cust);
DataServiceResponse response = context.SaveChanges();
33. 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’