SlideShare a Scribd company logo
1 of 38
jodebrui@microsoft.com
Microsoft Confidential
Version SessionState Performance Technology Bottleneck
SQL Server 2012 12,000 batch requests/sec SQL Server Interpreted T-SQL Latch contentions
SQL Server 2014 300,000 batch requests/sec Memory-Optimized Table, Interpreted T-SQL,
Handling of Split LOBs
CPU
SQL Server 2016 1,200,000 batch requests/sec Memory-Optimized Table with LOB support,
Natively Compiled stored procedures
CPU
In-Memory OLTP performance (bwin)
Source: https://blogs.msdn.microsoft.com/sqlcat/2016/10/26/how-bwin-is-using-sql-server-2016-in-memory-oltp-to-achieve-unprecedented-performance-and-scale/
Version Cache System Performance Hardware nodes
Mid-Tier Cache solution without SQL Server 150,000 batch requests/sec 19
Solution using SQL Server 2016 1,200,000 batch requests/sec 1
Microsoft Confidential
Version SessionState Performance Technology Bottleneck
SQL Server 2012 12,000 batch requests/sec SQL Server Interpreted T-SQL Latch contentions
SQL Server 2014 300,000 batch requests/sec Memory-Optimized Table, Interpreted T-SQL,
Handling of Split LOBs
CPU
SQL Server 2016 1,200,000 batch requests/sec Memory-Optimized Table with LOB support,
Natively Compiled stored procedures
CPU
In-Memory OLTP performance (bwin)
Source: https://blogs.msdn.microsoft.com/sqlcat/2016/10/26/how-bwin-is-using-sql-server-2016-in-memory-oltp-to-achieve-unprecedented-performance-and-scale/
Version Cache System Performance Hardware nodes
Mid-Tier Cache solution without SQL Server 150,000 batch requests/sec 19
Solution using SQL Server 2016 1,200,000 batch requests/sec 1
CREATE TABLE [Customer](
[CustomerID] INT NOT NULL
PRIMARY KEY NONCLUSTERED,
[Name] NVARCHAR(250) NOT NULL,
[CustomerSince] DATETIME2 NULL,
INDEX [ICustomerSince] NONCLUSTERED
(CustomerID, CustomerSince)
)
WITH (MEMORY_OPTIMIZED = ON,
DURABILITY = SCHEMA_AND_DATA);
This table is durable (default).
Non-durable tables:
DURABILITY=SCHEMA_ONLY
CREATE PROCEDURE [dbo].[InsertOrder] @id INT, @date DATETIME2
WITH
NATIVE_COMPILATION,
SCHEMABINDING
AS
BEGIN ATOMIC
WITH
(TRANSACTION
ISOLATION LEVEL = SNAPSHOT,
LANGUAGE = N‘Dutch')
-- insert T-SQL here
END
Durability
level
Configuration Pros/Cons Scenarios
Full
durability
Default
DURABILITY=SCHEMA_AND_DATA
Pro:
• Every committed change is
guaranteed to survive failure
Con:
• Latency impact: every commit
requires log IO
Default: most scenarios need full
durability
Delayed
durability
• Transaction commit time
COMMIT WITH (DELAYED_DURABILITY=ON)
• Atomic block of native procedure
BEGIN ATOMIC WITH
(DELAYED_DURABILITY=ON, …)
• Database level
ALTER DATABASE CURRENT SET
DELAYED_DURABILITY=FORCED
Pro:
• Low latency due to no log IO in
transaction execution path
• Efficient log IO due to batching
Con:
• Limited data loss on failure (usually
~60K or ~1ms worth)
Low latency requirements
Can accept some data loss
OR
Copy of recent data exists
elsewhere in case of failure
AlwaysOn auto-failover (sync
replicas) with low latency
Non-
durable
tables
Table creation
DURABILITY=SCHEMA_ONLY
Pro:
• No IO at all
Con:
• Lose data on failure
• Transient data such as session
state
• Caching
• ETL (staging tables)
Durability
level
Configuration Pros/Cons Scenarios
Full
durability
Default
DURABILITY=SCHEMA_AND_DATA
Pro:
• Every committed change is
guaranteed to survive failure
Con:
• Latency impact: every commit
requires log IO
Default: most scenarios need full
durability
Delayed
durability
• Transaction commit time
COMMIT WITH (DELAYED_DURABILITY=ON)
• Atomic block of native procedure
BEGIN ATOMIC WITH
(DELAYED_DURABILITY=ON, …)
• Database level
ALTER DATABASE CURRENT SET
DELAYED_DURABILITY=FORCED
Pro:
• Low latency due to no log IO in
transaction execution path
• Efficient log IO due to batching
Con:
• Limited data loss on failure (usually
~60K or ~1ms worth)
Low latency requirements
Can accept some data loss
OR
Copy of recent data exists
elsewhere in case of failure
AlwaysOn auto-failover (sync
replicas) with low latency
Non-
durable
tables
Table creation
DURABILITY=SCHEMA_ONLY
Pro:
• No IO at all
Con:
• Lose data on failure
• Transient data such as session
state
• Caching
• ETL (staging tables)
Durability
level
Configuration Pros/Cons Scenarios
Full
durability
Default
DURABILITY=SCHEMA_AND_DATA
Pro:
• Every committed change is
guaranteed to survive failure
Con:
• Latency impact: every commit
requires log IO
Default: most scenarios need full
durability
Delayed
durability
• Transaction commit time
COMMIT WITH (DELAYED_DURABILITY=ON)
• Atomic block of native procedure
BEGIN ATOMIC WITH
(DELAYED_DURABILITY=ON, …)
• Database level
ALTER DATABASE CURRENT SET
DELAYED_DURABILITY=FORCED
Pro:
• Low latency due to no log IO in
transaction execution path
• Efficient log IO due to batching
Con:
• Limited data loss on failure (usually
~60K or ~1ms worth)
Low latency requirements
Can accept some data loss
OR
Copy of recent data exists
elsewhere in case of failure
AlwaysOn auto-failover (sync
replicas) with low latency
Non-
durable
tables
Table creation
DURABILITY=SCHEMA_ONLY
Pro:
• No IO at all
Con:
• Lose data on failure
• Transient data such as session
state
• Caching
• ETL (staging tables)
In-Memory OLTP perf demo
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
order processing workload
Domain controllers
Domain controllers
Sensors
Temporal memory-
optimized table
release source code
Applications / Web servers
LineItem1
LineItem2
…
##temp
LineItem1
LineItem2
…
dbo.temp
Memory-optimized table variables and temp tables
Data Warehouse – SQL Server 2016
Resources
• Samples
Perf demo
WideWorldImporters sample DB
IoT sample leveraging temporal tables release page
Azure DB Sample
Enable database for In-Memory OLTP
SQL Server Samples GitHub Repository
• Documentation
Blog on In-Memory OLTP in SQL 2016
Memory-optimized table variables and temp tables
MSDN Documentation for In-Memory OLTP
Azure DB documentation for In-Memory
What’s new in SQL2016
• Migrating apps
In-Memory OLTP Common Workloads and Migration Considerations
Migrating to In-Memory OLTP
Guidelines for using Indexes
• Related videos
Microsoft Virtual Academy talks
Recent investments in In-Memory OLTP
jodebrui@microsoft.com

More Related Content

What's hot

Webinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterWebinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera Cluster
Severalnines
 
Oracle performance tuning_sfsf
Oracle performance tuning_sfsfOracle performance tuning_sfsf
Oracle performance tuning_sfsf
Mao Geng
 
Download presentation
Download presentationDownload presentation
Download presentation
webhostingguy
 

What's hot (19)

Streaming huge databases using logical decoding
Streaming huge databases using logical decodingStreaming huge databases using logical decoding
Streaming huge databases using logical decoding
 
Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL Troubleshooting
 
In Memory Database In Action by Tanel Poder and Kerry Osborne
In Memory Database In Action by Tanel Poder and Kerry OsborneIn Memory Database In Action by Tanel Poder and Kerry Osborne
In Memory Database In Action by Tanel Poder and Kerry Osborne
 
MySQL Performance Tuning - GNUnify 2010
MySQL Performance Tuning - GNUnify 2010MySQL Performance Tuning - GNUnify 2010
MySQL Performance Tuning - GNUnify 2010
 
[Altibase] 12 replication part5 (optimization and monitoring)
[Altibase] 12 replication part5 (optimization and monitoring)[Altibase] 12 replication part5 (optimization and monitoring)
[Altibase] 12 replication part5 (optimization and monitoring)
 
Online MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupOnline MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackup
 
Percona xtrabackup - MySQL Meetup @ Mumbai
Percona xtrabackup - MySQL Meetup @ MumbaiPercona xtrabackup - MySQL Meetup @ Mumbai
Percona xtrabackup - MySQL Meetup @ Mumbai
 
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
 
Performance Schema for MySQL troubleshooting
Performance Schema for MySQL troubleshootingPerformance Schema for MySQL troubleshooting
Performance Schema for MySQL troubleshooting
 
Webinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterWebinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera Cluster
 
Advanced Oracle Troubleshooting
Advanced Oracle TroubleshootingAdvanced Oracle Troubleshooting
Advanced Oracle Troubleshooting
 
Creating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just WorksCreating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just Works
 
Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting Replication
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
 
Oracle performance tuning_sfsf
Oracle performance tuning_sfsfOracle performance tuning_sfsf
Oracle performance tuning_sfsf
 
Download presentation
Download presentationDownload presentation
Download presentation
 
PostgreSQL Monitoring using modern software stacks
PostgreSQL Monitoring using modern software stacksPostgreSQL Monitoring using modern software stacks
PostgreSQL Monitoring using modern software stacks
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 

Similar to SQL Server In-Memory OLTP Case Studies

download it from here
download it from heredownload it from here
download it from here
webhostingguy
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
Enkitec
 

Similar to SQL Server In-Memory OLTP Case Studies (20)

Deploying ssd in the data center 2014
Deploying ssd in the data center 2014Deploying ssd in the data center 2014
Deploying ssd in the data center 2014
 
Proving out flash storage array performance using swingbench and slob
Proving out flash storage array performance using swingbench and slobProving out flash storage array performance using swingbench and slob
Proving out flash storage array performance using swingbench and slob
 
2015 deploying flash in the data center
2015 deploying flash in the data center2015 deploying flash in the data center
2015 deploying flash in the data center
 
2015 deploying flash in the data center
2015 deploying flash in the data center2015 deploying flash in the data center
2015 deploying flash in the data center
 
RMAN – The Pocket Knife of a DBA
RMAN – The Pocket Knife of a DBA RMAN – The Pocket Knife of a DBA
RMAN – The Pocket Knife of a DBA
 
End-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL ServerEnd-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL Server
 
Sql server 2016 it just runs faster sql bits 2017 edition
Sql server 2016 it just runs faster   sql bits 2017 editionSql server 2016 it just runs faster   sql bits 2017 edition
Sql server 2016 it just runs faster sql bits 2017 edition
 
Novedades SQL Server 2014
Novedades SQL Server 2014Novedades SQL Server 2014
Novedades SQL Server 2014
 
Analyzing and Interpreting AWR
Analyzing and Interpreting AWRAnalyzing and Interpreting AWR
Analyzing and Interpreting AWR
 
Sql server performance tuning and optimization
Sql server performance tuning and optimizationSql server performance tuning and optimization
Sql server performance tuning and optimization
 
11g R2
11g R211g R2
11g R2
 
download it from here
download it from heredownload it from here
download it from here
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017
 
Alwayson in sqlserver2017
Alwayson in sqlserver2017Alwayson in sqlserver2017
Alwayson in sqlserver2017
 
AWR Ambiguity: Performance reasoning when the numbers don't add up
AWR Ambiguity: Performance reasoning when the numbers don't add upAWR Ambiguity: Performance reasoning when the numbers don't add up
AWR Ambiguity: Performance reasoning when the numbers don't add up
 
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
 
Extreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationExtreme Replication - RMOUG Presentation
Extreme Replication - RMOUG Presentation
 

Recently uploaded

Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
gajnagarg
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
HyderabadDolls
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
vexqp
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
HyderabadDolls
 

Recently uploaded (20)

Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
 
Statistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbersStatistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbers
 

SQL Server In-Memory OLTP Case Studies

  • 2. Microsoft Confidential Version SessionState Performance Technology Bottleneck SQL Server 2012 12,000 batch requests/sec SQL Server Interpreted T-SQL Latch contentions SQL Server 2014 300,000 batch requests/sec Memory-Optimized Table, Interpreted T-SQL, Handling of Split LOBs CPU SQL Server 2016 1,200,000 batch requests/sec Memory-Optimized Table with LOB support, Natively Compiled stored procedures CPU In-Memory OLTP performance (bwin) Source: https://blogs.msdn.microsoft.com/sqlcat/2016/10/26/how-bwin-is-using-sql-server-2016-in-memory-oltp-to-achieve-unprecedented-performance-and-scale/ Version Cache System Performance Hardware nodes Mid-Tier Cache solution without SQL Server 150,000 batch requests/sec 19 Solution using SQL Server 2016 1,200,000 batch requests/sec 1
  • 3. Microsoft Confidential Version SessionState Performance Technology Bottleneck SQL Server 2012 12,000 batch requests/sec SQL Server Interpreted T-SQL Latch contentions SQL Server 2014 300,000 batch requests/sec Memory-Optimized Table, Interpreted T-SQL, Handling of Split LOBs CPU SQL Server 2016 1,200,000 batch requests/sec Memory-Optimized Table with LOB support, Natively Compiled stored procedures CPU In-Memory OLTP performance (bwin) Source: https://blogs.msdn.microsoft.com/sqlcat/2016/10/26/how-bwin-is-using-sql-server-2016-in-memory-oltp-to-achieve-unprecedented-performance-and-scale/ Version Cache System Performance Hardware nodes Mid-Tier Cache solution without SQL Server 150,000 batch requests/sec 19 Solution using SQL Server 2016 1,200,000 batch requests/sec 1
  • 4.
  • 5.
  • 6.
  • 7. CREATE TABLE [Customer]( [CustomerID] INT NOT NULL PRIMARY KEY NONCLUSTERED, [Name] NVARCHAR(250) NOT NULL, [CustomerSince] DATETIME2 NULL, INDEX [ICustomerSince] NONCLUSTERED (CustomerID, CustomerSince) ) WITH (MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA); This table is durable (default). Non-durable tables: DURABILITY=SCHEMA_ONLY
  • 8.
  • 9. CREATE PROCEDURE [dbo].[InsertOrder] @id INT, @date DATETIME2 WITH NATIVE_COMPILATION, SCHEMABINDING AS BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N‘Dutch') -- insert T-SQL here END
  • 10.
  • 11. Durability level Configuration Pros/Cons Scenarios Full durability Default DURABILITY=SCHEMA_AND_DATA Pro: • Every committed change is guaranteed to survive failure Con: • Latency impact: every commit requires log IO Default: most scenarios need full durability Delayed durability • Transaction commit time COMMIT WITH (DELAYED_DURABILITY=ON) • Atomic block of native procedure BEGIN ATOMIC WITH (DELAYED_DURABILITY=ON, …) • Database level ALTER DATABASE CURRENT SET DELAYED_DURABILITY=FORCED Pro: • Low latency due to no log IO in transaction execution path • Efficient log IO due to batching Con: • Limited data loss on failure (usually ~60K or ~1ms worth) Low latency requirements Can accept some data loss OR Copy of recent data exists elsewhere in case of failure AlwaysOn auto-failover (sync replicas) with low latency Non- durable tables Table creation DURABILITY=SCHEMA_ONLY Pro: • No IO at all Con: • Lose data on failure • Transient data such as session state • Caching • ETL (staging tables)
  • 12. Durability level Configuration Pros/Cons Scenarios Full durability Default DURABILITY=SCHEMA_AND_DATA Pro: • Every committed change is guaranteed to survive failure Con: • Latency impact: every commit requires log IO Default: most scenarios need full durability Delayed durability • Transaction commit time COMMIT WITH (DELAYED_DURABILITY=ON) • Atomic block of native procedure BEGIN ATOMIC WITH (DELAYED_DURABILITY=ON, …) • Database level ALTER DATABASE CURRENT SET DELAYED_DURABILITY=FORCED Pro: • Low latency due to no log IO in transaction execution path • Efficient log IO due to batching Con: • Limited data loss on failure (usually ~60K or ~1ms worth) Low latency requirements Can accept some data loss OR Copy of recent data exists elsewhere in case of failure AlwaysOn auto-failover (sync replicas) with low latency Non- durable tables Table creation DURABILITY=SCHEMA_ONLY Pro: • No IO at all Con: • Lose data on failure • Transient data such as session state • Caching • ETL (staging tables)
  • 13. Durability level Configuration Pros/Cons Scenarios Full durability Default DURABILITY=SCHEMA_AND_DATA Pro: • Every committed change is guaranteed to survive failure Con: • Latency impact: every commit requires log IO Default: most scenarios need full durability Delayed durability • Transaction commit time COMMIT WITH (DELAYED_DURABILITY=ON) • Atomic block of native procedure BEGIN ATOMIC WITH (DELAYED_DURABILITY=ON, …) • Database level ALTER DATABASE CURRENT SET DELAYED_DURABILITY=FORCED Pro: • Low latency due to no log IO in transaction execution path • Efficient log IO due to batching Con: • Limited data loss on failure (usually ~60K or ~1ms worth) Low latency requirements Can accept some data loss OR Copy of recent data exists elsewhere in case of failure AlwaysOn auto-failover (sync replicas) with low latency Non- durable tables Table creation DURABILITY=SCHEMA_ONLY Pro: • No IO at all Con: • Lose data on failure • Transient data such as session state • Caching • ETL (staging tables)
  • 15.
  • 18.
  • 19.
  • 23.
  • 24.
  • 25.
  • 26.
  • 34. Data Warehouse – SQL Server 2016
  • 35.
  • 36. Resources • Samples Perf demo WideWorldImporters sample DB IoT sample leveraging temporal tables release page Azure DB Sample Enable database for In-Memory OLTP SQL Server Samples GitHub Repository • Documentation Blog on In-Memory OLTP in SQL 2016 Memory-optimized table variables and temp tables MSDN Documentation for In-Memory OLTP Azure DB documentation for In-Memory What’s new in SQL2016 • Migrating apps In-Memory OLTP Common Workloads and Migration Considerations Migrating to In-Memory OLTP Guidelines for using Indexes • Related videos Microsoft Virtual Academy talks Recent investments in In-Memory OLTP
  • 37.