ἑκατόν
description
Transcript of ἑκατόν
Niko Neugebauer• PASS Evangelist• SQL Server MVP• SQLPort (http://www.sqlport.com) founder &
leader• BITuga (http://www.bituga.pt) co-founder• 15+ years in IT
Conceptionally?• Imagine that you have a number of CPU steps
to perform a typical OLTP action• Optimize it 100 times by removing obstacles
like latches and parallelize it• Yes, you will need start from the bottom and
from the very beginning?
Hardware Trends• Look at the CPU speed increase• Look at the Memory Prices• You can’t buy a SQL Server Enterprise License
for a price of a TB• Think, think, think
HistorySybase SQL Server
1.0• 1980 (1989)
• Hardware Expensive
• CPU Bound
• Pages 8K
SQL Server 11.0• 2012
• Hardware Cheap
• IO & Memory Bound
• Pages 8K
Hekaton• In-Memory Database• Multi-Core Awareness and Optimizations• xVelocity compression algorithm (hint: ColumnStore)• No Pages (no more splits, allocations, etc)• No Locks, No Latches + different Concurrency Control• StreamInsight (no more 8K’s)• Hash Index (no more b-trees)• Existing T-SQL can be reused
Hekaton• ACID compliant• Optimized for extreme Transaction Processing
scenarios like • Financial Services• Online Gambling
• There are customers who are using it NOW
Particular Features• Snapshot_Isolation ONLY• No support for LOB data types • No Triggers• AlwaysOn Support
features• Durable Tables• Non-Durable Tables• TempDB is used inside of the Hekaton, in-
memory• Shares memory with Buffer Pool, but has its
own space
Architecture• Different space allocation for memory buffer• The very same transaction log, but with fewer
writes• Different filegroups• Different treatment for Indexes• A lot of new, different stuff
Programability• Create table dbo.Hekaton(
• Id int primary key hash with (bucketcount = 65535),
• Nome varchar(50)) WITH (MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA );GO
T-SQLStored Procs:• Uses C as internal intermediate presentation,
and then compiles into native code• Atomic blocks• Can’t reference non-hekaton tables
T-SQL Programability• Create procedure dbo.HekatonNow
• WITH NATIVE_COMPILATIONBEGIN
select name from dbo.Hekaton;ENDGO
BUT• Isn’t it too fast ? • – No, there is no such concept as too fast. (as
long as it does not create other problems)