In-Memory OLTP (IMOLTP) What Can It Do For Me? Martin Catherall Regional Mentor (APAC) MVP – Data Platform
Martin Catherall Senior Consultant RockSolid SQL UXC Eclipse MVP – Microsoft Data Platform PASS Regional Mentor APAC Give overview and introduction on this slide.
In-Memory OLTP – What Can It Do For Me. Introduction
SQL Server Change Compression (Row or Page) Extended Events (2008) Transparent Data Encryption (2008) AlwaysOn (2012) Columnstore (2012) In-Memory (2014) Discussion about change, adoption of new feature, agile development within SQL Server. Not mentioned 2016 features. New features have not only brought new terminology for new features but new terminology for old features.
IMOLTP - History Brought out SQL Server 2014 Enhanced SQL Server 2016 Reasonable use cases (many limitations) Enhanced SQL Server 2016 Less limitations Increased functionality Available in Azure SQL Database Not much changed needed (in a lot of cases) Discussion about change, adoption of new feature, agile development within SQL Server. Not mentioned 2016 features. New features have not only brought new terminology for new features but new terminology for old features.
Some Thoughts SQL Server Thrives with Memory As much as possible. But my database already fits into memory. Yes – but that’s still ‘disk based’ Pay attention to your data growth. This will dictate your (growing) memory requirements. We’ll still need memory for Normal SQL Server The Operating System.
Some (More) Thoughts Low Latency (nanoseconds v milliseconds) High Concurrency (Pessimistic / Optimistic) New concurrency model. Multi Version Concurrency Control (MVCC) Low Contention. Durability (The “D” in ACID) Can use to solve existing problems. Although not all (Test! Test! Test!)
In-Memory OLTP – What Can It Do For Me. Enabling in-memory
How to enable In-Memory Enabled at the database level. Simply Add a new filegroup Use familiar syntax. (ALTER DATABASE) Add an In-Memory Container. This is a folder on the file system. Use familiar syntax (ALTER DATABASE)
The IMOLTP filegroup Basically a directory on the file system. Which might get used! Only one IMOLTP filegroup allowed. Need for durability. So can data can be ‘recreated’ at startup. High Availability. Logging is slightly different The Checkpoint Worker thread.
Enabling In-Memory for the database. Demonstration Enabling In-Memory for the database.
Multi-Version Concurrency Control MVCC In-Memory OLTP – What Can It Do For Me. Multi-Version Concurrency Control MVCC
MVCC – A New Concurrency Model Data is immutable. Insert only. Isolation Modes SNAPSHOT – the default Read Committed Serializable.
MVCC – Records Append ONLY In flight Record Committed Record Begin TimeStamp Transaction ID Begin TimeStamp End TimeStamp
In-Memory OLTP – What Can It Do For Me. Creating Tables
Creating Tables Much the same as “Disk Based Tables” There are limitations. These are reducing Durable or Non-Durable Migration. (memory optimization Advisor)
Memory Optimization Advisor Demonstration Memory Optimization Advisor
Natively Compiled Objects Slight Different Syntax But very similar.
Accessing data In-Memory OLTP – What Can It Do For Me. TSQL or Natively Compiled Stored Procedures?
Converting Code Converting Code can be Challenging! Subquery support in SELECT statements in SQL2016 Unfortunately, not yet in update/delete. CASE – would be great to see For example workarounds see. https://msdn.microsoft.com/en-us/library/dn629453.aspx https://msdn.microsoft.com/en-us/library/mt757375.aspx https://msdn.microsoft.com/en-us/library/dn579376.aspx https://msdn.microsoft.com/en-us/library/dn579375.aspx Feel free to share any of yours See also
In-Memory OLTP – What Can It Do For Me. Monitoring in-memory
Temp table replacement In-Memory OLTP – What Can It Do For Me. Temp table replacement
In-Memory OLTP – What Can It Do For Me. Backup AND Restore
Resources. http://bit.ly/1bSsY7o (Bob Beauchemin) http://bit.ly/2eqBrYE (Cheap Ram Changes) http://bit.ly/1bSsY7o (Bob Beauchemin) http://bit.ly/2efItmt (SQL Team - 2014) http://bit.ly/1lspXr5 (unsupported constructs - MSDN) http://bit.ly/2dMZukL (Migration - MSDN) http://bit.ly/2cSWRNP (Temp Object Replacement) http://bit.ly/2e6l8WE (2016 White paper – download) http://bit.ly/2dmfjmb (free ebook (2014) - download)
Don’t Forget Online Evaluations Submit for raffles by 3:30PM www.sqlsaturday.com/572/sessions/sessionevaluation.aspx www.sqlsaturday.com/572/eventeval.aspx Submit for raffles by 3:30PM
QUESTIONS
Please Support Our Sponsors SQL Saturday is made possible with the generous support of these sponsors. You can support them by opting-in and visiting them in the sponsor area.