Sql-server – Can Availability Groups replace transactional replication

availability-groupshigh-availabilityreplicationsql serversql-server-2012

I've been looking at the new features of SQL Server 2012, and how it can help my current situation.

Currently we're on SQL Server 2008 R2, and replicate two OLTP servers' databases to a single reporting server via transactional replication. We then use these replicated DBs for reporting.

I'm interested in whether SQL Server 2012 and the Availability Groups can replace this – so instead of transactional replication, I'd use the new availability groups and mirror the two OLTP servers' databases to the reporting server – where the reporting will be able to access the read-only replicas.

I'm unsure if this will work well, or even at all.

I would like to get away from replication, as it causes issues with my deployment strategy (Using VSDBCMD.exe). I'd also like to get away from replication reinitialisation delays on large DBs.

Does anyone have any good examples or experience with this? Is it possible to mirror with readable replicas from multiple servers to a single server as per normal mirroring in lower versions?

This was originally asked here: https://stackoverflow.com/questions/10415225/mirroring-and-availability-groups-in-sql2012 Sorry I don't think I can migrate questions yet.

Best Answer

Swiped from my answer on StackOverflow, only to prevent others from spending effort on the same type of answer.

Personally I think this will work a lot better than transactional replication, though I haven't done any formal comparisons of the two in a true migration scenario. I know that with the amount of troubles folks have with transactional replication, compared to even standard mirroring (and this is an upgrade of that), you are certainly bound to have fewer problems.

The biggest boon is that the secondary can be marked as read only - so you can run all the reporting off of it that you want, and it won't affect the mirroring at all. You just need beefier tempdb (since it essentially uses rcsi to do this).

Of course you do need to be aware that both sides of the AG need to be fully licensed in order to use the replica for read-only operations. And both sides need to be running on specific versions of Windows (Enterprise or better on 2008 R2 and lower; Standard or better on 2012 and above) because they require failover clustering - the SQL instances in AGs don't need to be clustered, but they need to be sitting on top of that infrastructure in the OS.