Azure SQL Database Data Access
Updated: April 18, 2014
Microsoft Azure SQL Database provides relational database-as-a-service capabilities for application architects and developers. There are many ways to incorporate Microsoft Azure SQL Database in your database application. This topic describes some general examples of how your database application can access data in Azure SQL Database.
Accessing Data in SQL Database
In a traditional on-premises application, the application code and database are located in the same physical data center. Azure SQL Database offers many alternatives to that architecture. The following diagram demonstrates two generalized alternatives available for how your application can access data with Azure SQL Database.
In Scenario A on the left, your application code remains on-premises, but the database resides in Azure SQL Database. Your application code uses client libraries to access your database(s) in Microsoft Azure SQL Database. For more information about the client libraries that are available, see Azure SQL Database Guidelines and Limitations. Regardless of the client library chosen, data is transferred using tabular data stream (TDS) over a secure sockets layer (SSL).
In Scenario B on the right, your application code is hosted in Azure and your database resides in Azure SQL Database. Your application can use the same client libraries to access your database(s) in Azure SQL Database as are available in Scenario A.
The Scenario B client premises may represent an end user's Web browser that is used to access your Web application. The Scenario B client premises may also be a desktop or Silverlight application that uses the benefits of the Entity Data Model and the WCF Data Services client to access your data that is hosted in Azure SQL Database.
Hosting Your Data in the Cloud
The appearance and functionality of your SQL Server database experience is unchanged when you use Azure SQL Database instead of an on-premise instance of SQL Server. There are some minor differences that include Transact-SQL changes and login management. For more information, see Azure SQL Database Transact-SQL Support and Managing Databases and Logins in Azure SQL Database.
When hosting only your data in the Microsoft data center, it is important to consider the network latency between Azure SQL Database and the on-premise servers running your application code. Network latency to Azure SQL Database is higher than it would be if the database were also on your premises and you may need to account for this in your application code.
One way to minimize the network latency of requests to the database is to additionally host your application in the Azure platform.
Hosting Your Application in the Cloud
Hosting your application code in Azure is beneficial to the performance of your application because it minimizes the network latency associated with your application's data requests to Azure SQL Database.
For example, you may decide to create a Web-based user interface in Azure for your database application that is hosted in Azure SQL Database. In this scenario, the client code and data is hosted in the same physical data center, so network latency is minimal between the corresponding servers. Clients will still have to traverse the Internet to reach your database application, but the network traffic between the client code and data is much faster because those numerous data requests have a much shorter distance to travel.