6 SQL Server Integration Same manageability, administration & development experience Integrated...

23

Transcript of 6 SQL Server Integration Same manageability, administration & development experience Integrated...

Page 1: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.
Page 2: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Microsoft SQL Server In-Memory OLTP: Overview of Project "Hekaton"

Sunil Agarwal [email protected]

Rick Kutschera [email protected]

DBI-B204

Page 3: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Agenda

Business and Hardware TrendsWhat is Hekaton?Hekaton Architecture PillarsHekaton Integration with SQL ServerBWIN: Application Migration and Production Results

Page 4: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Business Trends

• Market need for ever higher throughput and lower latency OLTP at a lower cost

• ExamplesCredit-card transactions: validate, authorize and complete the transactionOnline-betting: Ability to place the bet quickly

Page 5: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Hardware Trends

Page 6: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

What is Hekaton?

Hekaton is: High performance, memory-optimized OLTP engine integrated into SQL Server and architected for modern hardware trends

6

Page 7: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

SQL Server Integration

• Same manageability, administration & development experience

• Integrated queries & transactions

• Integrated HA and backup/restore

Main-Memory Optimized

• Optimized for in-memory data

• Indexes (hash and range) exist only in memory

• No buffer pool, B-trees

• Stream-based storage

T-SQL Compiled to Machine Code• T-SQL compiled to

machine code via C code generator and VC

• Invoking a procedure is just a DLL entry-point

• Aggressive optimizations @ compile-time

Steadily declining memory price,

NVRAM

Many-core processors

Stalling CPU clock rate

TCO

Hardware trends Business

Hekaton Architecture Pillars

Hybrid engine and integrated

experience

High performance

data operations

Efficient, business-logic

processingCu

sto

me

r B

en

efi

ts

Hekato

n T

ech

P

illa

rsD

rivers

7

High Concurrency

• Multi-version optimistic concurrency control with full ACID support

• Core engine uses lock-free algorithms

• No lock manager, latches or spinlocks

Frictionless scale-up

Page 8: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Memory Optimized Table Filegroup Data Filegroup

SQL Server.exe

Memory Optimized Tables & Indexes

TDS Handler and Session Management

Hekaton Integration and Application Migration

Natively Compiled SPs and Schema

Buffer Pool for Tables & Indexes

Client App

Transaction Log

Query Interop T1 T3T2

T1 T3T2

Tables

Indexes

T-SQL Query Execution

T1 T3T2

Parser, Catalog, Optimize

r

Hekaton Compiler

Hekaton Compone

nt

KeyExisting

SQL Compone

nt

Generated .dll

Page 9: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Customer Experience: BWIN• Application Overview• Architecture before/after• Performance achieved• Application Migration

Page 10: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Session State Server - Overview• Coordination of concurrent web requests

from user sessions• Direct impact of webserver response time

• High number of short transactions• Small data size• Transient data

Page 11: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Architecture

G e t

Locked

Compute

U p d a t e

Page 12: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Architecture pre Hekaton

Page 13: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Architecture post Hekaton

Page 14: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

The Hekaton Effect• Only one server needed for all webfarms• Less license costs• Less power consumption• Less datacenter space

• Easier to manage• Less workload for DBAs• Less points of failure to troubleshoot

• Scales almost linearly• Higher throughput per CORE

Page 15: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

The Hekaton Effect – in numbers• Pre-Hekaton• 15.000 Batches/Sec• Translates (roughly) to 7.000 Pages/Sec on the Webserver• High number of Latch Waits

• Hekaton• 250.000 Batches/Sec• Translates (roughly) to 120.000 Pages/Sec on the Webserver• Next bottleneck: CPU (test was done on a 4-Socket Server, which

reached 100% CPU load at this point)

Page 16: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Migration Challenges• Not all datatypes are supported• Needed a workaround for BLOB handling

• Not the entire surface area is supported • Sequences and Identity need to be done outside

• Lockfree model needs to be taken into account• Write/Write conflict handling

• Atomic stored procedures sometimes require wrappers

• Initial migration done in <2 Person Days

Page 17: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Production experience• Started production use in Summer 2012• System running very stable, even with early

beta bits

• Need to monitor memory usage closely• Just like you needed to monitor diskspace before

• Increased speed leads to some problems in troubleshooting / monitoring• Transactions almost never get caught in the act by Activity Monitor• Completion time <1ms is hard to measure in some DMVs

Page 18: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Related contentBreakout Sessions

DBI-307 - Microsoft SQL Server In-Memory OLTP Project "Hekaton": App Dev Deep Dive

6/5/2013 @ 8:30AMDBI-308 - Microsoft SQL Server In-Memory OLTP Project "Hekaton": Management Deep Dive

6/6/2013 @ 10:15 AM

Page 20: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

msdn

Resources for Developers

http://microsoft.com/msdn

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

TechNet

Resources

Sessions on Demand

http://channel9.msdn.com/Events/TechEd

Resources for IT Professionals

http://microsoft.com/technet

Page 21: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Complete an evaluation on CommNet and enter to win!

Page 22: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

Evaluate this session

Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize

Page 23: 6 SQL Server Integration Same manageability, administration & development experience Integrated queries & transactions Integrated HA and backup/restore.

© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.