Azure SQL MI Replication – New Possibilities for Hybrid Environments

Developer Support

In his latest post, App Dev Manager Wyn Lewis-Bevan discusses the new Azure SQL Database Managed Instance (SQL MI) which is a fully managed relational cloud database service that provides the broad SQL Server engine compatibility. He also shares resources on how you can get started on using Azure SQL Server MI.


As customers continue to have more applications deployed in Azure, it’s common that data from those on-premises applications has to be shared with the new cloud applications or vise-versa.  A simple batched methodology may be suitable for table data that is rarely updated, but for data that changes frequently, this may introduce an unacceptably high latency and undermine any data concurrency, expected by the business users.

One of the limitations of SQL Azure database is that it can’t support a SQL agent, so replication, while possible from on-premises to the cloud, is not available in the opposite direction.  One solution is the use of the relatively new Azure SQL Database Managed Instance, SQL MI, that allows replication from the cloud replicated back to an on-premises SQL database.

For customers who want live data movement between the SQL Server in the cloud and an on-premises SQL Server database, SQL Server Managed Instance is envisioned as the preferred, go to, platform for SQL Server in the cloud.  Compared to an IaaS instance, SQL MI is nearly 100% compatible with SQL Server Enterprise Edition but since it is built as a PaaS solution, it comes with has reduced management overhead since SQL/OS patching and version updates are not the customer’s responsibility.  Additional features like backup and high-availability, a 4-9s uptime SLA, just to mention a few come with SQL Server MI.

While most transactional replication features carry over from the on-premises version, there are limitations worth mentioning here.  For example, merge, updating subscriber and Peer-to-Peer transactional replication types are not supported in SQL MI.  File stream data is not supported in SQL MI, so direct replication between an on-premises database with FileTable storage and a SQL MI database is also not possible at this time.

While most of the transactional replication features will work in the same way as in on-premises SQL Server Enterprise Edition there are caveats. The publisher/distributor/subscriber databases can be hosted either on-premises or in SQL MI, but the publisher/distributor need to be located together, either on-premises or in the cloud on the same vNet.

Assuming an overall migration to the cloud, where the cloud is now the focal point of future development and deployment efforts, let’s assume the focus is to have data synchronization originate in the cloud.  Since a requirement is that the publisher and distributor must reside in the same environment, they both have to be located in the cloud and in a single vNet.  If the subscriber database is also in the cloud, then it also has to reside in the same vNet or a peered vNet.

The steps to build all the components are well documented.

The following requirements exist for the publisher and distributor to reside on Azure SQL MI:

Conclusion and Summary 

The addition of transactional replication that can originate in the Azure cloud is a significant addition to the arsenal of the database architect. Furthermore, being able to move the data from a publisher in the cloud to either other cloud databases (SQL Azure, SQL MI or Elastic Pools etc.) or to an on-premises subscriber is very powerful. This is because it allows the control of a single source of the truth to a single source of data located in the cloud that can be shared across multiple applications.

Organizations can now use transactional replication to have near real-time data concurrency between databases within the cloud or between the cloud and on premises.  The recent addition of bidirectional transactional replication (at the time of writing, in public preview,) though not discussed in this blog, will add a new dimension that brings additional possibilities on how to enable hybrid data solutions requiring data input either in the cloud or on-premises for consumption by applications that in either location leading to a truly hybrid Azure architecture.

 

 

 

 

 

0 comments

Discussion is closed.

Feedback usabilla icon