Build and Host .NET Database Application
- Host your application code on-premises at your own corporate data center, but host your database in SQL Database. Your application code uses client libraries to access the database(s) in SQL Database. For more information about the client libraries that are available, see Guidelines and Limitations (Windows Azure SQL Database). For example code, see How to: Connect to Windows Azure SQL Database Using ADO.NET topic.
- Host your application code in Windows Azure and your database in SQL Database. Your application can use the same client libraries to access the database(s) in SQL Database. In this case, your client application may be a desktop or Silverlight application that uses the benefits of the Entity Data Model and the WCF Data Services client to access data that is hosted in SQL Database. For example code, see How to: Connect to Windows Azure SQL Database Through WCF Data Services.
Development Considerations – Connectivity
Developing applications for Windows Azure SQL Database is very similar to developing applications for SQL Server. You can choose from many application types and technologies when you develop an application that accesses Windows Azure SQL Database. Windows Azure SQL Database works with third-party applications, PHP, and many Microsoft applications, such as ADO.NET, the Entity Framework, WCF Data Services, and ODBC.
Windows Azure SQL Database provides a large-scale multi-tenant database service on shared resources. In order to provide a good experience to all Windows Azure SQL Database customers, your connection to the service may be closed due to the following conditions:
- Excessive resource usage
- Long-running queries
- Long-running single transactions, between the BEGIN TRAN and END TRAN statements
- Idle connections
This is different from how an on-premise instance of SQL Server works.
To provide a seamless user experience when a connection is closed, incorporate retry logic in your application to detect a closed connection and then attempt to complete the interrupted action. For more information on connection limitations in Windows Azure SQL Database, see General Guidelines and Limitations (Windows Azure SQL Database).