SlideShare a Scribd company logo
1 of 45
Ing. Eduardo Castro, PhD
Comunidad Windows
ecastro@grupoasesor.net
http://ecastrom.blogspot.com
1. Overview of Windows Azure Tables
2. Patterns and Practices for Windows Azure
Tables
3. Overview of Windows Azure Queues
4. Patterns and Practices for Windows Azure
Queues
5. Q&A
2
Tables – Provide structured storage. A TableProvide structured storage. A Table
is a set of entities, which contain a set ofis a set of entities, which contain a set of
propertiesproperties
Queues – Provide reliable storage and delivery of
messages for an application
Blobs – Provide a simple interface for storing
named files along with metadata for the file
Drives – Provides durable NTFS volumes for
Windows Azure applications to use (new)
3
Provides Structured Storage
Massively Scalable Tables
Billions of entities (rows) and TBs of data
Can use thousands of servers as traffic grows
Highly Available & Durable
Data is replicated several times
Familiar and Easy to use API
ADO.NET Data Services – .NET 3.5 SP1
.NET classes and LINQ
REST – with any platform or language
4
Email =…
Name = …
Email =…
Name = …
Genre =…
Title = …
Genre =…
Title = …
5
Table
A storage account can create many tables
Table name is scoped by account
Set of entities (i.e. rows)
Entity
Set of properties (columns)
Required properties
PartitionKey, RowKey and Timestamp
6
PartitionKey & RowKey
Uniquely identifies an entity
Defines the sort order
Use them to scale your application
Timestamp
Read only
Optimistic Concurrency
7
PartitionKey
Used to group entities in the table into
partitions
A table partition
All entities with same partition key value
Unit of scale
Control entity locality
Row key provides uniqueness within a partition
8
PartitionKey
(Category)
RowKey
(Title)
Timestamp ReleaseDat
e
Action Fast & Furious … 2009
Action The Bourne Ultimatum … 2007
… … … …
Animation Open Season 2 … 2009
Animation The Ant Bully … 2006
PartitionKey
(Category)
RowKey
(Title)
Timestamp ReleaseDat
e
Comedy Office Space … 1999
… … … …
SciFi X-Men Origins:
Wolverine
… 2009
… … … …
War Defiance … 2008
PartitionKey
(Category)
RowKey
(Title)
Timestamp ReleaseDat
e
Action Fast & Furious … 2009
Action The Bourne Ultimatum … 2007
… … … …
Animation Open Season 2 … 2009
Animation The Ant Bully … 2006
… … … …
Comedy Office Space … 1999
… … … …
SciFi X-Men Origins:
Wolverine
… 2009
… … … …
War Defiance … 2008
9
Table
Create
Query
Delete
Entities
Insert
Update
Merge – Partial Update
Replace – Update entire entity
Delete
Query
Entity Group Transaction (new)
Define the schema as a .NET class
11
[DataServiceKey("PartitionKey", "RowKey")]
public class Movie
{
/// <summary>
/// Category is the partition key
/// </summary>
public string PartitionKey { get; set; }
/// <summary>
/// Title is the row key
/// </summary>
public string RowKey { get; set; }
public DateTime Timestamp { get; set; }
public int ReleaseYear { get; set; }
public string Language { get; set; }
public string Cast { get; set; }
}
12
StorageCredentialsAccountAndKey credentials = new StorageCredentialsAccountAndKey(
“myaccount", “myKey");
string baseUri = "http://myaccount.table.core.windows.net";
CloudTableClient tableClient = new CloudTableClient(baseUri, credentials);
tableClient.CreateTable(“Movies");
TableServiceContext context = tableClient.GetDataServiceContext();
CloudTableQuery<Movie> q = (from movie in context.CreateQuery<Movie>(“Movies")
where movie.PartitionKey == “Action" && movie.RowKey == "The Bourne Ultimatum"
select movie).AsTableServiceQuery<Movie>();
Movie movieToUpdate = q.FirstOrDefault();
// Update movie
context.UpdateObject(movieToUpdate);
context.SaveChangesWithRetries();
// Add movie
context.AddObject(new Movie(“Action" , movieToAdd));
context.SaveChangesWithRetries();
1. Overview of Windows Azure Tables
2. Patterns and Practices for Windows Azure
Tables
3. Overview of Windows Azure Queues
4. Patterns and Practices for Windows Azure
Queues
5. Q & A
13
14
15
16
PartitionKey
(Account name)
RowKey
(Title)
Category …
moviesonline 12 Rounds Action …
moviesonline A Bug’s Life Animation …
100,000,000 more rows … … …
moviesonline Office Space Comedy …
moviesonline Platoon War …
50,000,000 more rows … … …
moviesonline WALL-E Animation …
PartitionKey
(Account name)
RowKey
(Title)
Category …
moviesonline 12 Rounds Action …
moviesonline A Bug’s Life Animation …
100,000,000 more rows … … …
moviesonline Office Space Comedy …
moviesonline Platoon War …
50,000,000 more rows … … …
moviesonline WALL-E Animation …
ClientClientClientClient
17
PartitionKey
(Category)
RowKey (Title)
Action Fast & Furious
… 10000 more Action movies
Action The Bourne Ultimatum
… 100000 more Action & Animation movies
Animation Open Season 2
… 100000 more Animation movies
Animation The Ant Bully
Comedy Office Space
… 1000000 more Comedy & SciFi movies
SciFi Star Trek
… 100000 more SciFi & War movies
… 100000 more War movies
War Defiance
ClientClientClientClient
18
PartitionKey
(Category)
RowKey
(Title)
Action Fast & Furious
… 10000 more Action movies
Action The Bourne Ultimatum
… 100000 more Action & Animation movies
Animation Open Season 2
… 100000 more Animation movies
Animation The Ant Bully
Comedy Office Space
… 1000000 more Comedy & SciFi movies
SciFi Star Trek
… 100000 more SciFi & War movies
… 100000 more War movies
War Defiance
19
PartitionKey
(Timestamp)
Properties
2009-11-15 02:00:01 …
2009-11-15 02:00:11 …
100000 more rows …
2009-11-17 05:40:01 …
2009-11-17 05:40:01 …
80000 more rows …
2009-11-17 12:30:00 …
2009-11-17 12:30:01 …
ApplicationsApplications
ClientClient
2009-11-17 12:30:01 …
2009-11-17 12:30:02 …
2009-11-17 12:30:03 …
20
PartitionKey
(ID_Timestamp)
Properties
01_2009-10-12 05:10:00 …
… …
100000 more rows …
09_2009-11-15 12:31:00 …
… …
20000000 more rows …
10_2009-10-05 05:10:10 …
5000000 more rows …
… …
900000 more rows …
19_2009-11-17 12:20:02 …
ApplicationsApplicationsApplicationsApplications
ClientClient
15_2009-11-17 12:30:01 …
09_2009-11-17 12:30:22 …
19_2009-11-17 12:30:10 …
01_2009-11-17 12:30:01 …
21
22
PartitionKey
(Category)
RowKey (Title)
Action Fast & Furious
… 10000 more Action movies
Action The Bourne Ultimatum
… 100000 more Action & Animation movies
Animation Open Season 2
… 100000 more Animation movies
Animation The Ant Bully
Comedy Office Space
… 1000000 more Comedy & SciFi movies
SciFi Star Trek
… 100000 more SciFi & War movies
… 100000 more War movies
War Defiance
ClientClient
23
ClientClient
PartitionKey
(Category)
RowKey
(Title)
Rating
Action Fast & Furious 5
… 999 more movies rated > 4 …
… Action and Anim. movies here with
rating < 4
…
Animation A Bug’s life 2
… 100 more movies < 4 here …
Animation The Ant Bully 3
Comedy Are we there yet? 2
… More movies here …
Comedy Office Space 5
… 800000 more movies here …
Drama A Beautiful Mind 5
… 1200000 more movies here …
War Defiance 4
24
Returns 1000 movies
Partition range boundary hit
Return continuation
ClientClient
PartitionKey
(Category)
RowKey
(Title)
Rating
Action Fast & Furious 5
… More movies here …
Comedy Office Space 5
… More movies here …
Documentary Planet Earth 4
… More movies here
Drama Seven Pounds 4
Horror Saw 5 3
… More movies here …
Music 8 Mile 2
… More movies here …
SciFi Star Trek 5
… More movies here …
25
26
27
28
29
30
PartitionKey
(AccountID)
RowKey
(Kind_*)
Kind TotalRentals Name Address CheckOutOn Title DueOn
… … … … … … … … …
Sally A_Sally Account 8 Sally Field Ann Arbor,
MI
Sally R_Jaws Rental 2009/11/16 Jaws 2009/11/20
Sally R_Taxi Rental 2009/11/16 Taxi 2009/11/20
… … … … … … … … …
31
32
1. Overview of Windows Azure Tables
2. Patterns and Practices for Windows Azure
Tables
3. Overview of Windows Azure Queues
4. Patterns and Practices for Windows Azure
Queues
5. Q & A
33
Queue are performance efficient, highly
available and provide reliable message
delivery
Simple, asynchronous work dispatch
Programming semantics ensure that a
message can be processed at least once
Access is provided via REST
34
35
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
Set a limit for message expiration
Messages
Message size <= 8 KB
To store larger data, store data in blob/entity storage,
and the blob/entity name in the message
Message now has dequeue count
36
Queue
Create Queue
Delete Queue
List Queues
Get/Set Queue Metadata
Messages
Add Message (i.e. Enqueue Message)
Get Message(s) (i.e. Dequeue Message)
Peek Message(s)
Delete Message
37
38
CloudQueueClient queueClient = new CloudQueueClient(baseUri, credentials);
CloudQueue queue = queueClient.GetQueueReference("test1");
queue.CreateIfNotExist();
//MessageCount is populated via FetchAttributes
queue.FetchAttributes();
CloudQueueMessage message = new CloudQueueMessage("Some content");
queue.AddMessage(message);
message = queue.GetMessage(TimeSpan.FromMinutes(10) /*visibility timeout*/);
//Process the message here …
queue.DeleteMessage(message);
1. Overview of Windows Azure Tables
2. Patterns and Practices for Windows Azure
Tables
3. Overview of Windows Azure Queues
4. Patterns and Practices for Windows Azure
Queues
5. Q & A
39
2
1
2
1
1
1
1
1
C1
C1
C2
C2
1
1
1
1
2
1
2
1
334
0
4
0
Producers Consumers
P2
P2
P1
P1
3
0
3
0
2. GetMessage(Q, 30 s)  msg 2
1. GetMessage(Q, 30 s)  msg 1
1
1
1
1
2
1
2
1
40
1
0
1
0
2
0
2
0
C1
C1
C2
C2
34
0
4
0
Producers Consumers
P2
P2
P1
P1
1
1
1
1
2
1
2
1
2. GetMessage(Q, 30 s)  msg 2
3. C2 consumed msg 2
4. DeleteMessage(Q, msg 2)
7. GetMessage(Q, 30 s)  msg 1
1. GetMessage(Q, 30 s)  msg 1
5. C1 crashed
1
1
1
1
2
1
2
1
6. msg1 visible 30 s after Dequeue3
0
3
0
41
1
2
1
2
1
1
1
1
1
2
1
2
C1
C1
C2
C2
34
0
4
0
Producers Consumers
P2
P2
P1
P1
1
2
1
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
8. C2 crashed
1. Dequeue(Q, 30 sec)  msg 1
5. C1 crashed
10. C1 restarted
11. Dequeue(Q, 30 sec)  msg 1
12. DequeueCount > 2
13. Delete (Q, msg1)
1
2
1
2
6. msg1 visible 30s after Dequeue
9. msg1 visible 30s after Dequeue
3
0
3
0
42
1
3
1
3
1
2
1
2
1
3
1
3
43
44
http://comunidadwindows.org
http://ecastrom.blogspot.com
http://www.sqlazurelabs.com
http://www.microsoft.com/windowsazure/
http://sql.azure.com/

More Related Content

Viewers also liked

Introduction to Windows Azure Platform
Introduction to Windows Azure PlatformIntroduction to Windows Azure Platform
Introduction to Windows Azure PlatformSergejus Barinovas
 
Patterns for Scalability in Windows Azure Applications (Alex Mang)
Patterns for Scalability in Windows Azure Applications (Alex Mang)Patterns for Scalability in Windows Azure Applications (Alex Mang)
Patterns for Scalability in Windows Azure Applications (Alex Mang)ITCamp
 
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...David J Rosenthal
 
Cloud Identity and Access Management
Cloud Identity and Access ManagementCloud Identity and Access Management
Cloud Identity and Access ManagementJarek Sokolnicki
 
Windows Azure Queues and Windows Azure Service Bus Queues
Windows Azure Queues and Windows Azure Service Bus QueuesWindows Azure Queues and Windows Azure Service Bus Queues
Windows Azure Queues and Windows Azure Service Bus QueuesJuan Pablo
 
Introduction into Windows Azure Pack and Service Management Automation
Introduction into Windows Azure Pack and Service Management AutomationIntroduction into Windows Azure Pack and Service Management Automation
Introduction into Windows Azure Pack and Service Management AutomationMichael Rüefli
 
Introduction to Windows Azure and Windows Azure SQL Database
Introduction to Windows Azure and Windows Azure SQL DatabaseIntroduction to Windows Azure and Windows Azure SQL Database
Introduction to Windows Azure and Windows Azure SQL DatabaseVikas Sahni
 
Design Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows AzureDesign Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows AzureEric Nelson
 
Get set.. Introduction to Windows Azure Development
Get set.. Introduction to Windows Azure DevelopmentGet set.. Introduction to Windows Azure Development
Get set.. Introduction to Windows Azure DevelopmentThomas Robbins
 
CloudFest Denver Windows Azure Design Patterns
CloudFest Denver Windows Azure Design PatternsCloudFest Denver Windows Azure Design Patterns
CloudFest Denver Windows Azure Design PatternsDavid Pallmann
 
Introduction to Windows Azure AppFabric Applications
Introduction to Windows Azure AppFabric ApplicationsIntroduction to Windows Azure AppFabric Applications
Introduction to Windows Azure AppFabric ApplicationsNeil Mackenzie
 
Design patterns and plan for developing high available azure applications
Design patterns and plan for developing high available azure applicationsDesign patterns and plan for developing high available azure applications
Design patterns and plan for developing high available azure applicationsHimanshu Sahu
 
High availability of azure applications(paas)
High availability of azure applications(paas)High availability of azure applications(paas)
High availability of azure applications(paas)Himanshu Sahu
 
Introduction to Windows Azure Virtual Machines
Introduction to Windows Azure Virtual MachinesIntroduction to Windows Azure Virtual Machines
Introduction to Windows Azure Virtual MachinesClint Edmonson
 
Introduction to Windows Azure
Introduction to Windows AzureIntroduction to Windows Azure
Introduction to Windows AzureRavi Ranjan Karn
 
Introduction to Windows Azure Data Services
Introduction to Windows Azure Data ServicesIntroduction to Windows Azure Data Services
Introduction to Windows Azure Data ServicesRobert Greiner
 
Migrating Legacy On-Premise Applications to SharePoint Online and Windows Azure
Migrating Legacy On-Premise Applications to SharePoint Online and Windows AzureMigrating Legacy On-Premise Applications to SharePoint Online and Windows Azure
Migrating Legacy On-Premise Applications to SharePoint Online and Windows AzureEric Shupps
 
Acsug scalable windows azure patterns
Acsug scalable windows azure patternsAcsug scalable windows azure patterns
Acsug scalable windows azure patternsNikolai Blackie
 

Viewers also liked (20)

Introduction to Windows Azure Platform
Introduction to Windows Azure PlatformIntroduction to Windows Azure Platform
Introduction to Windows Azure Platform
 
Patterns for Scalability in Windows Azure Applications (Alex Mang)
Patterns for Scalability in Windows Azure Applications (Alex Mang)Patterns for Scalability in Windows Azure Applications (Alex Mang)
Patterns for Scalability in Windows Azure Applications (Alex Mang)
 
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...
 
Cloud Identity and Access Management
Cloud Identity and Access ManagementCloud Identity and Access Management
Cloud Identity and Access Management
 
Windows Azure Queues and Windows Azure Service Bus Queues
Windows Azure Queues and Windows Azure Service Bus QueuesWindows Azure Queues and Windows Azure Service Bus Queues
Windows Azure Queues and Windows Azure Service Bus Queues
 
Introduction into Windows Azure Pack and Service Management Automation
Introduction into Windows Azure Pack and Service Management AutomationIntroduction into Windows Azure Pack and Service Management Automation
Introduction into Windows Azure Pack and Service Management Automation
 
Introduction to Windows Azure and Windows Azure SQL Database
Introduction to Windows Azure and Windows Azure SQL DatabaseIntroduction to Windows Azure and Windows Azure SQL Database
Introduction to Windows Azure and Windows Azure SQL Database
 
Design Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows AzureDesign Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows Azure
 
Azure and cloud design patterns
Azure and cloud design patternsAzure and cloud design patterns
Azure and cloud design patterns
 
Get set.. Introduction to Windows Azure Development
Get set.. Introduction to Windows Azure DevelopmentGet set.. Introduction to Windows Azure Development
Get set.. Introduction to Windows Azure Development
 
CloudFest Denver Windows Azure Design Patterns
CloudFest Denver Windows Azure Design PatternsCloudFest Denver Windows Azure Design Patterns
CloudFest Denver Windows Azure Design Patterns
 
Introduction to Windows Azure AppFabric Applications
Introduction to Windows Azure AppFabric ApplicationsIntroduction to Windows Azure AppFabric Applications
Introduction to Windows Azure AppFabric Applications
 
Design patterns and plan for developing high available azure applications
Design patterns and plan for developing high available azure applicationsDesign patterns and plan for developing high available azure applications
Design patterns and plan for developing high available azure applications
 
High availability of azure applications(paas)
High availability of azure applications(paas)High availability of azure applications(paas)
High availability of azure applications(paas)
 
Introduction to Windows Azure Virtual Machines
Introduction to Windows Azure Virtual MachinesIntroduction to Windows Azure Virtual Machines
Introduction to Windows Azure Virtual Machines
 
Introduction to Windows Azure
Introduction to Windows AzureIntroduction to Windows Azure
Introduction to Windows Azure
 
Introduction to Windows Azure Data Services
Introduction to Windows Azure Data ServicesIntroduction to Windows Azure Data Services
Introduction to Windows Azure Data Services
 
Migrating Legacy On-Premise Applications to SharePoint Online and Windows Azure
Migrating Legacy On-Premise Applications to SharePoint Online and Windows AzureMigrating Legacy On-Premise Applications to SharePoint Online and Windows Azure
Migrating Legacy On-Premise Applications to SharePoint Online and Windows Azure
 
Introduction to windows azure
Introduction to windows azureIntroduction to windows azure
Introduction to windows azure
 
Acsug scalable windows azure patterns
Acsug scalable windows azure patternsAcsug scalable windows azure patterns
Acsug scalable windows azure patterns
 

Similar to Tablas y almacenamiento en windows azure

Introduction to SQL Server Cloud Storage Azure
Introduction to SQL Server Cloud Storage AzureIntroduction to SQL Server Cloud Storage Azure
Introduction to SQL Server Cloud Storage AzureEduardo Castro
 
Developing For The Windows Azure Platform
Developing For The Windows Azure PlatformDeveloping For The Windows Azure Platform
Developing For The Windows Azure Platformdrmarcustillett
 
DICOM structure
DICOM structureDICOM structure
DICOM structureShiju P K
 
Looking Ahead to Tcl 8.6
Looking Ahead to Tcl 8.6Looking Ahead to Tcl 8.6
Looking Ahead to Tcl 8.6ActiveState
 
IronPython and Dynamic Languages on .NET by Mahesh Prakriya
 IronPython and Dynamic Languages on .NET by Mahesh Prakriya IronPython and Dynamic Languages on .NET by Mahesh Prakriya
IronPython and Dynamic Languages on .NET by Mahesh Prakriyacodebits
 
WSO2 Product Release Webinar: WSO2 Complex Event Processor 4.0
WSO2 Product Release Webinar: WSO2 Complex Event Processor 4.0WSO2 Product Release Webinar: WSO2 Complex Event Processor 4.0
WSO2 Product Release Webinar: WSO2 Complex Event Processor 4.0WSO2
 
Kotlin for Android devs
Kotlin for Android devsKotlin for Android devs
Kotlin for Android devsAdit Lal
 
The Ring programming language version 1.5.4 book - Part 15 of 185
The Ring programming language version 1.5.4 book - Part 15 of 185The Ring programming language version 1.5.4 book - Part 15 of 185
The Ring programming language version 1.5.4 book - Part 15 of 185Mahmoud Samir Fayed
 
Os Vanrossum
Os VanrossumOs Vanrossum
Os Vanrossumoscon2007
 
Introduction To Spring
Introduction To SpringIntroduction To Spring
Introduction To SpringIlio Catallo
 
Tcl2012 8.6 Changes
Tcl2012 8.6 ChangesTcl2012 8.6 Changes
Tcl2012 8.6 Changeshobbs
 
The Ring programming language version 1.10 book - Part 102 of 212
The Ring programming language version 1.10 book - Part 102 of 212The Ring programming language version 1.10 book - Part 102 of 212
The Ring programming language version 1.10 book - Part 102 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 34 of 212
The Ring programming language version 1.10 book - Part 34 of 212The Ring programming language version 1.10 book - Part 34 of 212
The Ring programming language version 1.10 book - Part 34 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212Mahmoud Samir Fayed
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with ClojureJohn Stevenson
 
Swift Bengaluru Meetup slides
Swift Bengaluru Meetup slidesSwift Bengaluru Meetup slides
Swift Bengaluru Meetup slidesPushkar Kulkarni
 
Make A Shoot ‘Em Up Game with Amethyst Framework
Make A Shoot ‘Em Up Game with Amethyst FrameworkMake A Shoot ‘Em Up Game with Amethyst Framework
Make A Shoot ‘Em Up Game with Amethyst FrameworkYodalee
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocolWoodruff Solutions LLC
 

Similar to Tablas y almacenamiento en windows azure (20)

Introduction to SQL Server Cloud Storage Azure
Introduction to SQL Server Cloud Storage AzureIntroduction to SQL Server Cloud Storage Azure
Introduction to SQL Server Cloud Storage Azure
 
Developing For The Windows Azure Platform
Developing For The Windows Azure PlatformDeveloping For The Windows Azure Platform
Developing For The Windows Azure Platform
 
DICOM structure
DICOM structureDICOM structure
DICOM structure
 
Looking Ahead to Tcl 8.6
Looking Ahead to Tcl 8.6Looking Ahead to Tcl 8.6
Looking Ahead to Tcl 8.6
 
IronPython and Dynamic Languages on .NET by Mahesh Prakriya
 IronPython and Dynamic Languages on .NET by Mahesh Prakriya IronPython and Dynamic Languages on .NET by Mahesh Prakriya
IronPython and Dynamic Languages on .NET by Mahesh Prakriya
 
WSO2 Product Release Webinar: WSO2 Complex Event Processor 4.0
WSO2 Product Release Webinar: WSO2 Complex Event Processor 4.0WSO2 Product Release Webinar: WSO2 Complex Event Processor 4.0
WSO2 Product Release Webinar: WSO2 Complex Event Processor 4.0
 
Kotlin for Android devs
Kotlin for Android devsKotlin for Android devs
Kotlin for Android devs
 
The Ring programming language version 1.5.4 book - Part 15 of 185
The Ring programming language version 1.5.4 book - Part 15 of 185The Ring programming language version 1.5.4 book - Part 15 of 185
The Ring programming language version 1.5.4 book - Part 15 of 185
 
.NET Reflection
.NET Reflection.NET Reflection
.NET Reflection
 
Os Vanrossum
Os VanrossumOs Vanrossum
Os Vanrossum
 
Introduction To Spring
Introduction To SpringIntroduction To Spring
Introduction To Spring
 
Tcl2012 8.6 Changes
Tcl2012 8.6 ChangesTcl2012 8.6 Changes
Tcl2012 8.6 Changes
 
The Ring programming language version 1.10 book - Part 102 of 212
The Ring programming language version 1.10 book - Part 102 of 212The Ring programming language version 1.10 book - Part 102 of 212
The Ring programming language version 1.10 book - Part 102 of 212
 
The Ring programming language version 1.10 book - Part 34 of 212
The Ring programming language version 1.10 book - Part 34 of 212The Ring programming language version 1.10 book - Part 34 of 212
The Ring programming language version 1.10 book - Part 34 of 212
 
The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212
 
GraphQL with Sangria
GraphQL with SangriaGraphQL with Sangria
GraphQL with Sangria
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
 
Swift Bengaluru Meetup slides
Swift Bengaluru Meetup slidesSwift Bengaluru Meetup slides
Swift Bengaluru Meetup slides
 
Make A Shoot ‘Em Up Game with Amethyst Framework
Make A Shoot ‘Em Up Game with Amethyst FrameworkMake A Shoot ‘Em Up Game with Amethyst Framework
Make A Shoot ‘Em Up Game with Amethyst Framework
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocol
 

More from Eduardo Castro

Introducción a polybase en SQL Server
Introducción a polybase en SQL ServerIntroducción a polybase en SQL Server
Introducción a polybase en SQL ServerEduardo Castro
 
Creando tu primer ambiente de AI en Azure ML y SQL Server
Creando tu primer ambiente de AI en Azure ML y SQL ServerCreando tu primer ambiente de AI en Azure ML y SQL Server
Creando tu primer ambiente de AI en Azure ML y SQL ServerEduardo Castro
 
Seguridad en SQL Azure
Seguridad en SQL AzureSeguridad en SQL Azure
Seguridad en SQL AzureEduardo Castro
 
Azure Synapse Analytics MLflow
Azure Synapse Analytics MLflowAzure Synapse Analytics MLflow
Azure Synapse Analytics MLflowEduardo Castro
 
SQL Server 2019 con Windows Server 2022
SQL Server 2019 con Windows Server 2022SQL Server 2019 con Windows Server 2022
SQL Server 2019 con Windows Server 2022Eduardo Castro
 
Novedades en SQL Server 2022
Novedades en SQL Server 2022Novedades en SQL Server 2022
Novedades en SQL Server 2022Eduardo Castro
 
Introduccion a SQL Server 2022
Introduccion a SQL Server 2022Introduccion a SQL Server 2022
Introduccion a SQL Server 2022Eduardo Castro
 
Machine Learning con Azure Managed Instance
Machine Learning con Azure Managed InstanceMachine Learning con Azure Managed Instance
Machine Learning con Azure Managed InstanceEduardo Castro
 
Novedades en sql server 2022
Novedades en sql server 2022Novedades en sql server 2022
Novedades en sql server 2022Eduardo Castro
 
Sql server 2019 con windows server 2022
Sql server 2019 con windows server 2022Sql server 2019 con windows server 2022
Sql server 2019 con windows server 2022Eduardo Castro
 
Introduccion a databricks
Introduccion a databricksIntroduccion a databricks
Introduccion a databricksEduardo Castro
 
Pronosticos con sql server
Pronosticos con sql serverPronosticos con sql server
Pronosticos con sql serverEduardo Castro
 
Data warehouse con azure synapse analytics
Data warehouse con azure synapse analyticsData warehouse con azure synapse analytics
Data warehouse con azure synapse analyticsEduardo Castro
 
Que hay de nuevo en el Azure Data Lake Storage Gen2
Que hay de nuevo en el Azure Data Lake Storage Gen2Que hay de nuevo en el Azure Data Lake Storage Gen2
Que hay de nuevo en el Azure Data Lake Storage Gen2Eduardo Castro
 
Introduccion a Azure Synapse Analytics
Introduccion a Azure Synapse AnalyticsIntroduccion a Azure Synapse Analytics
Introduccion a Azure Synapse AnalyticsEduardo Castro
 
Seguridad de SQL Database en Azure
Seguridad de SQL Database en AzureSeguridad de SQL Database en Azure
Seguridad de SQL Database en AzureEduardo Castro
 
Python dentro de SQL Server
Python dentro de SQL ServerPython dentro de SQL Server
Python dentro de SQL ServerEduardo Castro
 
Servicios Cognitivos de de Microsoft
Servicios Cognitivos de de Microsoft Servicios Cognitivos de de Microsoft
Servicios Cognitivos de de Microsoft Eduardo Castro
 
Script de paso a paso de configuración de Secure Enclaves
Script de paso a paso de configuración de Secure EnclavesScript de paso a paso de configuración de Secure Enclaves
Script de paso a paso de configuración de Secure EnclavesEduardo Castro
 
Introducción a conceptos de SQL Server Secure Enclaves
Introducción a conceptos de SQL Server Secure EnclavesIntroducción a conceptos de SQL Server Secure Enclaves
Introducción a conceptos de SQL Server Secure EnclavesEduardo Castro
 

More from Eduardo Castro (20)

Introducción a polybase en SQL Server
Introducción a polybase en SQL ServerIntroducción a polybase en SQL Server
Introducción a polybase en SQL Server
 
Creando tu primer ambiente de AI en Azure ML y SQL Server
Creando tu primer ambiente de AI en Azure ML y SQL ServerCreando tu primer ambiente de AI en Azure ML y SQL Server
Creando tu primer ambiente de AI en Azure ML y SQL Server
 
Seguridad en SQL Azure
Seguridad en SQL AzureSeguridad en SQL Azure
Seguridad en SQL Azure
 
Azure Synapse Analytics MLflow
Azure Synapse Analytics MLflowAzure Synapse Analytics MLflow
Azure Synapse Analytics MLflow
 
SQL Server 2019 con Windows Server 2022
SQL Server 2019 con Windows Server 2022SQL Server 2019 con Windows Server 2022
SQL Server 2019 con Windows Server 2022
 
Novedades en SQL Server 2022
Novedades en SQL Server 2022Novedades en SQL Server 2022
Novedades en SQL Server 2022
 
Introduccion a SQL Server 2022
Introduccion a SQL Server 2022Introduccion a SQL Server 2022
Introduccion a SQL Server 2022
 
Machine Learning con Azure Managed Instance
Machine Learning con Azure Managed InstanceMachine Learning con Azure Managed Instance
Machine Learning con Azure Managed Instance
 
Novedades en sql server 2022
Novedades en sql server 2022Novedades en sql server 2022
Novedades en sql server 2022
 
Sql server 2019 con windows server 2022
Sql server 2019 con windows server 2022Sql server 2019 con windows server 2022
Sql server 2019 con windows server 2022
 
Introduccion a databricks
Introduccion a databricksIntroduccion a databricks
Introduccion a databricks
 
Pronosticos con sql server
Pronosticos con sql serverPronosticos con sql server
Pronosticos con sql server
 
Data warehouse con azure synapse analytics
Data warehouse con azure synapse analyticsData warehouse con azure synapse analytics
Data warehouse con azure synapse analytics
 
Que hay de nuevo en el Azure Data Lake Storage Gen2
Que hay de nuevo en el Azure Data Lake Storage Gen2Que hay de nuevo en el Azure Data Lake Storage Gen2
Que hay de nuevo en el Azure Data Lake Storage Gen2
 
Introduccion a Azure Synapse Analytics
Introduccion a Azure Synapse AnalyticsIntroduccion a Azure Synapse Analytics
Introduccion a Azure Synapse Analytics
 
Seguridad de SQL Database en Azure
Seguridad de SQL Database en AzureSeguridad de SQL Database en Azure
Seguridad de SQL Database en Azure
 
Python dentro de SQL Server
Python dentro de SQL ServerPython dentro de SQL Server
Python dentro de SQL Server
 
Servicios Cognitivos de de Microsoft
Servicios Cognitivos de de Microsoft Servicios Cognitivos de de Microsoft
Servicios Cognitivos de de Microsoft
 
Script de paso a paso de configuración de Secure Enclaves
Script de paso a paso de configuración de Secure EnclavesScript de paso a paso de configuración de Secure Enclaves
Script de paso a paso de configuración de Secure Enclaves
 
Introducción a conceptos de SQL Server Secure Enclaves
Introducción a conceptos de SQL Server Secure EnclavesIntroducción a conceptos de SQL Server Secure Enclaves
Introducción a conceptos de SQL Server Secure Enclaves
 

Tablas y almacenamiento en windows azure

  • 1. Ing. Eduardo Castro, PhD Comunidad Windows ecastro@grupoasesor.net http://ecastrom.blogspot.com
  • 2. 1. Overview of Windows Azure Tables 2. Patterns and Practices for Windows Azure Tables 3. Overview of Windows Azure Queues 4. Patterns and Practices for Windows Azure Queues 5. Q&A 2
  • 3. Tables – Provide structured storage. A TableProvide structured storage. A Table is a set of entities, which contain a set ofis a set of entities, which contain a set of propertiesproperties Queues – Provide reliable storage and delivery of messages for an application Blobs – Provide a simple interface for storing named files along with metadata for the file Drives – Provides durable NTFS volumes for Windows Azure applications to use (new) 3
  • 4. Provides Structured Storage Massively Scalable Tables Billions of entities (rows) and TBs of data Can use thousands of servers as traffic grows Highly Available & Durable Data is replicated several times Familiar and Easy to use API ADO.NET Data Services – .NET 3.5 SP1 .NET classes and LINQ REST – with any platform or language 4
  • 5. Email =… Name = … Email =… Name = … Genre =… Title = … Genre =… Title = … 5
  • 6. Table A storage account can create many tables Table name is scoped by account Set of entities (i.e. rows) Entity Set of properties (columns) Required properties PartitionKey, RowKey and Timestamp 6
  • 7. PartitionKey & RowKey Uniquely identifies an entity Defines the sort order Use them to scale your application Timestamp Read only Optimistic Concurrency 7
  • 8. PartitionKey Used to group entities in the table into partitions A table partition All entities with same partition key value Unit of scale Control entity locality Row key provides uniqueness within a partition 8
  • 9. PartitionKey (Category) RowKey (Title) Timestamp ReleaseDat e Action Fast & Furious … 2009 Action The Bourne Ultimatum … 2007 … … … … Animation Open Season 2 … 2009 Animation The Ant Bully … 2006 PartitionKey (Category) RowKey (Title) Timestamp ReleaseDat e Comedy Office Space … 1999 … … … … SciFi X-Men Origins: Wolverine … 2009 … … … … War Defiance … 2008 PartitionKey (Category) RowKey (Title) Timestamp ReleaseDat e Action Fast & Furious … 2009 Action The Bourne Ultimatum … 2007 … … … … Animation Open Season 2 … 2009 Animation The Ant Bully … 2006 … … … … Comedy Office Space … 1999 … … … … SciFi X-Men Origins: Wolverine … 2009 … … … … War Defiance … 2008 9
  • 10. Table Create Query Delete Entities Insert Update Merge – Partial Update Replace – Update entire entity Delete Query Entity Group Transaction (new)
  • 11. Define the schema as a .NET class 11 [DataServiceKey("PartitionKey", "RowKey")] public class Movie { /// <summary> /// Category is the partition key /// </summary> public string PartitionKey { get; set; } /// <summary> /// Title is the row key /// </summary> public string RowKey { get; set; } public DateTime Timestamp { get; set; } public int ReleaseYear { get; set; } public string Language { get; set; } public string Cast { get; set; } }
  • 12. 12 StorageCredentialsAccountAndKey credentials = new StorageCredentialsAccountAndKey( “myaccount", “myKey"); string baseUri = "http://myaccount.table.core.windows.net"; CloudTableClient tableClient = new CloudTableClient(baseUri, credentials); tableClient.CreateTable(“Movies"); TableServiceContext context = tableClient.GetDataServiceContext(); CloudTableQuery<Movie> q = (from movie in context.CreateQuery<Movie>(“Movies") where movie.PartitionKey == “Action" && movie.RowKey == "The Bourne Ultimatum" select movie).AsTableServiceQuery<Movie>(); Movie movieToUpdate = q.FirstOrDefault(); // Update movie context.UpdateObject(movieToUpdate); context.SaveChangesWithRetries(); // Add movie context.AddObject(new Movie(“Action" , movieToAdd)); context.SaveChangesWithRetries();
  • 13. 1. Overview of Windows Azure Tables 2. Patterns and Practices for Windows Azure Tables 3. Overview of Windows Azure Queues 4. Patterns and Practices for Windows Azure Queues 5. Q & A 13
  • 14. 14
  • 15. 15
  • 16. 16 PartitionKey (Account name) RowKey (Title) Category … moviesonline 12 Rounds Action … moviesonline A Bug’s Life Animation … 100,000,000 more rows … … … moviesonline Office Space Comedy … moviesonline Platoon War … 50,000,000 more rows … … … moviesonline WALL-E Animation …
  • 17. PartitionKey (Account name) RowKey (Title) Category … moviesonline 12 Rounds Action … moviesonline A Bug’s Life Animation … 100,000,000 more rows … … … moviesonline Office Space Comedy … moviesonline Platoon War … 50,000,000 more rows … … … moviesonline WALL-E Animation … ClientClientClientClient 17
  • 18. PartitionKey (Category) RowKey (Title) Action Fast & Furious … 10000 more Action movies Action The Bourne Ultimatum … 100000 more Action & Animation movies Animation Open Season 2 … 100000 more Animation movies Animation The Ant Bully Comedy Office Space … 1000000 more Comedy & SciFi movies SciFi Star Trek … 100000 more SciFi & War movies … 100000 more War movies War Defiance ClientClientClientClient 18 PartitionKey (Category) RowKey (Title) Action Fast & Furious … 10000 more Action movies Action The Bourne Ultimatum … 100000 more Action & Animation movies Animation Open Season 2 … 100000 more Animation movies Animation The Ant Bully Comedy Office Space … 1000000 more Comedy & SciFi movies SciFi Star Trek … 100000 more SciFi & War movies … 100000 more War movies War Defiance
  • 19. 19
  • 20. PartitionKey (Timestamp) Properties 2009-11-15 02:00:01 … 2009-11-15 02:00:11 … 100000 more rows … 2009-11-17 05:40:01 … 2009-11-17 05:40:01 … 80000 more rows … 2009-11-17 12:30:00 … 2009-11-17 12:30:01 … ApplicationsApplications ClientClient 2009-11-17 12:30:01 … 2009-11-17 12:30:02 … 2009-11-17 12:30:03 … 20
  • 21. PartitionKey (ID_Timestamp) Properties 01_2009-10-12 05:10:00 … … … 100000 more rows … 09_2009-11-15 12:31:00 … … … 20000000 more rows … 10_2009-10-05 05:10:10 … 5000000 more rows … … … 900000 more rows … 19_2009-11-17 12:20:02 … ApplicationsApplicationsApplicationsApplications ClientClient 15_2009-11-17 12:30:01 … 09_2009-11-17 12:30:22 … 19_2009-11-17 12:30:10 … 01_2009-11-17 12:30:01 … 21
  • 22. 22
  • 23. PartitionKey (Category) RowKey (Title) Action Fast & Furious … 10000 more Action movies Action The Bourne Ultimatum … 100000 more Action & Animation movies Animation Open Season 2 … 100000 more Animation movies Animation The Ant Bully Comedy Office Space … 1000000 more Comedy & SciFi movies SciFi Star Trek … 100000 more SciFi & War movies … 100000 more War movies War Defiance ClientClient 23
  • 24. ClientClient PartitionKey (Category) RowKey (Title) Rating Action Fast & Furious 5 … 999 more movies rated > 4 … … Action and Anim. movies here with rating < 4 … Animation A Bug’s life 2 … 100 more movies < 4 here … Animation The Ant Bully 3 Comedy Are we there yet? 2 … More movies here … Comedy Office Space 5 … 800000 more movies here … Drama A Beautiful Mind 5 … 1200000 more movies here … War Defiance 4 24 Returns 1000 movies Partition range boundary hit Return continuation
  • 25. ClientClient PartitionKey (Category) RowKey (Title) Rating Action Fast & Furious 5 … More movies here … Comedy Office Space 5 … More movies here … Documentary Planet Earth 4 … More movies here Drama Seven Pounds 4 Horror Saw 5 3 … More movies here … Music 8 Mile 2 … More movies here … SciFi Star Trek 5 … More movies here … 25
  • 26. 26
  • 27. 27
  • 28. 28
  • 29. 29
  • 30. 30
  • 31. PartitionKey (AccountID) RowKey (Kind_*) Kind TotalRentals Name Address CheckOutOn Title DueOn … … … … … … … … … Sally A_Sally Account 8 Sally Field Ann Arbor, MI Sally R_Jaws Rental 2009/11/16 Jaws 2009/11/20 Sally R_Taxi Rental 2009/11/16 Taxi 2009/11/20 … … … … … … … … … 31
  • 32. 32
  • 33. 1. Overview of Windows Azure Tables 2. Patterns and Practices for Windows Azure Tables 3. Overview of Windows Azure Queues 4. Patterns and Practices for Windows Azure Queues 5. Q & A 33
  • 34. Queue are performance efficient, highly available and provide reliable message delivery Simple, asynchronous work dispatch Programming semantics ensure that a message can be processed at least once Access is provided via REST 34
  • 35. 35
  • 36. 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 Set a limit for message expiration Messages Message size <= 8 KB To store larger data, store data in blob/entity storage, and the blob/entity name in the message Message now has dequeue count 36
  • 37. Queue Create Queue Delete Queue List Queues Get/Set Queue Metadata Messages Add Message (i.e. Enqueue Message) Get Message(s) (i.e. Dequeue Message) Peek Message(s) Delete Message 37
  • 38. 38 CloudQueueClient queueClient = new CloudQueueClient(baseUri, credentials); CloudQueue queue = queueClient.GetQueueReference("test1"); queue.CreateIfNotExist(); //MessageCount is populated via FetchAttributes queue.FetchAttributes(); CloudQueueMessage message = new CloudQueueMessage("Some content"); queue.AddMessage(message); message = queue.GetMessage(TimeSpan.FromMinutes(10) /*visibility timeout*/); //Process the message here … queue.DeleteMessage(message);
  • 39. 1. Overview of Windows Azure Tables 2. Patterns and Practices for Windows Azure Tables 3. Overview of Windows Azure Queues 4. Patterns and Practices for Windows Azure Queues 5. Q & A 39
  • 40. 2 1 2 1 1 1 1 1 C1 C1 C2 C2 1 1 1 1 2 1 2 1 334 0 4 0 Producers Consumers P2 P2 P1 P1 3 0 3 0 2. GetMessage(Q, 30 s)  msg 2 1. GetMessage(Q, 30 s)  msg 1 1 1 1 1 2 1 2 1 40 1 0 1 0 2 0 2 0
  • 41. C1 C1 C2 C2 34 0 4 0 Producers Consumers P2 P2 P1 P1 1 1 1 1 2 1 2 1 2. GetMessage(Q, 30 s)  msg 2 3. C2 consumed msg 2 4. DeleteMessage(Q, msg 2) 7. GetMessage(Q, 30 s)  msg 1 1. GetMessage(Q, 30 s)  msg 1 5. C1 crashed 1 1 1 1 2 1 2 1 6. msg1 visible 30 s after Dequeue3 0 3 0 41 1 2 1 2 1 1 1 1 1 2 1 2
  • 42. C1 C1 C2 C2 34 0 4 0 Producers Consumers P2 P2 P1 P1 1 2 1 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 8. C2 crashed 1. Dequeue(Q, 30 sec)  msg 1 5. C1 crashed 10. C1 restarted 11. Dequeue(Q, 30 sec)  msg 1 12. DequeueCount > 2 13. Delete (Q, msg1) 1 2 1 2 6. msg1 visible 30s after Dequeue 9. msg1 visible 30s after Dequeue 3 0 3 0 42 1 3 1 3 1 2 1 2 1 3 1 3
  • 43. 43
  • 44. 44