How to tune your applications before moving your database to Microsoft Azure SQL Database (MASD) OK, you've jumped into your Azure journey by creating your Azure SQL Database. Created your schema and filled up your data or just used import/export wizard. Then, you've plugged your application(s) to this new Azure SQL Database but something goes wrong by means of performance. It was working perfectly ok when your database was running on your on premises SQL Server. But now it does not perform very well with Azure SQL Database and your users started reporting interesting error message that you did not see before. "What could it be wrong ?" Faruk Çelik / Developer Support Escalation Engineer / Microsoft
Sponsors Main Sponsor Gold Sponsors
Azure SQL Database Topology Application Internet TDS (tcp) Load Balancer Forwards “sticky” sessions to TDS protocol tier TDS tcp) Security Boundary Load Balancer TDS Protocol Gateway – Proxy to Backend SQL Server SQL Server SQL Server SQL Server SQL Server SQL Server SQL Server SQL Azure Fabric – Automatic Failover, Replication and Load Balancing
Data Access technologies you can use connectiong SQL Azure Database Managed (.NET) applications : ADO.NET, Entity Framework and ODBC Unmanaged (non-.NET) applications: Use ODBC OLEDB is not supported ! Java applications: Use Microsoft SQL Server JDBC Driver 4.0 (4.1 is in CTP) On Linux : Use Microsoft ODBC Driver 11 on Linux (Tested on RHEL 5 and 6. SUSE version is in CTP)
Data Access tools you can use connectiong SQL Azure Database Use familiar tools (sqlcmd, osql, SSMS, etc) (SQL Server Management Studio 2008 R2 / 2012 / 2014)
Monitoring Azure SQL Database Using Dynamic Management Views http://msdn.microsoft.com/en-us/library/ff394114.aspx Microsoft Azure SQL Database enables a subset of dynamic management views to diagnose the performance problems, which might be caused by blocked or long-running queries, resource bottlenecks, poor query plans, and so on. This topic provides information on how to detect common performance problems by using the dynamic management views in Microsoft Azure SQL Database. Microsoft Azure SQL Database partially supports three categories of dynamic management views: Database-related dynamic management views. Execution-related dynamic management views. Transaction-related dynamic management views.
Not-supported features a developer should know OLE DB provider is not supported Creating a linked server in your on-prem SQL Server to MASD is not supported «yet» Distributed transactions are not supported
Authentication SQL Server SQL Azure Windows Authentication SQL Authentication SQL Azure SQL Authentication only!!!
Connection Management SQL Server No default connection termination SQL Azure Server (and other internal MS tools) decides to keep a connection or terminate
Azure SQL Database General Guidelines and Limitations http://msdn.microsoft.com/en-us/library/azure/ee336245.aspx Database Throughput Unit (DTU) Quotas Driver, Library, and Protocol Support Visual Studio Support Tools and Technology Support Data Migration Support SQL Server Agent/Jobs Transaction Support Row Versioning-Based Isolation Levels SQL Server Collation Support Clustered Index Requirement Database Count and Size Limit Naming Requirements Connection Constraints
Connection-loss errors http://msdn.microsoft.com/en-us/library/azure/4cff491e-9359-4454-bd7c-fb72c4c452ca#bkmk_connection_errors Resource ID: %d. The %s limit for the database is %d and has been reached. For more information, see http://go.microsoft.com/fwlink/?LinkId=267637. Resource ID: %d. The %s minimum guarantee is %d, maximum limit is %d and the current usage for the database is %d. However, the server is currently too busy to support requests greater than %d for this database. For more information, see http://go.microsoft.com/fwlink/?LinkId=267637. Otherwise, please try again later. The service has encountered an error processing your request. Please try again. Error code %d. The service is currently busy. Retry the request after 10 seconds. Incident ID: %ls. Code: %d. The database has reached its size quota. Partition or delete data, drop indexes, or consult the documentation for possible resolutions. Session is terminated because you have a long-running transaction. Try shortening your transaction. The session has been terminated because it has acquired too many locks. Try reading or modifying fewer rows in a single transaction. The session has been terminated because of excessive TEMPDB usage. Try modifying your query to reduce the temporary table space usage. The session has been terminated because of excessive transaction log space usage. Try modifying fewer rows in a single transaction. The session has been terminated because of excessive memory usage. Try modifying your query to process fewer rows. Database '%.*ls' on server '%.*ls' is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of '%.*ls'.
Enterprise Library - Transient Fault Handling App Block – Microsoft SQL Azure Database https://www.nuget.org/packages/EnterpriseLibrary.TransientFaultHandling.Data/6.0.1304.1
Demo : Implementing Transient Fault Handling
Interactive Troubleshooter for Microsoft Azure SQL Database connectivity issues http://support.microsoft.com/kb/2980233/en-us Don’t forget checking : http://azure.microsoft.com/en-us/status
Resources Idle connection resiliency : http://msdn.microsoft.com/en-us/library/dn632678.aspx Scaling Out Azure SQL Databases (Elastic Scale, Custom Sharding) : http://msdn.microsoft.com/en-us/library/dn495641.aspx Free Microsoft Press eBook : «Building Cloud Apps with Microsoft Azure» July, 2014 http://www.microsoftvirtualacademy.com/ebooks#9780735695658
Q&A