27

In-Memorydownload.microsoft.com/documents/hk/technet/techday… ·  · 2014-03-27In-Memory Technologies Enhanced High Availability New Hybrid ... HANA still use 16KB pages for its

Embed Size (px)

Citation preview

In-Memory Technologies

Enhanced

High Availability

New Hybrid

Scenarios

In-Memory OLTP • 5-20X performance gain for

OLTP integrated into SQL Server

In-Memory DW • 5-25X performance gain and

high data compression

• Updatable and clustered

SSD Bufferpool Extension • 4-10X of RAM and up to 3X

performance gain transparently for apps

Always On Enhancements • Increased availability and

improved manageability of active secondaries

Online Database Operations • Increased availability for

index/partition maintenance

Backup to Azure • Easy to implement and cost

effective Disaster Recovery solution to Azure Storage

HA to Azure VM • Easy to implement and cost

effective high availability solution with Windows Azure VM

Deploy to Azure • Deployment wizard to migrate

database

Better together with Windows Server • WS2012 ReFS support

• Online resizing VHDx

• Hyper-V replica

• Windows “Blue” support

Extending Power View • Enable Power View on

existing analytic models and support new multi-dimensional models.

Other investments

In-Memory Technologies

In-Memory OLTP • 5-20X performance gain for

OLTP integrated into SQL Server

In-Memory DW • 5-25X performance gain and

high data compression

• Updatable and clustered

SSD Bufferpool Extension • 4-10X of RAM and up to 3X

performance gain transparently for apps

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

High Concurrency

• Multi-version optimistic

concurrency control with full

ACID support

• Lock-free data structures

• No locks, latches or

spinlocks

• No I/O during transaction

T-SQL Compiled to

Machine Code

• T-SQL compiled to machine

code leveraging VC

compiler

• Procedure and its queries,

becomes a C function

• Aggressive optimizations @

compile-time

Steadily declining memory

price, NVRAM Many-core processors Stalling CPU clock rate TCO

Hardware trends Business

Hybrid engine and

integrated experience

High performance data

operations Frictionless scale-up

Efficient, business-logic

processing

Cust

om

er

Benefits

H

eka

ton T

ech

Pill

ars

D

rive

rs

Memory-optimized Table

Filegroup

Data Filegroup

SQL Server.exe

Hekaton Engine: Memory_optimized

Tables & Indexes

TDS Handler and Session Management

In-Memory OLTP: Integration and Application Migration

Native-Compiled

SPs and Schema

Buffer Pool

Execution Plan cache for

ad-hoc T-SQL and SPs

Application

Transaction Log

Query

Interop

Non-durable

Table T1 T3 T2

T1 T3 T2

T1 T3 T2

T1 T3 T2

Tables

Indexes

T-SQL Interpreter

T1 T3 T2

T1 T3 T2

Access Methods

Parser,

Catalog,

Optimizer

Hekaton

Compiler Hekaton

Component

Key

Existing SQL

Component

Generated

.dll

20-40x more efficient Real Apps see 2-30x

Reduced log contention; Low

latency still critical for performance

Checkpoints are background

sequential IO

No V1 improvements in comm layers

2

5

10

30

0 5 10 15 20 25 30

TPC-C

LEGACY APP

INGEST/READ

HEAVY

BEST FIT

Factor X Gains for Applications

X factor Gains

Despite 20 years of optimizing for the

TPC-C benchmark – we still get 2x

Apps that take full advantage: e.g. web

app session state

Apps with periodic bulk updates & heavy

random reads

Existing apps typically see 4-7x

improvement

Buffer Pool

Memory

Optimized

Tables

Available

Memory

Buffer Pool

Memory

Optimized

Tables

Buffer Pool

Memory

Optimized

Tables

Buffer Pool

Memory

Optimized

Tables

Row header Payload (table columns)

Begin Ts End Ts StmtId IdxLinkCount

8 bytes 8 bytes 4 bytes 2 + 2 (padding)

bytes

8 bytes * (IdxLinkCount)

50, ∞ John Paris

Timestamps Name Chain ptrs City

Hash index

on Name

Transaction 100:

UPDATE City = ‘Prague’ where Name = ‘John’

No locks of any kind, no interference with transaction 99

100, ∞ John Prague

90, ∞ Susan Bogota

f(John)

100

Transaction 99: Running compiled query

SELECT City WHERE Name = ‘John’

Simple hash lookup returns direct pointer to ‘John’ row

Background operation will unlink and deallocate the old ‘John’ row after transaction 99 completes.

Hekaton Principle:

• Performance like a cache

• Functionality like a RDMBS

Note: HANA still use 16KB pages for its row

store (optimized for disk IO)

10 20 28

5 8 10 11 15 18 21 24 27

PAGE 0

1

2

3

14

15

PAGE

1 2 4 6 7 8 25 26 27

200, ∞ 1 50, 300 2

Root

Non-leaf pages

leaf pages

Data rows

PageID-0

PageID-3 PageID-2

PageID -14

Key Key

Logical Physical

100,200 1

Data File

Delta File

0 100

TS (ins) RowId TableId

TS (ins) RowId TableId

TS (ins) RowId TableId

TS (ins) RowId TS (del)

TS (ins) RowId TS (del)

TS (ins) RowId TS (del)

Ch

eck

po

int

File P

air

Row pay load

Row pay load

Row pay load

Transaction Timestamp Range

Data file contains rows inserted

within a given transaction range

Delta file contains deleted rows

within a given transaction range

Offline Checkpoint Thread

Memory-optimized Table Filegroup

Ran

ge 1

00-2

00

Ran

ge 2

00-3

00

Ran

ge 3

00-4

00

Ran

ge 4

00-5

00

Ran

ge 5

00-

New Inserts Delete 450 TS Delete 250 TS Delete 150 TS

Data file with rows generated in timestamp range IDs of Deleted Rows (height indicates % deleted)

Del Tran2 (TS 450)

Del Tran3 (TS 250)

Del Tran1(TS150)

Insert into Hekaton T1

Log in disk Table

Del Tran1 (row TS150)

Del Tran2 (row TS 450)

Del Tran3 (row TS 250)

Insert into T1 SQL Transaction log

(from LogPool)

Memory-optimized data Filegroup

Files as of Time 600 R

ang

e 1

00-2

00

Rang

e 2

00-3

00

Rang

e 3

00-4

00

Rang

e 4

00-5

00

Data file with rows generated in

timestamp range

IDs of Deleted Rows (height

indicates % deleted)

Merge

200-400

Deleted Files Files Under Merge

Files as of Time 500

Memory-optimized data Filegroup

Rang

e 1

00-2

00

Rang

e 2

00-2

99

Rang

e 3

00-3

99

Rang

e 4

00-5

00

Rang

e 5

00-6

00

Rang

e 2

00-4

00

Rang

e 2

00-3

00

Rang

e 3

00-4

00

Delta map

Recovery Data

Loader

Delta

File1

Memory

Optimized Tables

Recovery Data

Loader

Recovery Data

Loader

Delta map Delta map

Data

File1 Delta

File2

Data

File2

Delta

File3

Data

File3

filter filter filter

Memory Optimized Container - 1 Memory Optimized Container - 2

ios (version 6 or below):

Please input the below URL:

http://aka.ms/DBI394R

Other platform:

QR Code: