A QUICK GUIDE TO
SQL SERVER
AVAILABILITY GROUPS
Pio R. Balistoy Jr.
Lead Database Consultant
Pythian
WHAT IS ALWAYS ON?
High Availability and Disaster Recovery
Log Shipping
Before Always ON?
Failover Clustering
Database Mirroring
AlwaysOn Availability Group
WHAT IS AVAILABILITY
GROUP?
- It is a High-availability AND Disaster Recovery feature that provides
enterprise-level alternative for Database Mirroring.
- It is a group of databases that you can failover between Replicas
(Failover cluster nodes).
CONFIGURING
ALWAYS ON
AVAILABILITY GROUPS
DEMO
ADVANTAGES OF AG OVER
PREVIOUS HA SOLUTIONS
- Separate SQL Instances
- Databases can be grouped and failover separately
- Multiple Secondaries
- Readable Secondaries
- Read-only Transactions can be offloaded from the primary server
- AG Listener – Seamless failover
- Automatic Page Repair between Primary and Secondary
- Backups Can be Off-loaded
DISADVANTAGES OF AG
COMPARED TO PREVIOUS HA
SOLUTIONS
- Synchronizing Server-level Objects (Logins, jobs, Linked Servers,
etc)
- Index Administration and Maintenance
- Testing the boundaries of Failover Cluster
- Network-dependent
- Supported Applications
- Performance and Administrative Overhead
- Compatibilities with other SQL Server features that may be in use
COMPATIBILITIES WITH
OTHER SQL SERVER
FEATURES
SQL Server Failover Cluster – Supported but no Automatic Failover.
Replication – Publisher and (transactional) Subscriber can be in AG.
Distributor is not supported and Merge Subscribers need to be recreated
after a failover.
SSRS – Database Sources can be in AG, Auto-Failover of ReportServer and
ReportServerTempdb is not fully supported. (SQL Server Agent and SSRS
needs to be restarted after failover if the Repot Server databases are in AG)
Log Shipping - Not Fully supported, can be done manually.
Analysis Services – It’s supported. Requires Native Client 11.0 or .Net
Framework 4.0.2 and above.
Service Broker – Supported. (NEED to create the SB on all replica, setting
Listener IP to ‘ALL’
Sharepoint – Can work, but not supported.
AG COMPONENTS AND
TERMINOLOGIES
Availability Group – The set of Databases that fails over together
Availability Replica – The Instance of the AG that is hosted on a SQL
Instance
 Primary Replica - The Replica that is in read-write mode and delivers the
transactions to the other replicas.
 Secondary Replica – The Replica that has the copies of the availability databases,
receives changes from the primary Replica and serves as a failover target.
Secondary Replica can be in read-only or read-intent mode.
Availability Database – These are the databases within the Availability
group that is being replicated across the Replica
Availability Group Listener – A Server Name clustered resource that
clients can use to connect to the Primary/Secondary Replica
depending on the connection settings and intent.
AG COMPONENTS AND
TERMINOLOGIES
Availability Modes – describes how transactions are committed
between replicas.
 Synchronous mode – Waits till the transaction is delivered to all replicas before
hardening the changes. This ensures high-availability and data protection at the
cost of performance. You need to have at least the primary and one secondary
replica to be in this mode if you want auto-failover.
 Asynchronous mode – Commits the transaction on the primary/synchronous mode
replica first. This ensures prioritizes performance over data integrity. Failover may
result to data-loss. This mode is more for Disaster-Recovery setup or for Replicas
residing on different locations.

A Quick Guide to Sql Server Availability Groups

  • 1.
    A QUICK GUIDETO SQL SERVER AVAILABILITY GROUPS Pio R. Balistoy Jr. Lead Database Consultant Pythian
  • 2.
    WHAT IS ALWAYSON? High Availability and Disaster Recovery
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
    WHAT IS AVAILABILITY GROUP? -It is a High-availability AND Disaster Recovery feature that provides enterprise-level alternative for Database Mirroring. - It is a group of databases that you can failover between Replicas (Failover cluster nodes).
  • 8.
  • 9.
    ADVANTAGES OF AGOVER PREVIOUS HA SOLUTIONS - Separate SQL Instances - Databases can be grouped and failover separately - Multiple Secondaries - Readable Secondaries - Read-only Transactions can be offloaded from the primary server - AG Listener – Seamless failover - Automatic Page Repair between Primary and Secondary - Backups Can be Off-loaded
  • 10.
    DISADVANTAGES OF AG COMPAREDTO PREVIOUS HA SOLUTIONS - Synchronizing Server-level Objects (Logins, jobs, Linked Servers, etc) - Index Administration and Maintenance - Testing the boundaries of Failover Cluster - Network-dependent - Supported Applications - Performance and Administrative Overhead - Compatibilities with other SQL Server features that may be in use
  • 11.
    COMPATIBILITIES WITH OTHER SQLSERVER FEATURES SQL Server Failover Cluster – Supported but no Automatic Failover. Replication – Publisher and (transactional) Subscriber can be in AG. Distributor is not supported and Merge Subscribers need to be recreated after a failover. SSRS – Database Sources can be in AG, Auto-Failover of ReportServer and ReportServerTempdb is not fully supported. (SQL Server Agent and SSRS needs to be restarted after failover if the Repot Server databases are in AG) Log Shipping - Not Fully supported, can be done manually. Analysis Services – It’s supported. Requires Native Client 11.0 or .Net Framework 4.0.2 and above. Service Broker – Supported. (NEED to create the SB on all replica, setting Listener IP to ‘ALL’ Sharepoint – Can work, but not supported.
  • 12.
    AG COMPONENTS AND TERMINOLOGIES AvailabilityGroup – The set of Databases that fails over together Availability Replica – The Instance of the AG that is hosted on a SQL Instance  Primary Replica - The Replica that is in read-write mode and delivers the transactions to the other replicas.  Secondary Replica – The Replica that has the copies of the availability databases, receives changes from the primary Replica and serves as a failover target. Secondary Replica can be in read-only or read-intent mode. Availability Database – These are the databases within the Availability group that is being replicated across the Replica Availability Group Listener – A Server Name clustered resource that clients can use to connect to the Primary/Secondary Replica depending on the connection settings and intent.
  • 13.
    AG COMPONENTS AND TERMINOLOGIES AvailabilityModes – describes how transactions are committed between replicas.  Synchronous mode – Waits till the transaction is delivered to all replicas before hardening the changes. This ensures high-availability and data protection at the cost of performance. You need to have at least the primary and one secondary replica to be in this mode if you want auto-failover.  Asynchronous mode – Commits the transaction on the primary/synchronous mode replica first. This ensures prioritizes performance over data integrity. Failover may result to data-loss. This mode is more for Disaster-Recovery setup or for Replicas residing on different locations.