how sql server 2016 can change your game - cloud … sql server 2016 can change your game ......

13
13/09/2016 1 Faster out of the box How SQL Server 2016 can change your game Justin Langford Trusted analytics and data management experts Strategic Microsoft data platform partner Collaborative approach to solving customer problems Delivering excellence in technology strategy and mission critical support

Upload: nguyentu

Post on 30-Jan-2018

229 views

Category:

Documents


1 download

TRANSCRIPT

13/09/2016

1

Faster out ofthe box

How SQL Server 2016can change your game

Justin Langford

• Trusted analytics and data management experts

• Strategic Microsoft data platform partner

• Collaborative approach to solving customer problems

• Delivering excellence in technology strategyand mission critical support

13/09/2016

2

Agenda

• Why rewrite SQL Server now?

• Five engine optimisations

• Popular new features

• Three new security features

Microsoft Data Platform

SQL Server

2016

Azure SQL

Database

Azure SQL

Data

Warehouse

Analytics

Platform

System

On-premises & Cloud

Transactional

&

Analytics Solutions

Cloud

Transactional

Database

Solutions

Cloud

Data Warehouse

Solutions

On-premises

Data Warehouse

Solutions

Core SQL Server Source Code

13/09/2016

3

Cloud transformation

Control & Cost Efficiency & Saving

What has Microsoft done with SQL Server 2016?

• Rewritten internal database engine codeA “super service pack”

• Multi-core CPUsMemory architecture (NUMA partitioning) has changed

• New technologiesNVDIMMs and CPU encryption sets

• New platformsSQL Server on Linux, Azure SQL Database

• Made it faster by default

13/09/2016

4

Why now?

• New audiencesNot everyone has access to a database administrator

• Reuse new featuresIn-memory technology can help internal operations

• SQL Server isn’t going anywhere!

Five engine optimisations

13/09/2016

5

1. Faster database integrity checks

• They need to be done, regularly

• Cause memory pressure and storage saturation

• Now scales with >8 CPUs

• Uses in-memory engine lock free access methods

• Performs read-ahead reads

• 5-7x faster than SQL Server 2014

2. Tempdb optimisation

• History of problems and optimisations

• How many data files? Which trace flags?

• Storage metadata trace flags enabled by default(T1117 and T1118)

• Number of data files created during setup:Lower of 8 or the number of logical cores

• Optimal configuration by default

13/09/2016

6

3. Large data file writes

• Server storage is changing

• Used to be optimised for 64 and 128KB writes

• SSD and flash prefer 1MB+ operations

• SQL Server used to write 32x8KB pages at a time

• Most data file writes are now 128x8KB pages (1MB)

• SQL Server 2016 writes faster

4. Automatic Soft-NUMA

• Server hardware continues to grow (22 core CPUs)

• CPU and memory are partitioned (NUMA nodes)

• Many internal tasks created for each NUMA node

• Soft-NUMA partitions each hardware NUMA node

• Queries on large servers run faster

13/09/2016

7

5. Multiple log file writer workers

• Log writes have always been a bottleneck

• Less of a problem with old spinning disks

• Modern storage can handle parallel writes

• Up to 4 log writer workers for an instance

• One created on start-up per NUMA node

• Faster log writes for busy servers

Popular new features

13/09/2016

8

In-memory Tables (Hekaton)

Memory-optimized Table FilegroupData Filegroup

Hekaton Engine: Memory_optimized Tables

& Indexes

TDS Handler and Session Management

Natively Compiled

SPs and Schema

Buffer Pool for Tables & Indexes

Proc/Plan cache for ad-hoc T-

SQL and SPs

Client App

Transaction Log

Query

Interop

Non-durable

TableT1 T4T3T2

T1 T4T3T2

T1 T4T3T2

T1 T4T3T2

Tables

Indexes

Interpreter for TSQL, query

plans, expressions

T1 T4T3T2

T1 T4T3T2

Checkpoint & Recovery

Access Methods

Parser,

Catalog,

Algebrizer,

Optimizer

Hekaton

Compiler

Hekaton

Component

Key

Existing SQL

Component

Generated

.dll

Temporal and Stretch database

SELECT * FROM Department FOR SYSTEM_TIMEAS OF '2010.01.01' Facts:

1. History is much bigger than actual data

2. Retained between 3 and 10 years

3. “Warm”: up to a few weeks/months

4. “Cold”: rarely queried

Solution:

History as a stretch table:

PeriodEnd < “Now - 6 months”

Azure SQL Database

13/09/2016

9

Polybase

• xxx Query relational

and non-relational

data, on-premises

and in Azure

Apps

T-SQL query

SQL Server Hadoop

Clustered Columnstore Indexes• Key points

• Create an updateable NCCI for analytics

queries

• Drop all other indexes that were created

for analytics

• No application changes

• Columnstore index is maintained just like

any other index

• Query Optimizer will choose columnstore

index where needed

Row Group 1

Row Group 2

Row Group 3

Columns

Dele

te B

itm

ap

Delta Table Row Oriented

Modifiacations of Rows Clusters Column Store

Online Merge

Insert of Rows

13/09/2016

10

High Availability with Hybrid Cloud

• Wizard to add a replica in a Windows Azure VM

• Easily deploy one or more replicas of your database to Windows Azure

• Use these replicas for• Disaster Recovery

• Workloads (Reads,Backups)

SQL Server Reporting Services

• Mobile Reports

Power BI mobile app can display local SSRS reports

• Modern reporting

Refreshed portal for KPI dashboard, reports and Power BI filesHTML5 rendering engine for modern look reportsCustom branded web portal

13/09/2016

11

3 Security Enhancements

1. Always Encrypted

• Client-side encryption with

ADO.Net client library

• SQL Server executes queries

on encrypted data

• Sensitive data remains

encrypted, can be queried

• Flexible on-premise and

cloud

• No application changes

dbo.Customers

Jane Doe

Name

24324-9812

CCNumber

UK

Country

Jim Gray 19833-0987 UK

John Smith 12382-1095 UK

dbo.Customers

Jane Doe

Name

1x7fg655se2e

CCNumber

UK

Jim Gray 0x7ff654ae6d UK

John Smith 0y8fj754ea2c UK

Country

Result Set

Jim Gray

Name

Jane Doe

Name

1x7fg655se2e

CCNumber

UK

Country

Jim Gray 0x7ff654ae6d UK

John Smith UK

dbo.Customers

SQL Server

Result Set

Jim Gray

Name

SELECT Name FROM

Customers WHERE CC=@CC

@NI=0x7ff654ae6d

Column Encryption

Key

Enhanced

ADO.NET

Library

ColumnMasterKey

Client side

ciphertext

Query

13/09/2016

12

2. Data MaskingTwo

App user (e.g., clerk) selects from Customers tableThree

Security Policy transparently rewrites query to apply filter predicate

Database Policy Manager

CREATE FUNCTION dbo.fn_securitypredicate(@town int)

RETURNS TABLE WITH SCHEMABINDING AS

return SELECT 1 as [fn_securitypredicate_result] FROM

StaffDuties d INNER JOIN Employees e

ON (d.EmpId = e.EmpId)

WHERE e.UserSID = SUSER_SID() AND @town = d.town;

CREATE SECURITY POLICY dbo.SecPol

ADD FILTER PREDICATE dbo.fn_securitypredicate(Town) ON

Customers

WITH (STATE = ON)

Filter

Predicate:

INNER

JOIN…

Security

Policy

Applicatio

n

Customers

One

Policy manager creates filter predicate and security policy in T-SQL, binding the

predicate to the Customers table

Bank Clerk

SELECT * FROM Customers

SELECT * FROM Customers

SEMIJOIN APPLY dbo.fn_securitypredicate(patients.Town);

SELECT Customers.* FROM Customers,

StaffDuties d INNER JOIN Employees e ON (d.EmpId = e.EmpId)

WHERE e.UserSID = SUSER_SID() AND Customers.town = d.Town;

3. Dynamic Data Masking

SQL Database

SQL Server 2016

Table.CreditCardNo

4465-6571-7868-5796

4468-7746-3848-1978

4484-5434-6858-6550

Real-time data masking;

partial masking

• Policy-driven at table and column level

• Defined set of users

• Data masking applied in real-time to

resultset based on policy

• Multiple masking functions available (full,

partial)

• Enables categories of data sensitivity

13/09/2016

13

Summary

• Active Software Assurance means no Capital Investment

• SQL Server is continuing to adapt

• Invisible improvements make it faster

• New features are keeping it modern and relevant

How I can be of further help

To learn morehttp://www.microsoftvirtualacademy.com/

For any questions@justinlangford – [email protected]