CHAPTER 10
Azure SQL Database has been built from the ground up as a robust highly available database service using a system in which three or more replicas of each database are maintained at all times, with updates committed to at least two replicas before responding. This HA system addresses local hardware and software failures. In spite of such a high redundancy, it is still susceptible to planned as well as unplanned outages. Microsoft provides an SLA of 99.99% (Four nines) which translates to downtime of 52.56 minutes per year but there can still be unplanned outages like human error where DBA accidently deleted the data while performing an maintenance operation or application upgrade went bad or regional disaster or there can be planned outages where you would like to run database from different location while the current database is under service maintenance or application upgrade.
As discussed earlier, the following business continuity features are available in V12 version of Azure SQL Database.
Table 14: Business Continuity Features in Azure SQL Database
Capability | Basic tier | Standard tier | Premium tier |
|---|---|---|---|
Point In Time Restore | Any restore point within 7 days | Any restore point within 14 days | Any restore point within 35 days |
Geo-Restore | ERT < 12h, RPO < 1h | ERT < 12h, RPO < 1h | ERT < 12h, RPO < 1h |
Standard Geo-Replication | not included | ERT < 30s, RPO < 5s | ERT < 30s, RPO < 5s |
Active Geo-Replication | not included | not included | ERT < 30s, RPO < 5s |
ERT refer to estimated recovery time which is estimated time to restore and recover the database until recovery point.
RPO stands for Recovery Point Objective which measures the amount of data lost by the time the database is restored and brought online.
The combination of geo-restore, standard geo-replication and active geo-replication provides you with a range of options to implement a business continuity solution that meets the needs of your application and business. The following table summarized the Business Continuity scenarios and which solution would useful under each scenario.
Table 15: Business Continuity scenarios
Scenario | Geo-restore | Standard Geo-replication | Active Geo-replication |
Regional disaster | Yes | Yes | Yes |
DR drill | Yes | Yes | Yes |
Online application upgrade | No | No | Yes |
Online application relocation | No | No | Yes |
Read load balancing | No | No | Yes |
In this chapter we will discuss all the above business continuity solutions available in Azure SQL Database in detail.
A database in Azure SQL Database is continuously backed up within azure data centers using full database backups, incremental and transaction log backup. The Point in time restore allows you to be able to restore the database from the backups to the transaction occurred at the specified point in time. This capability is available in all the service tiers but the restore point depends on the retention policy supported by each service tier. You can go back 7 days with Basic tier, 14 days with Standard tier, and 35 days with Premium tier. Point in time are specifically useful to recover from human error where a user has accidently dropped a table or overwritten a data which need to be recovered. You can perform point in time restore using Azure Portal or PowerShell.
You can follow the steps mentioned in this section to restore a database at a specified point in time

Figure 32: Perform Point in time restore of Azure SQL Database
You can also restore the database at a specified point in time using Start-AzureSqlDatabaseRestore PowerShell cmdlet.
Geo-restore provides the ability to restore a database from a geo-redundant backup to create a new database. The database can be created on any server in any Azure region. Because it uses a geo-redundant backup as its source, it can be used to recover a database even if the database is inaccessible due to an outage. Geo-restore is automatically enabled for all service tiers at no extra cost.
You can follow the steps mentioned in this section to perform a Geo-restore of Azure SQL Database

Figure 33: Performing a Geo-Restore of Azure SQL Database
You can also perform geo-restore of Azure SQL Database using Start-AzureSqlDatabaseRecovery PowerShell cmdlet.
Standard Geo-Replication allows you to configure your database to asynchronously replicate committed transactions from the primary database to the secondary in a predefined Azure region. Standard geo-replication is built on the same technology as active geo-replication but is optimized for applications that use geo-replication only to protect the application from regional failures. The following list shows how standard geo-replication is different from active geo-replication:
Standard Geo-Replication is useful when you want to recover from a regional disaster or during DR drills for compliance.
You can follow the steps mentioned in the section to configure Standard or Active Geo-Replication

Figure 34: Configuring Standard or Active Geo-Replication
In the event of the outage on the primary database when you want to perform failover, you would come to the same Geo-Replication blade as shown in the previous figure and under SECONDARIES section, right click on the row with the name of the database you want to recover to and click Stop to stop and terminate the continuous copy relationship and bring the secondary database online. For a full description on termination of continuous copy relationship, you can refer to the following MSDN article
https://msdn.microsoft.com/library/azure/dn741323.aspx
You can also terminate the continuous copy relationship to stop and failover to secondary using Stop-AzureSqlDatabaseCopy PowerShell cmdlet.
Active geo-replication, available for Premium databases, provides the richest solution with the least risk of data loss and the most rapid recovery time. It extends standard geo-replication with up to 4 geo-replicated secondaries that are online and readable at all times, and which can also be used for load balancing or to provide low-latency access to replicated data anywhere in the world.
Using active geo-replication you can create a continuously replicated copy of a database that can be frozen immediately prior to applying updates or maintenance to the database or an application. Should any errors be detected during or after the process it is then easy to fallback quickly to this copy.
Tip: While Active Geo-replication is available on in premium service tier. You can still leverage the benefits of active geo-replication for performing application or service upgrade by switching to premium service tier just before the upgrade operation and perform the upgrade with active geo-replication and after the upgrade is completed you can switch back to lower service tier to save cost.
You can configure Active geo-replication using the steps mentioned above when you configure standard geo-replication but with active geo-replication you will configure secondary type as readable and you can have up to 4 geo-replicated secondaries that are online and readable at all times. Similar to Standard geo-replication, when you would like to failover, you would go the Geo-replication blade for that database and right click on the secondary to which you want to failover and click Stop to terminate the continuous copy relationship and bring database online in read-write mode.
Once you have managed the failover process you will want to reconstruct the same pattern of geo-replication relationships you were using previously only with the new production database as the primary to ensure you have the geo-redundancy and load-balancing that your applications and business continuity policies require.
For further information on Active replication for Azure SQL Database, you can refer to the following MSDN article.
https://msdn.microsoft.com/en-us/library/azure/dn741339.aspx