SlideShare une entreprise Scribd logo
1  sur  46
Sirar Salih
Solution Architect at Making Waves
The Good, the Bad, the Ugly
Azure Table Storage
Balancing stakeholder influence and customer
needs
Hydro is a global enterprise, with many different
business stakeholders and content owners who have
different needs and priorities.
Finding a good balance between corporate consistency
and local business relevance while not falling into the
trap of designing according to internal organisation
rather than the customer can be challenging.
Manage
Stakeholders
Sirar Salih
Solution Architect at Making Waves
Who Am I?
Credit:
2018
Each NoSQL database has its good and bad side.
Azure Table Storage
Pros
• Easy setup
• Cheap
• Minimal work required
• Easy to understand
• Simple model: Entity, PartitionKey,
RowKey
• Low on scalability
• Lack of basic database operations
- No «like» or «contains»
• No backup procedure
Cons
Setup & usage
https://portal.azure.com
Storage accounts
Add
https://portal.azure.com
Storage accounts
Select storage account
Access keys
Connection string
Azure SDK
Azure Storage Explorer
Azure Storage Explorer
private const string tableName = "Customers";
private static CloudTable _cloudTable;
public TableStorageService(KeyVaultSecretProvider keyVaultSecretProvider, string storageAccountName, string storageAccountKeyName)
{
var storageAccountKey = keyVaultSecretProvider.GetSecret(storageAccountKeyName);
var connectionString = $"DefaultEndpointsProtocol=https;AccountName={storageAccountName};AccountKey={storageAccountKey};EndpointSuffix=core.windows.net";
var cloudStorageAccount = CloudStorageAccount.Parse(connectionString);
var cloudTableClient = cloudStorageAccount.CreateCloudTableClient();
_cloudTable = cloudTableClient.GetTableReference(tableName);
}
Connect and create table
public class CustomerEntity : TableEntity
{
public CustomerEntity() { }
public CustomerEntity(string lastName, string firstName)
{
PartitionKey = lastName;
RowKey = firstName;
}
}
Entity
var insertOperation = TableOperation.Insert(new CustomerEntity("Snow", "Jon"));
await _cloudTable.ExecuteAsync(insertOperation);
Insert entity
var tableBatchOperation = new TableBatchOperation();
for(var i = 0; i < 100; i++)
{
tableBatchOperation.Insert(new CustomerEntity("Snow", $"Jon {i}"));
if(i == 99) {
await _cloudTable.ExecuteBatchAsync(tableBatchOperation);
}
}
Batch insert entities
Get entity
var query = new TableQuery<CustomerEntity>()
.Where(TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, "Jon"));
_cloudTable.ExecuteQuery(query);
Delete entity
var retrieveOperation = TableOperation.Retrieve<CustomerEntity>("Snow", "Jon");
var retrievedResult = await _cloudTable.ExecuteAsync(retrieveOperation);
var deleteEntity = (CustomerEntity)retrievedResult.Result;
var deleteOperation = TableOperation.Delete(deleteEntity);
await _cloudTable.ExecuteAsync(deleteOperation);
Blob containers
• Blob container: Similar to a folder, containing a collection of
blobs
• Blob: A file of any format
Connect and create blob container
private const string CustomersContainerName = "customers";
private static CloudBlobContainer _cloudBlobContainer;
public Job(string connectionString)
{
var cloudStorageAccount = CloudStorageAccount.Parse(connectionString);
var cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();
_cloudBlobContainer = cloudBlobClient.GetContainerReference(CustomersContainerName);
if (!_cloudBlobContainer.Exists()) _cloudBlobContainer.Create();
}
Upload blob
var cloudBlockBlob = _cloudBlobContainer.GetBlockBlobReference(blobName);
cloudBlockBlob.Properties.ContentType = "application/json";
using (var ms = new MemoryStream())
{
var j = JsonConvert.SerializeObject(json);
var writer = new StreamWriter(ms); writer.Write(j);
writer.Flush();
ms.Position = 0;
cloudBlockBlob.UploadFromStream(ms);
}
Download blob
var cloudBlockBlob = _cloudBlobContainer.GetBlockBlobReference(blobName);
await cloudBlockBlob.DownloadToFileAsync("C:Documentscustomer.json", FileMode.Create);
Delete blob
var cloudBlockBlob = _cloudBlobContainer.GetBlockBlobReference(blobName);
await cloudBlockBlob.DeleteIfExistsAsync();
Queues
• Provide asynchronous cloud messaging between application
components
• A service for storing messages that can be accessed from
anywhere
• Single queue message up to 64 KB in size
• Queue can contain millions of messages
Connect and create queue
private const string queueName = "queue";
private static CloudQueue _cloudQueue;
public Job(string connectionString)
{
var cloudStorageAccount = CloudStorageAccount.Parse(connectionString);
var cloudQueueClient = cloudStorageAccount.CreateCloudQueueClient();
_cloudQueue = cloudQueueClient.GetQueueReference(queueName);
_cloudQueue.CreateIfNotExists();
}
Insert message
var cloudQueueMessage = new CloudQueueMessage("Hello, Jon Snow!");
await _cloudQueue.AddMessageAsync(cloudQueueMessage);
Peek at message
var cloudQueueMessage = await _cloudQueue.PeekMessageAsync();
Console.WriteLine(cloudQueueMessage.AsString);
Update message content
var cloudQueueMessage = await _cloudQueue.GetMessageAsync();
cloudQueueMessage.SetMessageContent("New content.");
_cloudQueue.UpdateMessage(cloudQueueMessage,
TimeSpan.FromSeconds(60.0),
MessageUpdateFields.Content | MessageUpdateFields.Visibility);
Delete message
var cloudQueueMessage = await _cloudQueue.GetMessageAsync();
await _cloudQueue.DeleteMessageAsync(cloudQueueMessage);
Get number of messages
_cloudQueue.FetchAttributes();
var messageCount = _cloudQueue.ApproximateMessageCount;
File shares
• Easy-to-use cloud file system
• Upload, download files
• Can be mounted in Windows, Linux, and macOS
• Snapshots
https://portal.azure.com
Storage accounts
Select storage account
Overview
Files
Performance
Troy Hunt
Credit: https://www.troyhunt.com, Troy Hunt.
Troy Hunt
Credit: https://www.troyhunt.com, Troy Hunt.
Troy Hunt
• 9 simultaneous importers
• Total average speed at 22 500 inserts pr. second
Credit: https://www.troyhunt.com, Troy Hunt.
Credit: https://www.troyhunt.com, Troy Hunt.
Troy Hunt
http://haveibeenpwned.com/HowFastIsAzureTableStorage/?email=troyhunt@hotmail.com
• A query of 154 million records returns result in 4 milliseconds
Credit: https://www.troyhunt.com, Troy Hunt.
vs
vs
• Some similarities
• Table storage lacks backup procedure, while
CosmosDB has it
• Table storage has storage-based pricing, while
CosmosDB has throughput-based
• Table storage is aimed at high capacity on a single
region, while CosmosDB aims at global distribution,
high throughput
• Choosing which depends on different scenarios
Mobile apps
• A good choice for mobile apps
• But Azure Easy Tables is better
- An app service
- Backed by Azure SQL and geared towards
mobile apps
https://github.com/Azure/azure-storage-ios
https://github.com/Azure/azure-storage-android
The way forward
• Azure Table storage lives on (we hope!)
• A need to get further support and new
functionality
• Lack of basic database operations is a problem
• Ease of setup and use is a definite plus, that’s
where Table storage shines
Thanks!
Credit:

Contenu connexe

Tendances

Whats New for WPF in .NET 4.5
Whats New for WPF in .NET 4.5Whats New for WPF in .NET 4.5
Whats New for WPF in .NET 4.5Rainer Stropek
 
Angular 4 with firebase
Angular 4 with firebaseAngular 4 with firebase
Angular 4 with firebaseAnne Bougie
 
The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210Mahmoud Samir Fayed
 
Introducing Asp.Net Ajax 4.0 Preview
Introducing Asp.Net Ajax 4.0 PreviewIntroducing Asp.Net Ajax 4.0 Preview
Introducing Asp.Net Ajax 4.0 PreviewCat Chen
 
Cassandra Day London: Building Java Applications
Cassandra Day London: Building Java ApplicationsCassandra Day London: Building Java Applications
Cassandra Day London: Building Java ApplicationsChristopher Batey
 
Client-side Rendering with AngularJS
Client-side Rendering with AngularJSClient-side Rendering with AngularJS
Client-side Rendering with AngularJSDavid Lapsley
 
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-finalDavid Lapsley
 
Improving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria APIImproving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria APINils Breunese
 
Inside Azure Diagnostics (DevLink 2014)
Inside Azure Diagnostics (DevLink 2014)Inside Azure Diagnostics (DevLink 2014)
Inside Azure Diagnostics (DevLink 2014)Michael Collier
 
A (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesA (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesDavid Wengier
 
Cloud4all settings handlers
Cloud4all settings handlersCloud4all settings handlers
Cloud4all settings handlersicchp2012
 
Building and Deploying Microservices with Event Sourcing, CQRS and Docker
Building and Deploying Microservices with Event Sourcing, CQRS and DockerBuilding and Deploying Microservices with Event Sourcing, CQRS and Docker
Building and Deploying Microservices with Event Sourcing, CQRS and DockerC4Media
 
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019David Wengier
 
Hidden Treasures in Project Wonder
Hidden Treasures in Project WonderHidden Treasures in Project Wonder
Hidden Treasures in Project WonderWO Community
 

Tendances (20)

Whats New for WPF in .NET 4.5
Whats New for WPF in .NET 4.5Whats New for WPF in .NET 4.5
Whats New for WPF in .NET 4.5
 
Ecom2
Ecom2Ecom2
Ecom2
 
Angular 4 with firebase
Angular 4 with firebaseAngular 4 with firebase
Angular 4 with firebase
 
The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210
 
Introducing Asp.Net Ajax 4.0 Preview
Introducing Asp.Net Ajax 4.0 PreviewIntroducing Asp.Net Ajax 4.0 Preview
Introducing Asp.Net Ajax 4.0 Preview
 
Cassandra Day London: Building Java Applications
Cassandra Day London: Building Java ApplicationsCassandra Day London: Building Java Applications
Cassandra Day London: Building Java Applications
 
Bonjour, iCloud
Bonjour, iCloudBonjour, iCloud
Bonjour, iCloud
 
Android query
Android queryAndroid query
Android query
 
Client-side Rendering with AngularJS
Client-side Rendering with AngularJSClient-side Rendering with AngularJS
Client-side Rendering with AngularJS
 
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final
 
Improving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria APIImproving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria API
 
Whats new in iOS5
Whats new in iOS5Whats new in iOS5
Whats new in iOS5
 
Inside Azure Diagnostics (DevLink 2014)
Inside Azure Diagnostics (DevLink 2014)Inside Azure Diagnostics (DevLink 2014)
Inside Azure Diagnostics (DevLink 2014)
 
A (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesA (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project Files
 
Cloud4all settings handlers
Cloud4all settings handlersCloud4all settings handlers
Cloud4all settings handlers
 
Servlets intro
Servlets introServlets intro
Servlets intro
 
Building and Deploying Microservices with Event Sourcing, CQRS and Docker
Building and Deploying Microservices with Event Sourcing, CQRS and DockerBuilding and Deploying Microservices with Event Sourcing, CQRS and Docker
Building and Deploying Microservices with Event Sourcing, CQRS and Docker
 
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
 
Hidden Treasures in Project Wonder
Hidden Treasures in Project WonderHidden Treasures in Project Wonder
Hidden Treasures in Project Wonder
 
Bulk copy
Bulk copyBulk copy
Bulk copy
 

Similaire à Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)

Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)Sirar Salih
 
Cloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWSCloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWSAmine Sadry
 
10 Ways to Gaurantee Your Azure Project will Fail
10 Ways to Gaurantee Your Azure Project will Fail10 Ways to Gaurantee Your Azure Project will Fail
10 Ways to Gaurantee Your Azure Project will FailMichael Collier
 
TechEd 2012 - Сценарии хранения и обработки данных в windows azure
TechEd 2012 - Сценарии хранения и обработки данных в windows azureTechEd 2012 - Сценарии хранения и обработки данных в windows azure
TechEd 2012 - Сценарии хранения и обработки данных в windows azureДенис Резник
 
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade ServerlessKatyShimizu
 
[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade Serverless[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade ServerlessKatyShimizu
 
C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojosdeconf
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showSubhas Malik
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Vendic Magento, PWA & Marketing
 
Change tracking
Change trackingChange tracking
Change trackingSonny56
 
Designing Secure APIs in the Cloud
Designing Secure APIs in the CloudDesigning Secure APIs in the Cloud
Designing Secure APIs in the CloudPostman
 
Solid fire cloudstack storage overview - CloudStack European User Group
Solid fire cloudstack storage overview - CloudStack European User GroupSolid fire cloudstack storage overview - CloudStack European User Group
Solid fire cloudstack storage overview - CloudStack European User GroupShapeBlue
 
CloudStack Meetup London - Primary Storage Presentation by SolidFire
CloudStack Meetup London - Primary Storage Presentation by SolidFire CloudStack Meetup London - Primary Storage Presentation by SolidFire
CloudStack Meetup London - Primary Storage Presentation by SolidFire NetApp
 
Going Serverless with Azure Functions
Going Serverless with Azure FunctionsGoing Serverless with Azure Functions
Going Serverless with Azure FunctionsShahed Chowdhuri
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)Michael Collier
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricWim Van den Broeck
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Servicesukdpe
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile appsIvano Malavolta
 
Talk about html5 security
Talk about html5 securityTalk about html5 security
Talk about html5 securityHuang Toby
 

Similaire à Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk) (20)

Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
 
Cloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWSCloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWS
 
10 Ways to Gaurantee Your Azure Project will Fail
10 Ways to Gaurantee Your Azure Project will Fail10 Ways to Gaurantee Your Azure Project will Fail
10 Ways to Gaurantee Your Azure Project will Fail
 
TechEd 2012 - Сценарии хранения и обработки данных в windows azure
TechEd 2012 - Сценарии хранения и обработки данных в windows azureTechEd 2012 - Сценарии хранения и обработки данных в windows azure
TechEd 2012 - Сценарии хранения и обработки данных в windows azure
 
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
 
[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade Serverless[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Enterprise-Grade Serverless
 
C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojo
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)
 
Change tracking
Change trackingChange tracking
Change tracking
 
Designing Secure APIs in the Cloud
Designing Secure APIs in the CloudDesigning Secure APIs in the Cloud
Designing Secure APIs in the Cloud
 
Solid fire cloudstack storage overview - CloudStack European User Group
Solid fire cloudstack storage overview - CloudStack European User GroupSolid fire cloudstack storage overview - CloudStack European User Group
Solid fire cloudstack storage overview - CloudStack European User Group
 
CloudStack Meetup London - Primary Storage Presentation by SolidFire
CloudStack Meetup London - Primary Storage Presentation by SolidFire CloudStack Meetup London - Primary Storage Presentation by SolidFire
CloudStack Meetup London - Primary Storage Presentation by SolidFire
 
Going Serverless with Azure Functions
Going Serverless with Azure FunctionsGoing Serverless with Azure Functions
Going Serverless with Azure Functions
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabric
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Services
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile apps
 
Talk about html5 security
Talk about html5 securityTalk about html5 security
Talk about html5 security
 

Plus de Sirar Salih

Angular 2 + TypeScript = true. Let's Play!
Angular 2 + TypeScript = true. Let's Play!Angular 2 + TypeScript = true. Let's Play!
Angular 2 + TypeScript = true. Let's Play!Sirar Salih
 
Test Driving AngularJS
Test Driving AngularJSTest Driving AngularJS
Test Driving AngularJSSirar Salih
 
Test Driven Development with AngularJS
Test Driven Development with AngularJSTest Driven Development with AngularJS
Test Driven Development with AngularJSSirar Salih
 
One Framework to Rule Them All
One Framework to Rule Them AllOne Framework to Rule Them All
One Framework to Rule Them AllSirar Salih
 
When Two Forces Meet
When Two Forces MeetWhen Two Forces Meet
When Two Forces MeetSirar Salih
 
Introduction to WPF and MVVM
Introduction to WPF and MVVMIntroduction to WPF and MVVM
Introduction to WPF and MVVMSirar Salih
 
Angularfying Your ASP.NET MVC APP
Angularfying Your ASP.NET MVC APPAngularfying Your ASP.NET MVC APP
Angularfying Your ASP.NET MVC APPSirar Salih
 

Plus de Sirar Salih (8)

Angular 2 + TypeScript = true. Let's Play!
Angular 2 + TypeScript = true. Let's Play!Angular 2 + TypeScript = true. Let's Play!
Angular 2 + TypeScript = true. Let's Play!
 
Test Driving AngularJS
Test Driving AngularJSTest Driving AngularJS
Test Driving AngularJS
 
Test Driven Development with AngularJS
Test Driven Development with AngularJSTest Driven Development with AngularJS
Test Driven Development with AngularJS
 
One Framework to Rule Them All
One Framework to Rule Them AllOne Framework to Rule Them All
One Framework to Rule Them All
 
When Two Forces Meet
When Two Forces MeetWhen Two Forces Meet
When Two Forces Meet
 
Introduction to WPF and MVVM
Introduction to WPF and MVVMIntroduction to WPF and MVVM
Introduction to WPF and MVVM
 
Clean Code
Clean CodeClean Code
Clean Code
 
Angularfying Your ASP.NET MVC APP
Angularfying Your ASP.NET MVC APPAngularfying Your ASP.NET MVC APP
Angularfying Your ASP.NET MVC APP
 

Dernier

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Dernier (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)

  • 1. Sirar Salih Solution Architect at Making Waves The Good, the Bad, the Ugly Azure Table Storage
  • 2. Balancing stakeholder influence and customer needs Hydro is a global enterprise, with many different business stakeholders and content owners who have different needs and priorities. Finding a good balance between corporate consistency and local business relevance while not falling into the trap of designing according to internal organisation rather than the customer can be challenging. Manage Stakeholders Sirar Salih Solution Architect at Making Waves Who Am I? Credit:
  • 4.
  • 5. Each NoSQL database has its good and bad side.
  • 7. Pros • Easy setup • Cheap • Minimal work required • Easy to understand • Simple model: Entity, PartitionKey, RowKey
  • 8. • Low on scalability • Lack of basic database operations - No «like» or «contains» • No backup procedure Cons
  • 11. https://portal.azure.com Storage accounts Select storage account Access keys Connection string
  • 15. private const string tableName = "Customers"; private static CloudTable _cloudTable; public TableStorageService(KeyVaultSecretProvider keyVaultSecretProvider, string storageAccountName, string storageAccountKeyName) { var storageAccountKey = keyVaultSecretProvider.GetSecret(storageAccountKeyName); var connectionString = $"DefaultEndpointsProtocol=https;AccountName={storageAccountName};AccountKey={storageAccountKey};EndpointSuffix=core.windows.net"; var cloudStorageAccount = CloudStorageAccount.Parse(connectionString); var cloudTableClient = cloudStorageAccount.CreateCloudTableClient(); _cloudTable = cloudTableClient.GetTableReference(tableName); } Connect and create table
  • 16. public class CustomerEntity : TableEntity { public CustomerEntity() { } public CustomerEntity(string lastName, string firstName) { PartitionKey = lastName; RowKey = firstName; } } Entity
  • 17. var insertOperation = TableOperation.Insert(new CustomerEntity("Snow", "Jon")); await _cloudTable.ExecuteAsync(insertOperation); Insert entity
  • 18. var tableBatchOperation = new TableBatchOperation(); for(var i = 0; i < 100; i++) { tableBatchOperation.Insert(new CustomerEntity("Snow", $"Jon {i}")); if(i == 99) { await _cloudTable.ExecuteBatchAsync(tableBatchOperation); } } Batch insert entities
  • 19. Get entity var query = new TableQuery<CustomerEntity>() .Where(TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, "Jon")); _cloudTable.ExecuteQuery(query);
  • 20. Delete entity var retrieveOperation = TableOperation.Retrieve<CustomerEntity>("Snow", "Jon"); var retrievedResult = await _cloudTable.ExecuteAsync(retrieveOperation); var deleteEntity = (CustomerEntity)retrievedResult.Result; var deleteOperation = TableOperation.Delete(deleteEntity); await _cloudTable.ExecuteAsync(deleteOperation);
  • 21. Blob containers • Blob container: Similar to a folder, containing a collection of blobs • Blob: A file of any format
  • 22. Connect and create blob container private const string CustomersContainerName = "customers"; private static CloudBlobContainer _cloudBlobContainer; public Job(string connectionString) { var cloudStorageAccount = CloudStorageAccount.Parse(connectionString); var cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient(); _cloudBlobContainer = cloudBlobClient.GetContainerReference(CustomersContainerName); if (!_cloudBlobContainer.Exists()) _cloudBlobContainer.Create(); }
  • 23. Upload blob var cloudBlockBlob = _cloudBlobContainer.GetBlockBlobReference(blobName); cloudBlockBlob.Properties.ContentType = "application/json"; using (var ms = new MemoryStream()) { var j = JsonConvert.SerializeObject(json); var writer = new StreamWriter(ms); writer.Write(j); writer.Flush(); ms.Position = 0; cloudBlockBlob.UploadFromStream(ms); }
  • 24. Download blob var cloudBlockBlob = _cloudBlobContainer.GetBlockBlobReference(blobName); await cloudBlockBlob.DownloadToFileAsync("C:Documentscustomer.json", FileMode.Create);
  • 25. Delete blob var cloudBlockBlob = _cloudBlobContainer.GetBlockBlobReference(blobName); await cloudBlockBlob.DeleteIfExistsAsync();
  • 26. Queues • Provide asynchronous cloud messaging between application components • A service for storing messages that can be accessed from anywhere • Single queue message up to 64 KB in size • Queue can contain millions of messages
  • 27. Connect and create queue private const string queueName = "queue"; private static CloudQueue _cloudQueue; public Job(string connectionString) { var cloudStorageAccount = CloudStorageAccount.Parse(connectionString); var cloudQueueClient = cloudStorageAccount.CreateCloudQueueClient(); _cloudQueue = cloudQueueClient.GetQueueReference(queueName); _cloudQueue.CreateIfNotExists(); }
  • 28. Insert message var cloudQueueMessage = new CloudQueueMessage("Hello, Jon Snow!"); await _cloudQueue.AddMessageAsync(cloudQueueMessage);
  • 29. Peek at message var cloudQueueMessage = await _cloudQueue.PeekMessageAsync(); Console.WriteLine(cloudQueueMessage.AsString);
  • 30. Update message content var cloudQueueMessage = await _cloudQueue.GetMessageAsync(); cloudQueueMessage.SetMessageContent("New content."); _cloudQueue.UpdateMessage(cloudQueueMessage, TimeSpan.FromSeconds(60.0), MessageUpdateFields.Content | MessageUpdateFields.Visibility);
  • 31. Delete message var cloudQueueMessage = await _cloudQueue.GetMessageAsync(); await _cloudQueue.DeleteMessageAsync(cloudQueueMessage);
  • 32. Get number of messages _cloudQueue.FetchAttributes(); var messageCount = _cloudQueue.ApproximateMessageCount;
  • 33. File shares • Easy-to-use cloud file system • Upload, download files • Can be mounted in Windows, Linux, and macOS • Snapshots
  • 38. Troy Hunt • 9 simultaneous importers • Total average speed at 22 500 inserts pr. second Credit: https://www.troyhunt.com, Troy Hunt. Credit: https://www.troyhunt.com, Troy Hunt.
  • 39. Troy Hunt http://haveibeenpwned.com/HowFastIsAzureTableStorage/?email=troyhunt@hotmail.com • A query of 154 million records returns result in 4 milliseconds Credit: https://www.troyhunt.com, Troy Hunt.
  • 40. vs
  • 41. vs • Some similarities • Table storage lacks backup procedure, while CosmosDB has it • Table storage has storage-based pricing, while CosmosDB has throughput-based • Table storage is aimed at high capacity on a single region, while CosmosDB aims at global distribution, high throughput • Choosing which depends on different scenarios
  • 42. Mobile apps • A good choice for mobile apps • But Azure Easy Tables is better - An app service - Backed by Azure SQL and geared towards mobile apps
  • 45. The way forward • Azure Table storage lives on (we hope!) • A need to get further support and new functionality • Lack of basic database operations is a problem • Ease of setup and use is a definite plus, that’s where Table storage shines