SlideShare a Scribd company logo
1 of 48
Azure SQL DWH: Tips and Tricks
for developers
Sergiy Lunyakin
About me
Agenda
Scale up
vs Scale Out
One bucket (motherboard)
Contains all the water (resources)
Drinking through straws (logical procs)
Sometimes you only get one straw…
Scaling up
SMP = Scaling UP
Scaling out: The ultimate team game…
01
02
03
04
MPP
=
Scaling
OUT
Architecture
What is Azure SQL DW
Architecture of Azure SQL DW
Dist_DB_1
Dist_DB_2
Dist_DB_15
…
Dist_DB_16
Dist_DB_17
Dist_DB_30
…
…
…
…
Dist_DB_46
Dist_DB_47
Dist_DB_60
…
Control
ComputeStorage
Logical Overview
Sizing
Sizing factors
Introducing DWU
ALTER DATABASE ContosoRetailDW
MODIFY
(service_objective = 'DW1000')
;
DWU
Workloads
Analytical workloads
• Store large volumes of data. Supports a maximum
compressed size 240TB, that potentially is a
Petabyte uncompressed data.
• Consolidate disparate data into a single location
• Shape, model, transform and aggregate data
• Perform batch processing query across large
datasets
• Ad-hoc reporting across large data volume
Unsuitable workloads
OLTP workloads
• High frequency reads&writes
• Large numbers of singleton selects
• High volumes of single row inserts
Procedural ETL
• Row by row processing needs
• Incompatible formats (JSON,XML)
Compute Consumption
Azure Data Lake & SQL DW
Source for SSAS
Polybase
Azure SQL database
Web
Data Factory
Storage blob
SSAS
Distributions
Distributions
* Selecting the right distribution method is key for good performance
Round Robin Distribution
1
3
1
4
1
6
1
5
1
7
1
8
2
0
1
9
2
1
2
2
2
4
2
3
2
5
2
6
2
8
2
7
2
9
3
0
3
2
3
1
3
3
3
4
3
6
3
5
3
7
3
8
4
0
3
9
4
1
4
2
4
4
4
3
4
5
4
6
4
8
4
7
4
9
5
0
5
2
5
1
5
3
5
4
5
6
5
5
5
7
5
8
6
0
5
9
0
1
0
2
0
4
0
3
0
5
0
6
0
8
0
7
0
9
1
0
1
2
1
1
HASH Distribution
1
3
1
4
1
6
1
5
1
7
1
8
2
0
1
9
2
1
2
2
2
4
2
3
2
5
2
6
2
8
2
7
2
9
3
0
3
2
3
1
3
3
3
4
3
6
3
5
3
7
3
8
4
0
3
9
4
1
4
2
4
4
4
3
4
5
4
6
4
8
4
7
4
9
5
0
5
2
5
1
5
3
5
4
5
6
5
5
5
7
5
8
6
0
5
9
0
1
0
2
0
4
0
3
0
5
0
6
0
8
0
7
0
9
1
0
1
2
1
1
HASH ( )N01020301
Joining HASH tables
Joining HASH tables
Hash distribution key guidance
• Distribution key is not updateable!
Node 00
Node 01
Node 02
Node 03
Node 04
Node 05
Node 06
PRODUCTPRODUCTPRODUCTPRODUCTPRODUCTPRODUCTSALESPRODUCT
Replicated (vs. hash distributed)
Skewed Distribution
01
02
03
04
Distribution compatibility
HASH
ROUND ROBIN
REPLICATED
Control
ComputeStorage
Distributed queries
Distributed Query
SELECT COUNT_BIG(*)
FROM dbo.[FactInternetSales]
;
SELECT SUM(*)
FROM dbo.[FactInternetSales]
;
SELECT COUNT_BIG(*)
FROM dbo.[FactInternetSales]
;
SELECT COUNT_BIG(*)
FROM dbo.[FactInternetSales]
;
SELECT COUNT_BIG(*)
FROM dbo.[FactInternetSales]
;
SELECT COUNT_BIG(*)
FROM dbo.[FactInternetSales]
;
Compute
Control
Data Loading
Options
Parallel
PolyBase
Azure Data Factory (PolyBase)
SSIS (Azure SQL DW Comp)
Single Gated Client
bcp / Insert Bulk
SQLBulkCopy
SSIS (data flow)
Azure Data Factory
Single Gated Client
DMS
DMS
DMS
DMS
Single Gated Client Parallelised
DMS
DMS
DMS
DMS
Parallel Loading with PolyBase
DMS
DMS
DMS
DMS
Sizing for the data load
DWU Readers Writers
Compressed text limits
concurrent access to
text files
Split data across files
OR
Use different file format
Dedicate user for data loading
Post Provisioning
Limitations
Limitations
• Primary/Foreign Keys
• Identity
• Computed Columns
• Triggers
• Cross-database joins
• Sequences
• Cursors
• MERGE
• ANSI joins on updates/deletes
https://feedback.azure.com/forums/307516-
sql-data-warehouse
More limitations:
https://azure.microsoft.com/en-
us/documentation/articles/sql-data-warehouse-
migrate-code/
Check compatibility
• Data warehouse migration utility
• Free tool
• Helps to identify unsupported features
• Helps to identify HASH distribution column
• Migrate scheama
• Migrate data (BCP tool)
Cross-database query
• Azure SQL DW doesn’t support cross-database query.
• Use ELT approach. Separate schemas.
• Use External tables as staging tables.
CTAS
• CTAS is super-charched version of SELECT...INTO
• Parallelized
• Better for
 Data import
 Data copy
 Workarounds
CREATE TABLE
[dbo].[FactInternetSales_new]
WITH
(
DISTRIBUTION = ROUND_ROBIN
, CLUSTERED COLUMNSTORE INDEX
)
AS
SELECT *
FROM
[dbo].[FactInternetSales];
Identity
• Handle it on source side
• IDENTITY property
 Explicit import
 Doesn’t support CTAS
• Custom Identity with ROW_NUMBER
ANSI JOINS Update/Del/Merge
• Update/Delete doesn’t support JOINS in FROM
• Use CTAS for preparing interim table with JOINS
• Use CTAS for Merge workaround
 Split Merge to operation steps and use UNION ALL
 Use interim table for big number of steps
 Use partitioning for big tables, don’t reload the
whole table
Compute columns
• Handle it in a source system
• Use CTAS during import
• Create a View
• Use explicit data type and nullability check in you
calculation expressions
 Wrong data during migration
 Schema error during partition switch
Cursor
• Use WHILE for lopping
 Prepare a list of elements as a table
 Loop through this list using While clause and
variable
 Do some action
Questions?

More Related Content

More from Olga Zinkevych

Ai big dataconference_volodymyr getmanskyi colorization distance measuring
Ai big dataconference_volodymyr getmanskyi colorization distance measuringAi big dataconference_volodymyr getmanskyi colorization distance measuring
Ai big dataconference_volodymyr getmanskyi colorization distance measuringOlga Zinkevych
 
Ai big dataconference_taras firman how to build advanced prediction with addi...
Ai big dataconference_taras firman how to build advanced prediction with addi...Ai big dataconference_taras firman how to build advanced prediction with addi...
Ai big dataconference_taras firman how to build advanced prediction with addi...Olga Zinkevych
 
Ai big dataconference_sparkinonehour_vitalii bashun
Ai big dataconference_sparkinonehour_vitalii bashunAi big dataconference_sparkinonehour_vitalii bashun
Ai big dataconference_sparkinonehour_vitalii bashunOlga Zinkevych
 
Ai big dataconference_semantic image segmentatation using word embeddings_ole...
Ai big dataconference_semantic image segmentatation using word embeddings_ole...Ai big dataconference_semantic image segmentatation using word embeddings_ole...
Ai big dataconference_semantic image segmentatation using word embeddings_ole...Olga Zinkevych
 
Ai big dataconference_ml_fastdata_vitalii bondarenko
Ai big dataconference_ml_fastdata_vitalii bondarenkoAi big dataconference_ml_fastdata_vitalii bondarenko
Ai big dataconference_ml_fastdata_vitalii bondarenkoOlga Zinkevych
 
Ai big dataconference_krakovetskyi_microsoft ai a new era of smart solutions
Ai big dataconference_krakovetskyi_microsoft ai a new era of smart solutionsAi big dataconference_krakovetskyi_microsoft ai a new era of smart solutions
Ai big dataconference_krakovetskyi_microsoft ai a new era of smart solutionsOlga Zinkevych
 
Ai big dataconference_jeffrey ricker_kappa_architecture
Ai big dataconference_jeffrey ricker_kappa_architectureAi big dataconference_jeffrey ricker_kappa_architecture
Ai big dataconference_jeffrey ricker_kappa_architectureOlga Zinkevych
 
Ai big dataconference_eugene_polonichko_azure data lake
Ai big dataconference_eugene_polonichko_azure data lake Ai big dataconference_eugene_polonichko_azure data lake
Ai big dataconference_eugene_polonichko_azure data lake Olga Zinkevych
 

More from Olga Zinkevych (8)

Ai big dataconference_volodymyr getmanskyi colorization distance measuring
Ai big dataconference_volodymyr getmanskyi colorization distance measuringAi big dataconference_volodymyr getmanskyi colorization distance measuring
Ai big dataconference_volodymyr getmanskyi colorization distance measuring
 
Ai big dataconference_taras firman how to build advanced prediction with addi...
Ai big dataconference_taras firman how to build advanced prediction with addi...Ai big dataconference_taras firman how to build advanced prediction with addi...
Ai big dataconference_taras firman how to build advanced prediction with addi...
 
Ai big dataconference_sparkinonehour_vitalii bashun
Ai big dataconference_sparkinonehour_vitalii bashunAi big dataconference_sparkinonehour_vitalii bashun
Ai big dataconference_sparkinonehour_vitalii bashun
 
Ai big dataconference_semantic image segmentatation using word embeddings_ole...
Ai big dataconference_semantic image segmentatation using word embeddings_ole...Ai big dataconference_semantic image segmentatation using word embeddings_ole...
Ai big dataconference_semantic image segmentatation using word embeddings_ole...
 
Ai big dataconference_ml_fastdata_vitalii bondarenko
Ai big dataconference_ml_fastdata_vitalii bondarenkoAi big dataconference_ml_fastdata_vitalii bondarenko
Ai big dataconference_ml_fastdata_vitalii bondarenko
 
Ai big dataconference_krakovetskyi_microsoft ai a new era of smart solutions
Ai big dataconference_krakovetskyi_microsoft ai a new era of smart solutionsAi big dataconference_krakovetskyi_microsoft ai a new era of smart solutions
Ai big dataconference_krakovetskyi_microsoft ai a new era of smart solutions
 
Ai big dataconference_jeffrey ricker_kappa_architecture
Ai big dataconference_jeffrey ricker_kappa_architectureAi big dataconference_jeffrey ricker_kappa_architecture
Ai big dataconference_jeffrey ricker_kappa_architecture
 
Ai big dataconference_eugene_polonichko_azure data lake
Ai big dataconference_eugene_polonichko_azure data lake Ai big dataconference_eugene_polonichko_azure data lake
Ai big dataconference_eugene_polonichko_azure data lake
 

Recently uploaded

Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 

Recently uploaded (20)

Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 

Ai big dataconference_azuresqldw_tips_sergiy_lunyakin

Editor's Notes

  1. JOIN is on the TYPE Must also be an equi-join
  2. Scale-out distributed query engine
  3. PolyBase Azure Data Factory SSIS Bcp 3rd party data loading tools