Deploying Azure SQL Databases for Hosting DB1 and DB2 | Server-Side Transactions

Azure SQL Databases for Hosting DB1 and DB2

Question

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You have an app named App1 that uses data from two on-premises Microsoft SQL Server databases named DB1 and DB2.

You plan to move DB1 and DB2 to Azure.

You need to implement Azure services to host DB1 and DB2. The solution must support server-side transactions across DB1 and DB2.

Solution: You deploy DB1 and DB2 as Azure SQL databases on the same Azure SQL Database server.

Does this meet the goal?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B.

B

Instead deploy DB1 and DB2 to SQL Server on an Azure virtual machine.

Note: Understanding distributed transactions.

When both the database management system and client are under the same ownership (e.g. when SQL Server is deployed to a virtual machine), transactions are available and the lock duration can be controlled.

https://docs.particular.net/nservicebus/azure/understanding-transactionality-in-azure

Yes, the solution of deploying DB1 and DB2 as Azure SQL databases on the same Azure SQL Database server meets the goal of supporting server-side transactions across both databases.

Server-side transactions refer to the ability to perform transactions that span multiple databases within a single transaction, ensuring data consistency and integrity. Azure SQL Database server supports distributed transactions, which enable server-side transactions to be executed across multiple databases.

By deploying DB1 and DB2 as Azure SQL databases on the same Azure SQL Database server, you can easily enable distributed transactions between them. Azure SQL Database server provides a built-in feature called elastic transactions that allows you to group multiple databases together and treat them as a single logical database. You can use the elastic transactions feature to enable distributed transactions across DB1 and DB2.

In addition, deploying DB1 and DB2 as Azure SQL databases on the same Azure SQL Database server also provides benefits such as high availability, automatic backups, and scalability. Azure SQL Database server automatically replicates databases to multiple nodes, ensuring high availability and data redundancy. It also provides automatic backups, which can be restored to any point in time within the retention period. Scaling up or down the database resources can be done easily and without downtime.

Therefore, deploying DB1 and DB2 as Azure SQL databases on the same Azure SQL Database server is a suitable solution for the scenario described in the question, as it meets the goal of supporting server-side transactions across DB1 and DB2 and provides additional benefits.