SlideShare a Scribd company logo
Windows Azure Storage
Overview, Internals and Best Practices
Sponsors
About me








Program Manager @ Edgar Online, RRD
Windows Azure MVP
Co-organizer of Odessa .NET User Group
Ukrainian IT Awards 2013 Winner – Software Engineering
http://cloudytimes.azurewebsites.net/
http://www.linkedin.com/in/antonvidishchev
https://www.facebook.com/anton.vidishchev
What is Windows Azure Storage?
Windows Azure Storage
 Cloud Storage - Anywhere and anytime access
 Blobs, Disks, Tables and Queues

 Highly Durable, Available and Massively Scalable
 Easily build “internet scale” applications
 10 trillion stored objects
 900K request/sec on average (2.3+ trillion per month)

 Pay for what you use
 Exposed via easy and open REST APIs
 Client libraries in .NET, Java, Node.js, Python, PHP,
Ruby
Abstractions – Blobs and Disks
Abstractions – Tables and Queues
Data centers
Windows Azure Data Storage Concepts

Container

Blobs

https://<account>.blob.core.windows.net/<container>

Account

Table

Entities

https://<account>.table.core.windows.net/<table>

Queue

Messages

https://<account>.queue.core.windows.net/<queue>
How is Azure Storage used by Microsoft?
Internals
Design Goals
Highly Available with Strong Consistency
 Provide access to data in face of failures/partitioning

Durability
 Replicate data several times within and across regions

Scalability
 Need to scale to zettabytes
 Provide a global namespace to access data around
the world
 Automatically scale out and load balance data to
meet peak traffic demands
Windows Azure Storage Stamps
Access blob storage via the URL: http://<account>.blob.core.windows.net/

Data access

Storage
Location
Service

LB

LB

Front-Ends

Front-Ends

Partition Layer

Partition Layer

Inter-stamp (Geo) replication

DFS Layer

DFS Layer

Intra-stamp replication

Intra-stamp replication

Storage Stamp

Storage Stamp
Architecture Layers inside Stamps

Partition Layer

Index
Availability with Consistency for Writing
All writes are appends to the end of a log, which is
an append to the last extent in the log
Write Consistency across all replicas for an
extent:
 Appends are ordered the same across all
3 replicas for an extent (file)
 Only return success if all 3 replica
appends are committed to storage
 When extent gets to a certain size or on
write failure/LB, seal the extent’s replica
set and never append anymore data to it

Write Availability: To handle failures during write
 Seal extent’s replica set
 Append immediately to a new extent
(replica set) on 3 other available nodes
 Add this new extent to the end of the
partition’s log (stream)

Partition Layer
Availability with Consistency for Reading
Read Consistency: Can
read from any replica, since
data in each replica for an
extent is bit-wise identical

Read Availability: Send out
parallel read requests if first
read is taking higher than
95% latency

Partition Layer
Dynamic Load Balancing – Partition Layer
Spreads index/transaction processing
across partition servers
 Master monitors traffic
load/resource utilization on
partition servers
 Dynamically load balance
partitions across servers to
achieve better
performance/availability



Does not move data around, only
reassigns what part of the index a
partition server is responsible for

Partition Layer

Index
Dynamic Load Balancing – DFS Layer
DFS Read load balancing across replicas
 Monitor latency/load on each
node/replica; dynamically select
what replica to read from and start
additional reads in parallel based on
95% latency

Partition Layer
Architecture Summary
 Durability: All data stored with at least 3 replicas
 Consistency: All committed data across all 3 replicas are identical
 Availability: Can read from any 3 replicas; If any issues writing seal
extent and continue appending to new extent
 Performance/Scale: Retry based on 95% latencies; Auto scale out and
load balance based on load/capacity



Additional details can be found in the SOSP paper:

 “Windows Azure Storage: A Highly Available Cloud Storage Service with Strong
Consistency”, ACM Symposium on Operating System Principals (SOSP), Oct.
2011
Best Practices
General .NET Best Practices For Azure
Storage
 Disable Nagle for small messages (< 1400 b)
 ServicePointManager.UseNagleAlgorithm = false;

 Disable Expect 100-Continue*
 ServicePointManager.Expect100Continue = false;

 Increase default connection limit
 ServicePointManager.DefaultConnectionLimit = 100; (Or
More)

 Take advantage of .Net 4.5 GC
 GC performance is greatly improved
 Background GC: http://msdn.microsoft.com/enus/magazine/hh882452.aspx
General Best Practices
 Locate Storage accounts close to compute/users
 Understand Account Scalability targets

 Use multiple storage accounts to get more
 Distribute your storage accounts across regions

 Consider heating up the storage for better
performance
 Cache critical data sets

 To get more request/sec than the account/partition targets
 As a Backup data set to fall back on

 Distribute load over many partitions and avoid
spikes
General Best Practices (cont.)
 Use HTTPS
 Optimize what you send & receive

 Blobs: Range reads, Metadata, Head Requests
 Tables: Upsert, Projection, Point Queries
 Queues: Update Message

 Control Parallelism at the application layer

 Unbounded Parallelism can lead to slow latencies and
throttling

 Enable Logging & Metrics on each storage
service
Blob Best Practices
 Try to match your read size with your write size
 Avoid reading small ranges on blobs with large blocks
 CloudBlockBlob.StreamMinimumReadSizeInBytes/
StreamWriteSizeInBytes

 How do I upload a folder the fastest?
 Upload multiple blobs simultaneously

 How do I upload a blob the fastest?
 Use parallel block upload

 Concurrency (C)- Multiple workers upload different
blobs
 Parallelism (P) – Multiple workers upload different
blocks for same blob
Concurrency Vs. Blob Parallelism

•
•
•

C=1, P=1 => Averaged ~ 13. 2 MB/s
C=1, P=30 => Averaged ~ 50.72 MB/s
C=30, P=1 => Averaged ~ 96.64 MB/s

• Single TCP connection is bound by
TCP rate control & RTT
• P=30 vs. C=30: Test completed
almost twice as fast!
• Single Blob is bound by the limits
of a single partition
• Accessing multiple blobs
concurrently scales

10000
8000
6000
4000
2000

Time (s)

XL VM Uploading 512, 256MB
Blobs (Total upload size =
128GB)

0
Blob Download
 XL VM Downloading
50, 256MB Blobs (Total
download size = 12.5GB)
C=1, P=1 => Averaged ~ 96 MB/s
C=30, P=1 => Averaged ~ 130 MB/s

120

Time (s)

•
•

140

100

80
60
40
20
0
C=1, P=1

C=30, P=1
Table Best Practices
 Critical Queries: Select PartitionKey, RowKey to avoid hotspots

 Table Scans are expensive – avoid them at all costs for latency sensitive
scenarios

 Batch: Same PartitionKey for entities that need to be updated
together
 Schema-less: Store multiple types in same table
 Single Index – {PartitionKey, RowKey}: If needed, concatenate
columns to form composite keys
 Entity Locality: {PartitionKey, RowKey} determines sort order

 Store related entites together to reduce IO and improve performance

 Table Service Client Layer in 2.1 and 2.2: Dramatic performance
improvements and better NoSQL interface
Queue Best Practices
 Make message processing idempotent: Messages
become visible if client worker fails to delete
message
 Benefit from Update Message: Extend visibility time
based on message or save intermittent state
 Message Count: Use this to scale workers
 Dequeue Count: Use it to identify poison messages
or validity of invisibility time used
 Blobs to store large messages: Increase throughput
by having larger batches
 Multiple Queues: To get more than a single queue
(partition) target
Thank you!
 Q&A

More Related Content

PPTX
Patterns of parallel programming
PDF
LOAD BALANCING ALGORITHM TO IMPROVE RESPONSE TIME ON CLOUD COMPUTING
PPTX
Slide #1:Introduction to Apache Storm
PDF
Apache Storm
PPTX
System Design & Scalability
PPTX
PPTX
Multi-Tenant Storm Service on Hadoop Grid
PPTX
GoodFit: Multi-Resource Packing of Tasks with Dependencies
Patterns of parallel programming
LOAD BALANCING ALGORITHM TO IMPROVE RESPONSE TIME ON CLOUD COMPUTING
Slide #1:Introduction to Apache Storm
Apache Storm
System Design & Scalability
Multi-Tenant Storm Service on Hadoop Grid
GoodFit: Multi-Resource Packing of Tasks with Dependencies

What's hot (20)

PDF
Apache Storm
PPTX
Resource Aware Scheduling in Apache Storm
PDF
Apache Storm Tutorial
PPTX
Apache Storm Internals
PPTX
MongoDB Backup & Disaster Recovery
PDF
Real-time Big Data Processing with Storm
PPTX
Introduction to Storm
PDF
PHP Backends for Real-Time User Interaction using Apache Storm.
PPTX
Scaling Apache Storm (Hadoop Summit 2015)
PPTX
Databricks clusters in autopilot mode
PDF
Training Slides: 151 - Tungsten Replicator - Moving your Data
PDF
Introduction to Apache Storm
PPTX
Hadoop performance optimization tips
PPTX
Stream Processing Frameworks
PPTX
Cassandra Backups and Restorations Using Ansible (Joshua Wickman, Knewton) | ...
PPTX
Apache Storm and twitter Streaming API integration
PDF
Storm Real Time Computation
PDF
Graphite & Metrictank - Meetup Tel Aviv Yafo
PDF
Hands on MapR -- Viadea
PDF
Storm: The Real-Time Layer - GlueCon 2012
Apache Storm
Resource Aware Scheduling in Apache Storm
Apache Storm Tutorial
Apache Storm Internals
MongoDB Backup & Disaster Recovery
Real-time Big Data Processing with Storm
Introduction to Storm
PHP Backends for Real-Time User Interaction using Apache Storm.
Scaling Apache Storm (Hadoop Summit 2015)
Databricks clusters in autopilot mode
Training Slides: 151 - Tungsten Replicator - Moving your Data
Introduction to Apache Storm
Hadoop performance optimization tips
Stream Processing Frameworks
Cassandra Backups and Restorations Using Ansible (Joshua Wickman, Knewton) | ...
Apache Storm and twitter Streaming API integration
Storm Real Time Computation
Graphite & Metrictank - Meetup Tel Aviv Yafo
Hands on MapR -- Viadea
Storm: The Real-Time Layer - GlueCon 2012
Ad

Viewers also liked (7)

PPTX
Bdd by Dmitri Aizenberg
PPTX
Object-2-Object mapping, как приправа к вашему проекту
PPTX
PPTX
Microsoft Office 2013 новая модель разработки приложений
PPTX
Deep Dive C# by Sergey Teplyakov
PPTX
Async clinic by by Sergey Teplyakov
PPTX
Bdd by Dmitri Aizenberg
Object-2-Object mapping, как приправа к вашему проекту
Microsoft Office 2013 новая модель разработки приложений
Deep Dive C# by Sergey Teplyakov
Async clinic by by Sergey Teplyakov
Ad

Similar to Sql saturday azure storage by Anton Vidishchev (20)

PPTX
Cnam azure 2014 storage
PPTX
Cnam azure 2015 storage
PPTX
Microsoft cloud 101
PPTX
Microsoft Azure
PPTX
Windows azure camp - Kolkata
PDF
Escalabilidad horizontal y arquitecturas elásticas en Microsoft azure
PPTX
Windows Azure Storage – Architecture View
PPT
Building Cloud-Native Applications with Microsoft Windows Azure
PDF
Building Real World Application with Azure
PPTX
Creation of cloud application using microsoft azure by vaishali sahare [katkar]
PPTX
Patterns in the cloud
PPTX
[NetPonto] NoSQL em Windows Azure Table Storage
PPTX
Azure Storage – Foundation for Building Secure, Scalable Cloud Applications
PPTX
A Lap Around Azure
PPTX
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
PPTX
Windows azure camp
PPTX
Azure, Cloud Computing & Services
PPTX
Azure Fundamentals Part 2
 
PPTX
Tour de France Azure PaaS 3/7 Stocker des informations
Cnam azure 2014 storage
Cnam azure 2015 storage
Microsoft cloud 101
Microsoft Azure
Windows azure camp - Kolkata
Escalabilidad horizontal y arquitecturas elásticas en Microsoft azure
Windows Azure Storage – Architecture View
Building Cloud-Native Applications with Microsoft Windows Azure
Building Real World Application with Azure
Creation of cloud application using microsoft azure by vaishali sahare [katkar]
Patterns in the cloud
[NetPonto] NoSQL em Windows Azure Table Storage
Azure Storage – Foundation for Building Secure, Scalable Cloud Applications
A Lap Around Azure
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Windows azure camp
Azure, Cloud Computing & Services
Azure Fundamentals Part 2
 
Tour de France Azure PaaS 3/7 Stocker des informations

More from Alex Tumanoff (20)

PPTX
Sql server 2019 New Features by Yevhen Nedaskivskyi
PPTX
Odessa .net-user-group-sql-server-2019-hidden-gems by Denis Reznik
PPTX
Azure data bricks by Eugene Polonichko
PPTX
Sdlc by Anatoliy Anthony Cox
PPTX
Kostenko ux november-2014_1
PPTX
Java 8 in action.jinq.v.1.3
PPT
"Drools: декларативная бизнес-логика в Java-приложениях" by Дмитрий Контрерас...
PPTX
Spring.new hope.1.3
PPTX
Navigation map factory by Alexey Klimenko
PPTX
Serialization and performance by Sergey Morenets
PPTX
Игры для мобильных платформ by Алексей Рыбаков
PDF
Android sync adapter
PPTX
Неформальные размышления о сертификации в IT
PPTX
Разработка расширений Firefox
PPTX
"AnnotatedSQL - провайдер с плюшками за 5 минут" - Геннадий Дубина, Senior So...
PPTX
Lambda выражения и Java 8
PPTX
XP практики в проектах с тяжелой наследственностью
PPTX
Anti patterns
PPTX
Первые шаги во фрилансе
PPTX
Spring Web Flow. A little flow of happiness.
Sql server 2019 New Features by Yevhen Nedaskivskyi
Odessa .net-user-group-sql-server-2019-hidden-gems by Denis Reznik
Azure data bricks by Eugene Polonichko
Sdlc by Anatoliy Anthony Cox
Kostenko ux november-2014_1
Java 8 in action.jinq.v.1.3
"Drools: декларативная бизнес-логика в Java-приложениях" by Дмитрий Контрерас...
Spring.new hope.1.3
Navigation map factory by Alexey Klimenko
Serialization and performance by Sergey Morenets
Игры для мобильных платформ by Алексей Рыбаков
Android sync adapter
Неформальные размышления о сертификации в IT
Разработка расширений Firefox
"AnnotatedSQL - провайдер с плюшками за 5 минут" - Геннадий Дубина, Senior So...
Lambda выражения и Java 8
XP практики в проектах с тяжелой наследственностью
Anti patterns
Первые шаги во фрилансе
Spring Web Flow. A little flow of happiness.

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
KodekX | Application Modernization Development
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPT
Teaching material agriculture food technology
PPTX
A Presentation on Artificial Intelligence
PDF
Modernizing your data center with Dell and AMD
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
KodekX | Application Modernization Development
Reach Out and Touch Someone: Haptics and Empathic Computing
The AUB Centre for AI in Media Proposal.docx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Teaching material agriculture food technology
A Presentation on Artificial Intelligence
Modernizing your data center with Dell and AMD
Diabetes mellitus diagnosis method based random forest with bat algorithm

Sql saturday azure storage by Anton Vidishchev

  • 1. Windows Azure Storage Overview, Internals and Best Practices
  • 3. About me        Program Manager @ Edgar Online, RRD Windows Azure MVP Co-organizer of Odessa .NET User Group Ukrainian IT Awards 2013 Winner – Software Engineering http://cloudytimes.azurewebsites.net/ http://www.linkedin.com/in/antonvidishchev https://www.facebook.com/anton.vidishchev
  • 4. What is Windows Azure Storage?
  • 5. Windows Azure Storage  Cloud Storage - Anywhere and anytime access  Blobs, Disks, Tables and Queues  Highly Durable, Available and Massively Scalable  Easily build “internet scale” applications  10 trillion stored objects  900K request/sec on average (2.3+ trillion per month)  Pay for what you use  Exposed via easy and open REST APIs  Client libraries in .NET, Java, Node.js, Python, PHP, Ruby
  • 9. Windows Azure Data Storage Concepts Container Blobs https://<account>.blob.core.windows.net/<container> Account Table Entities https://<account>.table.core.windows.net/<table> Queue Messages https://<account>.queue.core.windows.net/<queue>
  • 10. How is Azure Storage used by Microsoft?
  • 12. Design Goals Highly Available with Strong Consistency  Provide access to data in face of failures/partitioning Durability  Replicate data several times within and across regions Scalability  Need to scale to zettabytes  Provide a global namespace to access data around the world  Automatically scale out and load balance data to meet peak traffic demands
  • 13. Windows Azure Storage Stamps Access blob storage via the URL: http://<account>.blob.core.windows.net/ Data access Storage Location Service LB LB Front-Ends Front-Ends Partition Layer Partition Layer Inter-stamp (Geo) replication DFS Layer DFS Layer Intra-stamp replication Intra-stamp replication Storage Stamp Storage Stamp
  • 14. Architecture Layers inside Stamps Partition Layer Index
  • 15. Availability with Consistency for Writing All writes are appends to the end of a log, which is an append to the last extent in the log Write Consistency across all replicas for an extent:  Appends are ordered the same across all 3 replicas for an extent (file)  Only return success if all 3 replica appends are committed to storage  When extent gets to a certain size or on write failure/LB, seal the extent’s replica set and never append anymore data to it Write Availability: To handle failures during write  Seal extent’s replica set  Append immediately to a new extent (replica set) on 3 other available nodes  Add this new extent to the end of the partition’s log (stream) Partition Layer
  • 16. Availability with Consistency for Reading Read Consistency: Can read from any replica, since data in each replica for an extent is bit-wise identical Read Availability: Send out parallel read requests if first read is taking higher than 95% latency Partition Layer
  • 17. Dynamic Load Balancing – Partition Layer Spreads index/transaction processing across partition servers  Master monitors traffic load/resource utilization on partition servers  Dynamically load balance partitions across servers to achieve better performance/availability  Does not move data around, only reassigns what part of the index a partition server is responsible for Partition Layer Index
  • 18. Dynamic Load Balancing – DFS Layer DFS Read load balancing across replicas  Monitor latency/load on each node/replica; dynamically select what replica to read from and start additional reads in parallel based on 95% latency Partition Layer
  • 19. Architecture Summary  Durability: All data stored with at least 3 replicas  Consistency: All committed data across all 3 replicas are identical  Availability: Can read from any 3 replicas; If any issues writing seal extent and continue appending to new extent  Performance/Scale: Retry based on 95% latencies; Auto scale out and load balance based on load/capacity  Additional details can be found in the SOSP paper:  “Windows Azure Storage: A Highly Available Cloud Storage Service with Strong Consistency”, ACM Symposium on Operating System Principals (SOSP), Oct. 2011
  • 21. General .NET Best Practices For Azure Storage  Disable Nagle for small messages (< 1400 b)  ServicePointManager.UseNagleAlgorithm = false;  Disable Expect 100-Continue*  ServicePointManager.Expect100Continue = false;  Increase default connection limit  ServicePointManager.DefaultConnectionLimit = 100; (Or More)  Take advantage of .Net 4.5 GC  GC performance is greatly improved  Background GC: http://msdn.microsoft.com/enus/magazine/hh882452.aspx
  • 22. General Best Practices  Locate Storage accounts close to compute/users  Understand Account Scalability targets  Use multiple storage accounts to get more  Distribute your storage accounts across regions  Consider heating up the storage for better performance  Cache critical data sets  To get more request/sec than the account/partition targets  As a Backup data set to fall back on  Distribute load over many partitions and avoid spikes
  • 23. General Best Practices (cont.)  Use HTTPS  Optimize what you send & receive  Blobs: Range reads, Metadata, Head Requests  Tables: Upsert, Projection, Point Queries  Queues: Update Message  Control Parallelism at the application layer  Unbounded Parallelism can lead to slow latencies and throttling  Enable Logging & Metrics on each storage service
  • 24. Blob Best Practices  Try to match your read size with your write size  Avoid reading small ranges on blobs with large blocks  CloudBlockBlob.StreamMinimumReadSizeInBytes/ StreamWriteSizeInBytes  How do I upload a folder the fastest?  Upload multiple blobs simultaneously  How do I upload a blob the fastest?  Use parallel block upload  Concurrency (C)- Multiple workers upload different blobs  Parallelism (P) – Multiple workers upload different blocks for same blob
  • 25. Concurrency Vs. Blob Parallelism • • • C=1, P=1 => Averaged ~ 13. 2 MB/s C=1, P=30 => Averaged ~ 50.72 MB/s C=30, P=1 => Averaged ~ 96.64 MB/s • Single TCP connection is bound by TCP rate control & RTT • P=30 vs. C=30: Test completed almost twice as fast! • Single Blob is bound by the limits of a single partition • Accessing multiple blobs concurrently scales 10000 8000 6000 4000 2000 Time (s) XL VM Uploading 512, 256MB Blobs (Total upload size = 128GB) 0
  • 26. Blob Download  XL VM Downloading 50, 256MB Blobs (Total download size = 12.5GB) C=1, P=1 => Averaged ~ 96 MB/s C=30, P=1 => Averaged ~ 130 MB/s 120 Time (s) • • 140 100 80 60 40 20 0 C=1, P=1 C=30, P=1
  • 27. Table Best Practices  Critical Queries: Select PartitionKey, RowKey to avoid hotspots  Table Scans are expensive – avoid them at all costs for latency sensitive scenarios  Batch: Same PartitionKey for entities that need to be updated together  Schema-less: Store multiple types in same table  Single Index – {PartitionKey, RowKey}: If needed, concatenate columns to form composite keys  Entity Locality: {PartitionKey, RowKey} determines sort order  Store related entites together to reduce IO and improve performance  Table Service Client Layer in 2.1 and 2.2: Dramatic performance improvements and better NoSQL interface
  • 28. Queue Best Practices  Make message processing idempotent: Messages become visible if client worker fails to delete message  Benefit from Update Message: Extend visibility time based on message or save intermittent state  Message Count: Use this to scale workers  Dequeue Count: Use it to identify poison messages or validity of invisibility time used  Blobs to store large messages: Increase throughput by having larger batches  Multiple Queues: To get more than a single queue (partition) target