meanwhile ram cost continues to drop moore’s law on total cpu processing power holds but in...

32
park the future. May 4 – 8, 2015 Chicago, IL

Upload: della-daniels

Post on 19-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Spark the future.

May 4 – 8, 2015Chicago, IL

In-Memory OLTP – The Road AheadKevin FarleeSunil Agarwal

BRK3576

Outline

Fundamentals – In Memory OLTP Basics

First Steps – In Memory OLTP in SQL Server 2014

The Road Ahead – In Memory OLTP in SQL Server 2016

Fundamentals: In-Memory Basics

1990

1991

1992

1992

1993

1994

1995

1995

1996

1997

1998

1998

1999

2000

2001

2002

2003

2004

2006

2007

2008

2009

2010

1

10

100

1000

10000

100000

1000000

$ per GB of PC Class Memory

US$

/GB

Meanwhile RAM cost

continues to drop

Moore’s Law on total CPU processing

power holds but in parallel processing…

CPU clock rate stalled…

Because processors would melt…

Hardware TrendsNew CPU won’t

run a short transaction much faster

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

In-Memory OLTP Architectural Pillars

Arc

hit

ectu

ral P

illa

rsR

esu

lts

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

Pri

nci

ple

s Performance-critical data fits

in memory

Conflicts are Rare

Push decisions to compilation

timeBuilt-In

First Steps:In Memory OLTP in SQL 2014

SQL Server 2014 In-Memory OLTP aka Hekaton

Hekaton released in SQL Server 2014Value prop:

Extreme OLTP performance (up to 30X) due to High scalability: lock- and latch-free architecture enables linear scalingEfficient data access and query processing: memory-optimized data structures and native

compilationIntegrated into SQL Server for low TCO

Part of Enterprise EditionSame database can have in-memory and on-diskIntegrated developer and DBA experience: same T-SQL, client stack, tooling,

backup/restore, AlwaysOn

Target scenarios: OLTP apps with high throughput and scaling

SQL 2014 Feature SetMemory-Optimized TablesDurable tables (default) are fully logged and persistedNon-durable tables as “better” global temp tables in user database

Natively Compiled Stored ProceduresCommon OLTP constructs - Select/Insert/Delete/Update, Exception handling and moreCommonly used operators, builtins (MATH, String, Identity) and moreCommon Query Execution – Joins, groupby, OrderBy, TOP, SORT, Table, Query, Join Hints and more

Interop Access to Memory-Optimized TablesAlmost full T-SQL query surface area

Memory-Optimized Table TypesUse memory-optimized table variables to relieve tempdb contention

Before With in-memory

Daily asynchronous sync

Online retailers

Near real-time sync

Online retailers

Customers

Customers

7x faster performance Enables real-time updatesBusiness challengeSAAS provider to large retailers wanted to increase inventory availability refresh speed without blocking queries to improve customer satisfactionKey benefits Increased sales with greater

throughput and improved customer satisfaction

7x faster performance enables near real time inventory updates

Customers can access data during updates

16x more transactions per second &340x reduction in reporting times with in-memoryBusiness challengeOnline gaming company needed to support rapid growth by providing a faster, smoother gaming experience for more users, and speeding time to insights.

Key benefits Scales to handle 250,000

player requests per second—

up from 15,000 Reduced reporting time from

17 minutes to 3 seconds

With in-memory OLTP & ColumnStore

Before

Solution

Gaming App

Gaming App

ReportingReporting

Reports in

17 min

15,000 requests/sec

Reports in

3 sec

250,000 requests/sec

Record-setting price/performance with in-memory technology

24x boost

800%

performance

gains on the same HW

Sees 800% increase in requests per second gains using SQL Server in-memory OLTP on IBM System x3850 X6

in throughput on the same configuration

24x boost in throughput with LSI Nytro WarpDrive and SQL Server 2014 in-memory OLTP compared to the same setup with SQL Server 2012

Increased SQL Server 2014 in-memory OLTP performance by 4x with ioDrive2 Duo 2.4TB HW

4x

40% cost

performance

The Road Ahead:In Memory OLTP in SQL 2016

SQL Server 2014Limitation: Size of durable tables in a database <= 256 GB

Challenge My performance critical table(s) require > 256GB My performance critical tables are < 256GB but can exceed this limit in

future

SQL Server 2016 Supports 2TB of durable table (s) in the database Customer can address the size limitation by adding more memory to

the physical box

Customer Challenge: Size of In-Memory Tables

SQL Server 2014Challenge: Storage for deleted rows to be Garbage collected

Slow due to additional step with FileStream

SQL Server 2016 Storage management is decoupled from FileStream. Unused file(s) can be re-used immediately after they are de-referenced

from transaction log

Customer Challenge: Storage Management

SQL Server 2014Limitation: No support of Transparent Data Encryption (TDE)

Challenge My performance critical tables have sensitive data that needs to be

protected using TDE

SQL Server 2016 Supports TDE for memory-optimized tables Database Upgrade: Turn off TDE -> Drop the keys -> Create New keys-

> Turn on

Customer Challenge: Security (TDE)

SQL Server 2014Limitation: Limited scaling > (2 socket/64-cores)

SQL Server 2016 Multiple offline checkpoint threads (one per container)

Customer Challenge: Storage Scaling

Single Offline Checkpoint Thread

Del Tran2(TS 450)

Del Tran3(TS 250)

Del Tran1(TS150)

Insert into Hekaton T1

Log in SQL Table

Del Tran1(TS150)

Del Tran2(TS 450)

Del Tran3(TS 250)

Insert into Hekaton T1SQL Transaction log

disk

SQL Transaction log Del Tran2(TS 450)

Del Tran3(TS 250)

Del Tran1(TS150)

Insert into Hekaton T1

Log in SQL Table

Del Tran1(TS150)

Del Tran2(TS 450)

Del Tran3(TS 250)

Insert into Hekaton T1

disk

Offline Checkpoint Thread

Offline Checkpoint Thread

Offline Checkpoint Thread

Increasing Compatibility

Application challengesApplication development/modificationAgile/iterative development methodsTuning application/databaseResponding to shifting data patternsNeed to be able to modify the database schema

ALTER support ALTER PROC and sp_recompile supported

‐ Online

ALTER TABLE for schema and index changes‐ Full schema change support: add/alter/drop column/constraint

‐ Index operations Add/drop index supported

Change HASH index bucket_count through index REBUILD

New syntax for ALTER TABLE ….ADD/DROP/ALTER INDEX

‐ ALTER TABLE is an offline operation; requires 2X memory

‐ sp_rename not yet supported

Demo

Alter support in In-Memory OLTP

Challenge: Reporting queries against In-Memory tablesSQL Server 2014 uses serial query plans for all queries touching in-memory tables

SQL Server 2016 now enables queries that touch in-memory tables to use parallel plans.

Converting existing applications{LEFT|RIGHT} OUTER JOINDisjunction (OR, NOT)UNION [ALL]SELECT DISTINCTSubqueries (EXISTS, IN, scalar)FOREIGN KEYCHECKUNIQUE constraints and indexesNested Stored procedures (EXECUTE)Natively compiled scalar UDFsIndexes on NULLable columns

Custom validation DML Triggers on memory-optimized tablesAFTER triggers, natively compiled

Entity-Framework generated code and ISV appsMultiple Active Result Sets (MARS)Table designer support in SSMS

Migration/manageabilityAssisted migration for stored proceduresMigration advisors indicate which limitations are easy, and which are hard to work aroundBest practices analyzer support

Wide Range of collation/language supportNon-BIN2 collations in index key columnsNon-Latin code pages for (var)char columnsNon-BIN2 collations for comparison and sorting in native modules

Increasing Platform Abilities In-Memory OLTP in Azure SQL DB

‐ Private Preview now

‐ Public Preview this Summer

In-memory OLTP

In-memory ColumnStor

e

Real-time frauddetection

In-memory enhancementsOperational analytics & enhanced performance

CapabilityIn-memory Columnar index over in-memory/disk based OLTP tablesEnhanced OLTP T-SQL surface areaScale to higher compute and memory

Benefits Unlike competition, you gain

operational analytics & 30x faster transactions & 100x queries

In-memory for more of your applications

Fraud detected

2-24hrs

0100101010110

SQL Server OLTP

SQL Serverdata

warehouse

ETL

Other Relevant Sessions:BRK2563: In-Memory Technologies Overview for Microsoft SQL Server and Microsoft Azure; Tuesday 10:45-12:00BRK4552: Operational Analytics in SQL Server; Tuesday 3:15-4:30BRK3576: In-Memory OLTP – The Road Ahead; Tuesday 5:00-6:15

BRK2574: ColumnStore Index: Microsoft SQL Server 2014 and Beyond; Wednesday 1:30-2:45PM

Lab: In-Memory OLTP Monitoring & Troubleshooting; Thursday 9-10:15BRK3554 Microsoft SQL Server 2014 In-Memory OLTP and Columnstore Customer Deployments; Thursday 1:30-2:45BRK2563: Microsoft SQL Server Unplugged; Thursday 3:15-4:30

*Other In-Memory OLTP Labs are available as well throughout the conference

Visit Myignite at http://myignite.microsoft.com or download and use the Ignite Mobile App with the QR code above.

Please evaluate this sessionYour feedback is important to us!

© 2015 Microsoft Corporation. All rights reserved.