Redmond Protocols Plugfest 2016 Jos de Bruijn, Borko Novakovic SQL In-Memory OLTP Senior Program Manager.

Slides:



Advertisements
Similar presentations
new database engine component fully integrated into SQL Server 2014 optimized for OLTP workloads accessing memory resident data achive improvements.
Advertisements

1. SQL Server 2014 In-Memory by Design Arthur Zubarev June 21, 2014.
6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.
SQL Server 2014 – Features Drilldown Tara Shankar Jana Senior Premier Field Engineer (Microsoft)
Project “Hekaton” adds in-memory technology to boost performance of OLTP workloads in SQL Server.
Dandy Weyn Sr. Technical Product Mkt.
Planning on attending PASS Summit 2014? The world’s largest gathering of SQL Server & BI professionals Take your SQL Server skills to the.
Microsoft Ignite /16/2017 3:29 PM
Meanwhile RAM cost continues to drop Moore’s Law on total CPU processing power holds but in parallel processing… CPU clock rate stalled… Because.
Evolving SQL Server for Modern Hardware Paul Larson, Eric N. Hanson, Mike Zwilling Microsoft plus to the many members of the Apollo and Hekaton teams Paul.
Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server today.
SQL Server 2014: In In-memory OLTP for Database Developers.
SQL Server 2014: Overview Phil ssistalk.com.
Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server.
SQL Server 2014 adds in-memory technology to boost performance of OLTP workloads.
IN-MEMORY OLTP By Manohar Punna SQL Server Geeks – Regional Mentor, Hyderabad Blogger, Speaker.
SQL Server 2016 : New Features
Srik Raghavan Principal Lead Program Manager Kevin Cox Principal Program Manager SESSION CODE: DAT206.
Meet Kevin Liu Principal Lead Program Manager Kevin Liu has been with Microsoft and the SQL Server engine team for 7 years, working on key projects like.
Ἑ κατόν by Niko Neugebauer. Niko Neugebauer PASS EvangelistPASS Evangelist SQL Server MVPSQL Server MVP SQLPort ( founder & leaderSQLPort.
Moore’s Law means more transistors and therefore cores, but… CPU clock rate stalled… Meanwhile RAM cost continues to drop.
INTRODUCING SQL SERVER 2012 COLUMNSTORE INDEXES Exploring and Managing SQL Server 2012 Database Engine Improvements.
Sofia Event Center November 2013 Margarita Naumova SQL Master Academy.
Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server today.
Matt Lavery & Joanna Podgoetsky Being a DBA is cool again with SQL 2016 DAT335 A.
Warwick Rudd – Henry Rooney – How Available is SQL Server 2016? DAT33 6.
SQL Server 2016 New Innovations. Microsoft Data Platform Relational Beyond Relational On-premises Cloud Comprehensiv e Connected Choice SQL Server Azure.
In-Memory OLTP The faster is now simpler in SQL Server 2016.
PASS Virtual Chapter presentation March 27, 2014.
Vedran Kesegić. About me  M.Sc., FER, Zagreb  HRPro d.o.o. Before: Vipnet, FER  13+ years with SQL Server (since SQL 2000)  Microsoft Certified.
Warwick Rudd | Principal Consultant – consulting.com.au #456 | Auckland 2015 Mission Critical SQL Server.
UNIQUE AND NOT DULLwww.MyGareth.com. UNIQUE AND NOT DULLwww.MyGareth.com Agenda New Features in SQL Server 2016  About me  General Enhancements  In-memory.
SQL Server 2014: In-Memory OLTP Adoption Considerations Mike
Doing fast! Optimizing Query performance with ColumnStore Indexes in SQL Server 2012 Margarita Naumova | SQL Master Academy.
SQL Server 2016: Real-time operational analytics
Best Practices for Columnstore Indexes Warner Chaves SQL MCM / MVP SQLTurbo.com Pythian.com.
Session Name Pelin ATICI SQL Premier Field Engineer.
New BI Features SQL 2016 New features of SQL 2016.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
Use Cases for In-Memory OLTP Warner Chaves SQL MCM / MVP SQLTurbo.com Pythian.com.
Memory-Optimized Tables Querying at the speed of light.
Microsoft Connect /6/ :05 AM
In-Memory OLTP in SQL Server 2016 and Azure SQL Database
In-Memory OLTP: Concepts and Improvements in SQL Server 2016
In-Memory Capabilities
Architectures and Case Studies with In-Memory OLTP in SQL
Temporal Databases Microsoft SQL Server 2016
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
Temporal Databases Microsoft SQL Server 2016
In-Memory Optimization (OLTP) enhancements overview
UFC #1433 In-Memory tables 2014 vs 2016
7/17/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Taking your application to memory
9/11/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
SQL Server 2014 In-Memory OLTP
SQL Server 2014 In-Memory Overview
Graeme Malcolm | Data Technology Specialist, Content Master
මොඩියුල විශ්ලේෂණය Buffer Pool Extension භාවිතය.
Super Scaling The LMAX Queue Pattern.
Migrating a Disk-based Table to a Memory-optimized one in SQL Server
Taking your application to memory
In-Memory OLTP (IMOLTP) What Can It Do For Me?
Real world In-Memory OLTP
SQL 2014 In-Memory OLTP What, Why, and How
Accelerate Your Data Insights with SQL Server 2014
Shaving of Microseconds
Microsoft Ignite /1/ :19 PM
Statistics for beginners – In-Memory OLTP
In-Memory OLTP for Database Developers
SQL Server 2014: In-Memory OLTP Overview
Presentation transcript:

Redmond Protocols Plugfest 2016 Jos de Bruijn, Borko Novakovic SQL In-Memory OLTP Senior Program Manager

Agenda Overview and Value Proposition In-Memory OLTP Architecture and Features Recent Enhancements Azure DB Offering

Analysis Services In-Memory In-Memory Analytics ColumnStore (NCCI) PowerPivot In-Memory for Excel The journey to complete in-memory PowerPivot In-Memory for Excel 2012 SQL Server 2008 R2 SQL Server +In-Memory Analytics ColumnStore (CCI) In-Memory OLTP Analysis Services In-Memory PowerPivot In-Memory for Excel 2014 SQL Server +Real-Time Operational Analytics In-Memory OLTP Analysis Services In-Memory (10x faster) PowerPivot In-Memory for Excel Azure SQL DB and Azure SQL DW 2016 SQL Server

SQL In-Memory Technologies Over 100x query speed and significant data compression with In-Memory ColumnStore Up to 30x faster transaction processing with In-Memory OLTP Faster Analytics Faster Transactions + IN-MEMORY OLTP IN-MEMORY DW + Using the same tables In 2016 and Azure DB SQL Real-Time Analytics

Hardware Trends Multi-Core Explosion 32 cores per socket and beyond on H/w roadmap Multiple levels of cache: latencies from caches and memory a problem Individual cores not getting dramatically faster Memory sizes growing More affordable to keep working set in memory Storage hierarchy changing dramatically (PCIe) SSDs are mainstream NVRAMs on the horizon

Database Design For Next-Gen H/W Special-purpose DB “Engines” designed for particular scenarios Give 100x performance over general purpose DBs Careful layout of data structures in memory Eliminate redundant code paths Techniques specialized to particular scenarios: Analytics & DW: batch execution of queries over compressed data, exploiting duplication of data over large sets, hyper optimized inner loops OLTP: eliminating concurrency control overhead, compiled code, very efficient end-to-end stack

Customer demand for ever higher concurrency and lower latency, at a lower cost Hardware trends demand architectural changes on RDBMS to meet those demands In-memory OLTP is: High performance, Memory-optimized OLTP engine, Integrated into SQL Server and Architected for modern hardware Why In-Memory OLTP 7

SQL Server In-Memory OLTP In-Memory OLTP Optimized for OLTP workloads Memory-optimized data structures for efficient data access Lock/Latch free access for linear scaling Native Compilation of T-SQL Modules for efficient execution Fully integrated into SQL Server No new license or product Familiar tools Integrated Security and High Availability No/Limited Application Changes Available in SQL Server and Azure SQL DB Performance numbers Up to 30X performance improvement compared with traditional tables and stored procs Actual gain depends on app pattern; typical gains: 2X-10X Perf numbers in testing (4S server): 10M rows ingested per second 1GB/s of log generation 260K transactions per second for order processing workload (most transactions are mixed read/write) bwin.party experiences with ASP.NET session state Consolidate 18 servers -> 1 in production 1M requests/sec in testing

High throughput OLTP with low latency requirements E.g., financial trading, gaming Shock-absorber and data load (high data ingestion rate) Memory-optimized table as “buffer”, with offload to clustered columnstore Remove mid-tier caching Session state and relational cache E.g., ASP.NET session state Tempdb replacement Memory-optimized table-valued parameters (TVPs) Memory-only (SCHEMA_ONLY) tables to replace temp tables ETL Use SCHEMA_ONLY staging tables In-Memory OLTP Scenarios

In-Memory OLTP Perf Gain Demo

Architecture and Features

In-Memory OLTP Architectural Pillars SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore Main-Memory Optimized Direct pointers to rows Indexes exist only in memory No buffer pool No write-ahead logging Stream-based storage Non-Blocking Execution Multi-version optimistic concurrency control, full ACID support Lock-free data structures No locks, latches or spinlocks, No I/O in transaction T-SQL Compiled to Native Machine Code T-SQL compiled to machine code leveraging VC compiler Procedure and its queries, becomes a C function Aggressive compile-time optimizations Architectural Pillars Results Hybrid engine and integrated experience In-memory cache speed with capabilities of a database Transactions execute to completion without blocking Queries & business logic run at native- code speed Principl es Performance- critical data fits in memory Conflicts are Rare Push decisions to compilation time Built-In

Create Table DDL CREATE TABLE [Customer]( [CustomerID] INT NOT NULL PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUNT = ), [Name] NVARCHAR(250) NOT NULL, [CustomerSince] DATETIME NULL INDEX [ICustomerSince] NONCLUSTERED INDEX [ICustomerID-Since] NONCLUSTERED (CustomerID, CustomerSince) ) WITH (MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA); This table is memory optimized This table is durable. Non-durable tables: DURABILITY=SCHEMA_ONLY Indexes may be specified inline NONCLUSTERED indexes are supported Hash Index BUCKET_COUNT Use 2x # of unique index key values Multi-Column indexes are supported

Create Table Type DDL CREATE TYPE [Sales].[SalesOrderDetailType_inmem] AS TABLE( [OrderQty] [smallint] NOT NULL, [ProductID] [int] NOT NULL, [SpecialOfferID] [int] NOT NULL, INDEX [IX_ProductID] NONCLUSTERED HASH ([ProductID]) WITH ( BUCKET_COUNT = 8) ) WITH ( MEMORY_OPTIMIZED = ON )

Create Procedure DDL CREATE PROCEDURE DATETIME WITH NATIVE_COMPILATION, SCHEMABINDING AS BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N'us_english') -- insert T-SQL here END This proc is natively compiled Native procs must be schema-bound Atomic blocks Create a transaction if there is none Otherwise, create a savepoint

Create Function DDL CREATE FUNCTION [dbo].[ufnGetAccountingEndDate_native]() RETURNS [datetime] WITH NATIVE_COMPILATION, SCHEMABINDING AS BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL=SNAPSHOT, LANGUAGE=N'us_english') RETURN DATEADD(millisecond, -2, CONVERT(datetime, ' ', 112)); END

Durability and Availability Full durability is default Every commit results in write to transaction log Delayed durability and non-durable are available Delayed durability: flush to disk is async for low latency; limited data loss possible Non-durable tables: exist only in memory; for transient data and relational cache High-availability and disaster recovery fully integrated AlwaysOn AGs, readable secondaries, FCI, log shipping fully supported Backup/restore fully integrated Checkpoint is incremental for performance reasons

Recent Improvements

Throughput: Sustained log generation rate 1GB/s Numerous improvements under the hood Persisted Main Memory for Tail of the Log Parallel plans and parallel scan of memory-optimized tables and indexes Heap scan Performance improvements

Programmability improvements Tables Collations: Full collations support in index key columns All code pages supported for (var)char columns Constraints FOREIGN KEY CHECK UNIQUE constraints and indexes LOB types: [n]varchar(max) and varbinary(max) Row size >8060 bytes NULLable index key columns DML triggers on memory-optimized tables (AFTER) Row-Level Security Always Encrypted Temporal Tables (history lives on-disk) Native Compilation Full collations support in native modules Query surface area {LEFT|RIGHT} OUTER JOIN Disjunction (OR, NOT) UNION [ALL] SELECT DISTINCT Subqueries (EXISTS, IN, scalar) Nested Stored procedures (EXECUTE) Natively Compiled Scalar UDFs Access from both native and interop Improves perf of scalar UDFs in traditional workload if no table access is required Natively Compiled Inline TVFs EXECUTE AS CALLER Query Store

Manageability improvements Improved SSMS experience Lightweight Performance Analysis in SSMS Generate migration checklists to evaluate all tables/procedures for migration ALTER support for procedures and tables Full ALTER TABLE/PROCEDURE support Index management through ALTER TABLE … ADD/ALTER/DROP INDEX Limitation: ALTER TABLE offline for now; ALTER of 10GB table takes 1.5 minutes No ALTER between disk-based and memory-optimized TDE (Transparent Data Encryption) All on-disk data files are now encrypted once TDE is enabled Stats improvements: auto-update and sampled stats Statistics management is not on par with disk-based tables

In-Memory OLTP - Remaining Unsupported Features Tables DDL triggers and Transactional DDL Data types: XML, Spatial, CLR types, datetimeoffset, rowversion, sql_variant ALTER TABLE ONLINE; sp_rename Cross-container transaction limitations: snapshot/snapshot, serializable/serializable; SAVEPOINT Online Migration of disk-based tables to memory-optimized Interop: cross-database queries, MERGE INTO, locking hints Native Compilation CASE, MERGE, JOIN in UPDATE/DELETE; VIEWs Natively Compiled Table-Valued Functions Automatic and statement-level recompile Access to disk-based tables Must be schema-bound; no dynamic T-SQL Parallelism; limitations in query operators (hash join/agg, merge join) Management: replication; DB snapshot; CDC; compression; remove filegroup

In-Memory OLTP in Azure SQL Database

In-Memory OLTP for Azure SQL DB In Public Preview for new Premium databases No need to manage filegroup or resource pool In-Memory storage size: P1 – 1GB; P2 – 2GB; P4 – 4GB; P6 – 8GB; P11 – 14GB Full In-Memory OLTP Surface Area Memory-optimized tables and table types Natively compiled stored procedures and scalar UDFs New features are released to Azure SQL DB as soon as they are completed Planned for GA (H2 2016): Existing databases Basic/Standard support Elastic pools

Resources Samples Perf demo SQL 2014 Sample Azure DB Sample Documentation Blog on In-Memory OLTP in SQL 2016 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

Redmond Protocols Plugfest 2016 Questions or Comments?

Redmond Protocols Plugfest 2016 Thank You!