SQL Server AlwaysOn for Dummies SQL Santa Edition

32
SQL Server AlwaysOn for Dummies Mark Broadbent SQLCloud SQLCLOUD.CO.UK

description

Welcome to Microsoft's world of the buzzword. Yes, they've done it again and created another ambiguous term that no one really understands. In this presentation, we will delve into their murky world and reveal the technology behind the buzz.

Transcript of SQL Server AlwaysOn for Dummies SQL Santa Edition

Page 1: SQL Server AlwaysOn for Dummies SQL Santa Edition

SQL Server AlwaysOn for Dummies

Mark Broadbent SQLCloud SQLCLOUD.CO.UK

Page 2: SQL Server AlwaysOn for Dummies SQL Santa Edition

Agenda

Windows Server Failover Clustering

AlwaysOn Availability Groups

AlwaysOn Failover Clustered Instances

Introduction to AlwaysOn

3

2

1

4

Page 3: SQL Server AlwaysOn for Dummies SQL Santa Edition

About

Mark Broadbent “30 billion times more intelligent than a live mattress”

• Email: [email protected]

• Twitter: retracement

• Blog: http://tenbulls.co.uk

• Event Lead to the UK’s first ever SQLSaturday (Cambridge)

http://www.sqlsaturday.com/events.aspx

• Cambridgeshire PASS Chapter UG Leader http://sqlcambs.org.uk

Page 4: SQL Server AlwaysOn for Dummies SQL Santa Edition

Introduction to AlwaysOn

Page 5: SQL Server AlwaysOn for Dummies SQL Santa Edition

AlwaysOn Technologies*1

*1 According to my interpretation!

AlwaysOn Availability Groups

AlwaysOn Failover Clustered Instances

Database Mirroring

Scalable Shared Database

Replication

Page 6: SQL Server AlwaysOn for Dummies SQL Santa Edition

AlwaysOn is…

Page 7: SQL Server AlwaysOn for Dummies SQL Santa Edition

AlwaysOn Clustered Instances Provide…

• Abstraction of SQL instance

• High availability of Instance name

• Instance and related services failover as a unit

• Instance components such as jobs and logins not a consideration

BUT

• Shared data with single point of failure per instance.

• Complex to administrate

Page 8: SQL Server AlwaysOn for Dummies SQL Santa Edition

Availability Groups Provide…

• Abstraction at the databases level • Failover as a single Unit • High availability of “Instance” (listener) name • All the benefits of DB Mirroring

….and less of the problems (FS is supported)

BUT • Connected replicas are potentially single point of

failure (i.e user error – deletion of records) • Complex (arguably less than FCI) to administrate • Instance level components not failed over –contained

dbs partially come to the rescue

Page 9: SQL Server AlwaysOn for Dummies SQL Santa Edition

Dr. Evil Senior Microsoft Windows Clustering Program Manager

Page 10: SQL Server AlwaysOn for Dummies SQL Santa Edition

Don’t let the terms confuse you!

Cluster Node Cluster Server

Node Server

Cluster Group Role

Service or Application Virtual Server

Failover Cluster Clustered Instance

SQL Server Server

Resources (take your pick)

Quorum

Client Network

Private Network Interconnect

Internal Network

Public Network... LAN

SAN

Shared Storage

Disk

Cluster Storage

Active/Passive

Single Instance Multi Instance

N+n Cluster

Majority

Votes

Page 11: SQL Server AlwaysOn for Dummies SQL Santa Edition

Windows Server Failover Clustering

Page 12: SQL Server AlwaysOn for Dummies SQL Santa Edition

“The Magic” of Clustering

Clustered

“Application”

Cluster Nodes

failover

Page 13: SQL Server AlwaysOn for Dummies SQL Santa Edition

“The Magic” of Clustering

Clustered

“Application”

Cluster Nodes

failover

Page 14: SQL Server AlwaysOn for Dummies SQL Santa Edition

“The Magic” of Clustering

Clustered

“Application”

Cluster Nodes

Page 15: SQL Server AlwaysOn for Dummies SQL Santa Edition

Storage

Network

Internal

Network

A Basic Windows Cluster

Public

(or Client) Network

Shared

(or Asymmetric) Storage

Quorum The Cluster

Group

Cluster Node

Cluster Service

Page 16: SQL Server AlwaysOn for Dummies SQL Santa Edition

Understanding Quorum I’m

Alive!

Page 17: SQL Server AlwaysOn for Dummies SQL Santa Edition

Quorum Models

Node majority (no witness)

Node majority with witness (disk or file share)

No majority (disk witness only)

+Node weighting Dynamic weighting -new to Windows 2012

Page 18: SQL Server AlwaysOn for Dummies SQL Santa Edition

DEMO

Taking a look at our Cluster

Page 19: SQL Server AlwaysOn for Dummies SQL Santa Edition

AlwaysOn Failover Clustered Instances

Page 20: SQL Server AlwaysOn for Dummies SQL Santa Edition

Installation

Page 21: SQL Server AlwaysOn for Dummies SQL Santa Edition

Clustered Instances

failover Node A Node B

SQL Server Instance A

Role (formerly known as Cluster Group)

Network Name

Page 22: SQL Server AlwaysOn for Dummies SQL Santa Edition

Clustered Instances

Node A Node B

SQL Server Instance A

Role (formerly known as Cluster Group)

Network Name

Page 23: SQL Server AlwaysOn for Dummies SQL Santa Edition

AlwaysOn Availability Groups

Page 24: SQL Server AlwaysOn for Dummies SQL Santa Edition

Availability Group consists of…

Listener

Availability Group

Resource

Availability Group

Databases

Replica/s

Instance Components Cluster Resources

Page 25: SQL Server AlwaysOn for Dummies SQL Santa Edition

Availability Groups

Transaction Logs

Availability Group

SQL Server Instance A

Transaction Logs

Redo

Sync/ Async

Secondary Replica

SQL Server Instance B

Listener

Page 26: SQL Server AlwaysOn for Dummies SQL Santa Edition

Readible Secondaries

• 5 replicas

• 2 synchronous, others aysnchronous

• 1 Read/ Write

• 4 either Readonly, Read-Intent or No Access

Page 27: SQL Server AlwaysOn for Dummies SQL Santa Edition

ReadOnly Routing

• Set connection string property ApplicationIntent=ReadOnly

• Must connect to a listener.

• Modify Secondary Replica Roles with read only routing url.

• Modify Primary Replica Roles with read only routing list.

Page 28: SQL Server AlwaysOn for Dummies SQL Santa Edition

DEMO

Using AlwaysOn

Page 29: SQL Server AlwaysOn for Dummies SQL Santa Edition

Installing to Server Core

Page 30: SQL Server AlwaysOn for Dummies SQL Santa Edition

[Session Code]

Page 31: SQL Server AlwaysOn for Dummies SQL Santa Edition
Page 32: SQL Server AlwaysOn for Dummies SQL Santa Edition

In Summary…

• It is not all Butterflys and Unicorns so choose the HA solution appropriate to your requirements.

• Failover Clustering is a very mature technology but requires specialist skill and understanding. It does not provide scalability.

• Availability Groups partially rely on Windows Clustering but are slightly easier to setup and manage. They also provide reporting query scalability.