Editorials

SQL Failover Techniques ? Always On

SQL Server Always On was introduced in SQL Server 2012. It combines features of previous failover mechanisms such as database mirroring and database clustering.

Always On uses the same concept of database mirroring, expanding the concept from a Primary and a single Mirror to a Primary and multiple Mirrors. Always on replicas work by the primary database transaction log entries being shipped to the replicas, and written to the remote database. That is a simple description and there are options how the replication is done, and features enabled based on the options chosen.

In database mirroring, the primary and the mirror are known to the client by declaring them in the database connection string of the client applications. Always on may have one or more mirrors, thus requiring a different mechanism. Always On uses the virtual database connection like database clustering so that the client need not be aware of the database configurations.

New to Always on is the ability to use a replica in a read only mode. Writes may be made to the primary database, and reads taken from one or more of the replicas. Database correction may be done by having multiple copies of the database. If a page becomes corrupted in one database, it can be restored by taking a non-corrupted page from another instance of the database.

Like database mirroring, Always On shares nothing. It requires duplicate disk space, separate instances of SQL Server, and for a practical use, separate servers.

Always On looks a lot like the failover built into SQL Azure, where you as the client don’t need to know what failover strategy is implemented as a database consumer. It just works. One key thing to understand about Always On is that it does not replace disaster recovery. Even if you were to configure Always On over wide area network with co-located hosts, you are not protected from data corruption, etc. Disaster recovery is still essential for databases even with immediate failover implementations.

Are you using Always On? Share your experience with us here online or drop me an email at btaylor@sswug.org.

Cheers,

Ben