microsoft mea services webcast - ha & dr with sql server alwayson availability groups

29
High Availability & Disaster Recovery with SQL Server AlwaysOn Availability Groups Turgay Sahtiyan Microsoft – Senior SQL Server PFE www.turgaysahtiyan.com @ @turgaysahtiyan

Upload: turgaysahtiyan

Post on 25-May-2015

335 views

Category:

Technology


0 download

DESCRIPTION

The AlwaysOn Availability Groups feature is a high-availability and disaster-recovery solution that provides an enterprise-level alternative to database mirroring. Introduced in SQL Server 2012, AlwaysOn Availability Groups maximizes the availability of a set of user databases for an enterprise. In this session we will talk about what’s coming with Always On, and how does it help to improve high availability and disaster recovery solutions. (Level 200)

TRANSCRIPT

Page 1: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

High Availability & Disaster Recovery with SQL Server AlwaysOn Availability Groups

Turgay SahtiyanMicrosoft – Senior SQL Server PFE

www.turgaysahtiyan.com

@ @turgaysahtiyan

Page 2: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Turgay Sahtiyan

Istanbul, TurkeyMicrosoft GBS Team - Senior SQL Server PFE

+12 years IT experience / Last 8 years SQL ServerKey areas : HA&DR Solutions, Performance Tuning, PDW

Community GeekFounder and Former President of SQLPass Turkey ChapterFormer SQL Server MVPSpeaker / Writer / Presenter at Microsoft & SQLSaturdays & Local User Groups

Social MediaTwitter : @turgaysahtiyanBlog : www.turgaysahtiyan.comLinkedin : http://aka.ms/turgaysahtiyan_li

2

Page 3: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Agenda

HA&DR Solutions Before SQL Server AlwaysOn AGsLimitations of Current HA/DR Solutions

SQL Server AlwaysOn Availability GroupsClient Failover using Virtual Network NameReadable Secondary – ReadOnly RoutingBackup on Secondary Replicas

Availability Group ScenariosComparison of SQL Server HA&DR SolutionsReal-Life Customer ScenarioWhat’s Coming with SQL Server 2014

3

Page 4: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

SQL Server High Availability

HA&DR solutions before SQL Server 2012 AlwaysOnDatabase MirroringFailover Cluster InstanceLog Shipping

These features help the customer to reach enough HA&DR but..

Customers demand moreBetter AvailabilityHigher ROISimplicity

4

Page 5: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Failover Cluster

5

Public

Shared Storage

SQL Server Instance

SQL Server Instance

Instance level redundancyLocal or Remote SitePresents VNNAutomatic FailoverDoes not protect against data loss

Page 6: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Database Mirroring

6

Principal Database

Client

Principal Server Mirror Server

Mirror Database

Transaction Log Stream

Witness Server

Provide “a” redundant copy of databaseLocal or remote sideWorks by sending TLog recordsConnections are accepted only to the principal databaseNo VNNAutomatic failover with Witness Server

Page 7: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Log Shipping

7

Page 8: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Failover Clustering and Database Mirroring

8

Primary Data Center

Secondary Data Center

SQL Server 2008 R2Failover Cluster

SQL Server 2008 R2Failover Cluster

Asynchronous DatabaseMirroring

Asynchronous Data Movement with Database Mirroring

Page 9: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Database Mirroring and Log Shipping

9

Primary Datacenter

Disaster RecoveryDatacenter2

SQL Server 2008 R2Database Mirroring

SQL Server 2008 R2

Log Shipping

Disaster RecoveryDatacenter1

SQL Server 2008 R2

Log Shipping

Witness

Log Shipping

Synchronous Data Movement with Database Mirroring

Page 10: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Limitations of Current HA/DR Solutions

Solutions are fragmentedDatabase mirroring does not allow multiple secondariesMultiple databases cannot fail over as a groupLog shipping might lose data and does not fail over automaticallyPassive servers are mostly running idleOffloading of reporting and maintenance tasks from the primary server is not easySAN is a single point of failure in failover clustering

10

Page 11: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

AlwaysOn Availability Groups

11

Page 12: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

AlwaysOn Availability Groups

12

Multiple Secondaries to Improve RedundancyUp to 4Max 2 Sync

Page 13: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

AlwaysOn Availability Groups

13

Multiple Secondaries to Improve RedundancyUp to 4Max 2 SyncActive SecondariesOffloading read

workloadsBackups on

Secondary

Page 14: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

AlwaysOn Availability Groups

14

Multiple Database Failover

Multiple Secondaries to Improve RedundancyUp to 4Max 2 SyncActive SecondariesOffloading read

workloadsBackups on

Secondary

Page 15: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

AlwaysOn Availability Groups

15

Multiple Database Failover

Multiple Secondaries to Improve RedundancyUp to 4Max 2 Sync

Automatic Failover

Flexible Failover Policies for Greater Control over Failover

Active SecondariesOffloading read

workloadsBackups on

Secondary

Page 16: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

AlwaysOn Availability Groups

16

Multiple Database Failover

Multiple Secondaries to Improve RedundancyUp to 4Max 2 Sync

Automatic Failover

Flexible Failover Policies for Greater Control over Failover

Active SecondariesOffloading read

workloadsBackups on

Secondary

Virtual Network Name (Listeners)

Page 17: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

AlwaysOn Availability Groups

17

Primary Data Center

Reports

A

A

A

A

SecondaryData Center

Replica 1

Replica 3

Replica 2

Replica 4

ReportsBackups

Backups

Multiple Database Failover

Multiple Secondaries to Improve RedundancyUp to 4Max 2 Sync

Automatic Failover

Flexible Failover Policies for Greater Control over Failover

Active SecondariesOffloading read

workloadsBackups on

Secondary

Virtual Network Name (Listeners)

Page 18: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Client Failover using Virtual Name

Availability Group Virtual Name allow applications to failover seamlessly on availability group failover

Application reconnects using a virtual name after a failover to a secondary

18

AGHR

HRDB HRDB

Primary Secondary

HRVNN

-server HRVNN;-catalog HRDB

Application retry during failover

Connect to new primary once failover is completeand the virtual name is online

Primary SecondarySecondary

HRDB

ServerA ServerB ServerC

Page 19: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Readable Secondary

Readable secondary allow offloading read queries to secondaryClose to real-time data, latency of log synchronization impact data freshness Backup ve DBCC CheckDB operations can be done on secondary

19

DB2DB1

SQLservr.exe SQLservr.exe

InstanceA

DB2DB1

Primary Secondary

Database Log Synchronization

InstanceB

Reports

Page 20: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Active Secondary : Read-only RoutingApplicationIntent – A New Connection Property

Used to get access to secondary Applicable when Secondary Replica set with ALLOW_CONNECTIONS =READ_ONLY or YES (ALL)

Connection String

Connect to primary replicaServer=myListener; Database=DB1;

Connect directly to a secondary instanceServer=myListener; Database=DB1; ApplicationIntent = ReadOnly

Read-Only Routing

Connection behavior optimized for automatic routing of read only applications to secondaryYou have to create the routes manually for this to work

20

Page 21: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Active Secondary : Read-only Routing

21

Page 22: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Read-only Routing

Microsoft Confidential22

AGHR

HRDB HRDB

Primary Secondary

HRVNN

-server HRVNN;-catalog HRDB

ServerA ServerB

OLTP

Reports

-server HRVNN;-catalog HRDB; ApplicationIntent = ReadOnly

Page 23: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Read-only Routing

Microsoft Confidential23

AGHR

HRDB HRDB

HRVNN

-server HRVNN;-catalog HRDB

Primary

ServerA ServerB

OLTP

Reports

-server HRVNN;-catalog HRDB; ApplicationIntent = ReadOnly

Secondary

Page 24: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Backup on Secondary ReplicasBackups can be done on any replica of a databaseLog backups done on all replicas form a single log chainBackups on primary replica still worksSupported backup types on secondary:

Full - COPY_ONLY method is only one supported Availability Replica

Transaction LogDifferential - Not Supported

Backup PreferencePrefer SecondarySecondary OnlyPrimaryAny Replica

sys.fn_hadr_backup_is_preferred_replica

24

Page 25: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Availability Group Scenarios

25

Availability Group provides redundancy for databases on both standalone instances and failover cluster instances

Synchronize Asynchronize

A

A

Direct Attached Storage local, regional and geo secondaries

AA

Shared Storage, regional and geo secondaries

A

A

A

Page 26: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Comparison of SQL Server High-Availability and Disaster-Recovery SolutionsTechnology AlwaysOn

Failover Clustering Instances

AlwaysOn Availability Groups

Database Mirroring

Log Shipping

Zero data loss * ** **

Instance Redundancy

Database Redundancy

Auto Failover ** **

Readable Copy *** ****

Multiple Secondaries

*

Microsoft Confidential26

Page 27: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Real-Life Customer Scenario

27

Synchronize Asynchronize

A

A

Primary Data Center

SecondaryData Center

ReportsBackups

Backups

A

FCI

Page 28: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

What’s Coming with SQL Server 2014

Increase number of secondaries to 8 (from 4)Increase availability of Readable Secondaries

Use readable secondaries despite network failures (important in geo-distributed environments)

AlwaysOn Availability Groups Add Azure Replica WizardSupport for Windows Server 2012 Cluster Shared Volumes (CSV)Enhanced Diagnostics

28

Page 29: Microsoft MEA Services Webcast - HA & DR with SQL Server AlwaysOn Availability Groups

Thanks!

Questions?Turgay SahtiyanMicrosoft – Senior SQL Server PFE

www.turgaysahtiyan.com

@ @turgaysahtiyan