Availability and Performance for Tier1...

31
Assaf Fraenkel Senior Architect (MCA+MCM SQL 2008) MCS Israel Availability and Performance for Tier1 applications

Transcript of Availability and Performance for Tier1...

Page 1: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Assaf Fraenkel Senior Architect

(MCA+MCM SQL 2008)

MCS Israel

Availability and

Performance for

Tier1 applications

Page 2: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Agenda:

Introduce the new SQL Server High Availability and Disaster Recovery solution (AlwaysOn) in SQL Server 2012.

Column Based Store - New way to boost performance

Extended Events - Briefing

Key Takeaway(s):

Get the overview of these features

According to your specific needs - deep dive into these features

Agenda and Takeaways

Page 3: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

REQUIRED 9s & DATA PROTECTION

Greater flexibility and

availability with SQL

Server AlwaysOn

Maximized hardware

resources

Support for Windows

Server Core to reduce

planned downtime

A A A

Mission Critical Confidence

BLAZING-FAST PERFORMANCE

Column-based query

accelerator for dramatic

performance gains

Faster performance for

FILESTREAM,

spatial & FTS

ORGANIZATIONAL COMPLIANCE & PEACE OF MIND

User-defined server roles

for better separation of

duties & Audit support

across editions

SharePoint & Active

Directory integration for

secure BI data

Simplified application

testing with Distributed

Replay and streamlined

troubleshooting with

Extended Events

Page 4: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Always

On

Page 5: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Mission Critical High Availability

Reuse existing investment

SAN versus DAS environments

Page 6: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Multi-Database Failover

Multiple Secondaries

Active Secondaries

Integrated HA Management

Mission Critical High Availability AlwaysOn Solution in SQL 2012

Page 7: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Providing

Database

Availability

AlwaysOn Availability Group

Page 8: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Multi-database failover

Total of 4 secondaries

2 synchronous

secondaries

1 automatic failover pair

Synchronous and

asynchronous

Built in compression and

encryption

Automatic and manual

failover

Flexible failover policy

Automatic Page Repair

Application failover using

virtual name

Configuration Wizard

Dashboard

System Center Integration

Rich diagnostic

infrastructure

Replication

publisher/subscriber

failover

Supported with Contained

Database, File Stream, File

Table, Service Broker

Readable Secondary

Backup from Secondary

Mission Critical High Availability

Page 9: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

AlwaysOn Availability Group AlwaysOn provides the flexibility

of different HA configurations

Synchronous

Data Movement

Asynchcronous

Data Movement

Shared Storage, regional

and geo secondaries

A

A

A

A

A

Direct attached storage local,

regional and geo target

A A

Page 10: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

AlwaysOn Availability Group Application Failover with Availability Group Listener

2 DB 2 DB

Parameter Sample: -server TechListener1;-catalog HRDB

ServerA ServerB ServerC

Availability Groups Listener allow applications to failover seamlessly to any

secondary; reconnecting through Virtual Network Name

2 DB

TechAG1

Primary Secondary

TechListener1

Application retry during failover

Primary Secondary Secondary

Connect to new primary

once failover is complete

and the listener is online

Page 11: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

AlwaysOn Availability Group Active Secondary : Backup and Log Shipping on secondary

Backups can be done on

any replica of a database

Backups on primary

replica still works

Log backups done on all

replicas form a single

log chain

Database Recovery

Advisor makes

restores simple

R/W workload

Primary

Backups

Secondary

Log Shipping

Secondary

Backups

DRP

Page 12: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Deploying AlwaysOn Availability Group

Demo

Page 13: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Columnstore Indexes

Page 14: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Is This Your Data Warehouse Experience?

Wait ing…

Page 15: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Columnstore Indexes

Wait ing…

Page 16: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Value Proposition of Columnstore Indexes

Faster, interactive query response time

Easier data exploration

Better decisions

Reduced physical DB design effort

Fewer indexes

Reduced need for summary aggregates and

indexed views

May eliminate need for OLAP cubes

Transparent to the application

Ability to handle larger workload on given hardware

Page 17: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

ColumnStore

Indexes

in Action

Demo

Page 18: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Memory Management

Management is automatic

Columnstore is persisted on disk

Columns (segments) fetched into memory as needed

Columnstore segments flow between disk and memory

SELECT C2, SUM(C4)

FROM T

GROUP BY C2;

T.C2 T.C4

T.C2 T.C4

T.C2

T.C2

T.C2 T.C1

T.C1

T.C1

T.C1

T.C1 T.C3

T.C3

T.C3

T.C3

T.C3

T.C4

T.C4

T.C4

Page 19: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Advanced query processing technology

Batch mode execution of some

operations

Processes column data in

batches

Groups of batch operations

in query plan

Compact data representation

Highly efficient algorithms

Better parallelism

How Does Batch Mode Speed Up Queries?

Page 20: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Columnstore index scan

can produce batches or

rows

Batch-enabled

operators get batches

Non-batch operators

get rows

Query optimizer decides

Processing Data

Lis

t o

f q

ualify

ing

ro

ws

Column vectors

Batch object

Page 21: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Limitations When Using ColumnStore Indexes

Creating columnstore index

Only on common business data types

Maintain table: limited operations

Can read but not update the data

Can switch partitions in and out

Processing queries

All read-only T-SQL queries run

Some queries are accelerated more than others

Yes int, real, string, money, datetime, decimal <= 18 digits

No decimal > 18 digits, binary, varbinary, CLR, (n)varchar(max),

varbinary (max), uniqueidentifier, datetimeoffset with

precision > 2

Page 22: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Multiple DISTINCT aggregates issue & workaround

• Table Spool if query has 2 or more DISTINCT aggregates • Spool takes time to write • Spool write is single threaded • Reads of spool in plan are single threaded, in row mode • Workaround:

form each DISTINCT agg in separate subquery Join results on grouping keys

SQL Server 2012 runs queries with 1 DISTINCT agg and 1 or more non-distinct aggs in batch mode without any spool!

Page 23: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Columnstore indexes can enable

phenomenal performance gains

Batch mode processing is an

essential ingredient for speedup

Some adjustments to schema

and loading processes may be

necessary

Some queries can benefit from

tuning

Columnstore indexes are not a

magic bullet

Summary

Page 24: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Diagnostic tracing using Extended Events

Page 25: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Why do we need Extended Events? New Problems for

Diagnostics

We have

more

complex

systems

Need to

reduce

performance

impact of

diagnostics

Desire for

more

detailed

information

Need to

find

unexpected

interactions

Page 26: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Unique Value of Extended Events

Scalability Bigger machines, more work, more

events - no problem.

Events are dynamic Collect additional data on any event

Perform an action when an event happens

Cross process event tracking Track relationship between different

tasks/threads/processes

Integrates with Windows eventing Expose tracing information to Windows

tools such as Xperf

Coordinate with trace data from other ETW Providers

Page 27: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Key Advancements in SQL Server 2012

Graphic User Interface! Both Advanced & Wizard based event session creation.

Tabular view of event data.

Filter, Sort, Group & Aggregate right in the user interface.

Export event data to Table, CSV or XEL.

Managed APIs New Object Model:

Create, Modify and Drop event sessions.

Start & Stop event sessions.

Read event data from file or directly from a running event session.

New Events & Updated Target Names More than twice as many events (over 600).

Now includes all the same data as SQL Trace.

Asynchro-what? - event_file, historgram, event_counter

Page 28: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Extended Events

Demo

Page 29: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

We learned:

Introduce the new SQL Server High Availability and Disaster Recovery solution (AlwaysOn) in SQL Server 2012.

Column Based Store - New way to boost performance

Extended Events - Briefing

Key Takeaway(s):

According to your specific needs - deep dive into these features

Start to Implement

Summary and Takeaways

Page 30: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

Thank

You!

Page 31: Availability and Performance for Tier1 applicationsmscom.co.il/.../Whats_new_in_SQL_2012_v3_20.4.12.pdfAgenda: Introduce the new SQL Server High Availability and Disaster Recovery

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista, 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.

לצפייה במצגות :האירוע היכנסווהרצאות

http://www.microsoft

.com/israel/benext