- Azure Hybrid Benefit Savings Calculator
- FAQ, see section: “How does the Azure Hybrid Benefit work with Azure SQL Database
- Save costs for SQL Database compute resources with Azure SQL Database reserved capacity
- Enterprise Dev/Test subscription
- Provides special lower Dev/Test rates
- Only users with MSDN (Visual Studio) subscription users would be able to access a Dev/Test subscription: https://azure.microsoft.com/en-us/offers/ms-azr-0148p/
- Azure SQL Database managed Instance is currently supported on these subscription types
- Azure SQL Database (ASDB): Single Database vs Managed Instance
- Single
- Most commonly used SQL Server features are available
- Ability to assign necessary resources (CPU/storage) to individual databases.
- Supports private link via private endpoint
- Managed Instance
- High compatibility with SQL Server features on-premises
- Private IP address, injected within Azure VNet
- Supports public endpoints as well, should you want applications to connect from outside your virtual network
- Feature Comparison with SQL Server
- Managed instance T-SQL differences, limitations, and known issues
- Note: SQL Server Agent, Cross database-queries, linked servers, server logins, Transparent Data Encryption
- Single
-
High Availability Architecture Differences Between General Purpose and Business Critical
- Local HA is built-into ASDB: Single + MI.
- General Purpose Tier
- Replication of compute. Conceptionally similar to a SQL Server failover clustered instance.
- Business Critical Tier
- Replication of compute and (local SSD) storage.
- Local synchronous replicas. Conceptionally similar to a SQL Server always on availability group.
- This edition has fast local SSD storage.
- Read-Only replica is available at no extra cost for reporting queries.
- Zone redundant configuration is available in certain regions.
-
Remote BCDR is provided by the Failover Group feature
- When created for SQL Managed Instances, a failover group contains all user databases in the instance and therefore only one failover group can be configured on an instance.
- Auto-failover groups support replication of all databases in the group to only one secondary server in a different region
- You can failover a failover group manually. You can also define an automatic failover policy (which defines a grace period) so that any outage which impacts one or several of the databases in the group results in automatic failover. The SQL Database service triggers failover after the failure is detected and the grace period has expired. If an outage is detected, SQL waits for the period you specified by GracePeriodWithDataLossHours. The default value is 1 hour. If you cannot afford data loss, make sure to set GracePeriodWithDataLossHours to a sufficiently large number, such as 24 hours.
- Primary and secondary servers for the databases in the failover group must be in the same subscription
- Consider dependencies external to the databases such as VNET's, server level logins, and server level firewall rules. Some of these are outlined here.
- Failover Group SLAs
- This article discusses common application patterns used to create globally distributed applications optimized for local access to the data, including the benefits and trade-offs of each option: Designing globally available services using Azure SQL Database.
-
- "SQL Database uses SQL Server technology to create full backups every week, differential backups every 12 hours, and transaction log backups every 5-10 minutes. The backups are stored in RA-GRS storage blobs that are replicated to a paired data center for protection against a data center outage. When you restore a database, the service figures out which full, differential, and transaction log backups need to be restored."
- Azure Paired Regions
- Backup Storage Costs
- 100% of database size is provided at no extra charge
-
- On an ongoing basis, the Azure SQL Database engineering team automatically tests the restore of automated database backups of databases across the service. Upon restore, databases also receive integrity checks using DBCC CHECKDB. Any issues found during the integrity check will result in an alert to the engineering team.
-
- Up to 10 years for single db. Currently in public preview for managed instance
-
Point In Time Restore. Restore a database to a point-in-time within the retention period. This operation will create a new database in the same server as the original database.
-
Restore a deleted database.Restore a deleted database to the time it was deleted or any time within the retention period. The deleted database can only be restored in the same server where the original database was created.
-
Export a Single DB Database. When you need to export a database for archiving or for moving to another platform, you can export the database schema and data to a BACPAC file. A BACPAC file is a ZIP file with an extension of BACPAC containing the metadata and data from the database.
-
Copy Only Backups are available in SQL Managed Instance
-
Geo-Restore allows you to restore a database to another geographical region.
- Azure automatically handles patching, backups, failure detection, underlying potential hardware, software or network failures, deploying bug fixes, failovers, database upgrades, and other maintenance tasks.
- Planned Maintenance
- See section “What to expect during a planned maintenance event…"
- It is recommended that you add connection retry logic in your applications
- Hot patching SQL Server Engine in Azure SQL Database
- Azure Database Migration Guide
- Azure Database Migration Service allows for online migrations
- Import a Database via BacPac
- Restore a SQL Server Backup to SQL Managed Instance
- Sizing your database workload for SQL Managed Instance
- This article discusses the resource limits for ASDB MI
- The easiest approach would be to use the DTU calculator. Managed instance only supports VCore (not DTU), but you can easily convert DTUs to vCores.
- You can also use custom perf counters or the SkuRecommendationDataCollectionScript.ps1 script which is part of the Database Migration Assistant.
- Some key Sysmon performance counters for OLTP workloads
- IOPS: LogicalDisk: Disk Reads/sec, LogicalDisk: Disk Writes/sec
- IO Latency: Avg. Disk sec/Read, Avg. Disk sec/Write
- Database t-log activity: Log Bytes Flushed/sec
- CPU: Processor - % Processor Time
- Memory: Memory: Available Megabytes, SQL Server: Memory Manager: Total Server Memory (KB), \SQLServer:Memory Manager\Target Server Memory (KB), SQL Server Buffer Manager: Page Life Expectancy
- SQL Server Performance Objects
- Database Experimentation Assistant is an A/B testing solution for SQL Server upgrades. It will assist in evaluating a targeted version of SQL for a given workload
- What is the difference between VNET Service Endpoint and Private Endpoint
- "When using Private Endpoints, network access is granted to specific resources behind a given service providing granular segmentation, also traffic can reach the service resource from on premises without using public endpoints. A service endpoint remains a publicly routable IP address. A private endpoint is a private IP in the address space of the virtual network where the private endpoint is configured."
- Steps to enable Private Endpoint
- Steps to enable VNET Service Endpoint connectivity
- In the Azure portal, when the Deny Public Network Access setting is set to Yes, only connections via private endpoints are allowed. When this setting is set to No, clients can connect using the private or public (vnet service) endpoint.
- Authentication
- SQL Authentication vs AAD Authentication
- Single DB supports DB level AAD Users
- An Azure AD administrator must be configured if you want to use Azure AD accounts to connect to SQL Database, SQL Managed Instance, or Azure Synapse
- Only the administrator based on an Azure AD account can create the first Azure AD contained database user in a user database
- Azure AD server level principals (logins) and users are supported for SQL Managed Instance.
- Authorization
- Auditing for Azure SQL Database and Azure Synapse Analytics
- Azure SQL Managed Instance auditing
- Azure Metrics. You can pin metrics to an Azure Dashboard.
- Stream Diagnostic Logs to Log Analytics for centralized longer term monitoring
- SQL Log Analytics/Intelligent Insights
- SQL Analytics Solution. If you configure Intelligent Insights log data to be streamed to Azure SQL Analytics workspace, Azure can use built-in intelligence to detect and provide detailed analysis of disruptive events that cause poor performance.
- SQL Log Analytics/Intelligent Insights
- Query Performance Insights provides intelligent query analysis for single and pooled databases.
- Query Store can be accessed through SSMS + Azure Portal provides intelligent query analysis. This is used by the Query Performance Insights feature.
- Extended Events + DMVs for advanced troubleshooting and monitoring.
- Can scale tier manually or programmatically
- Within an elastic pool, individual databases are given the flexibility to auto-scale within set parameters
- Query Tuning Guidance
- Consider using columnstore indexes for your larger analytics tables, non-clustered columnstore indexes are available for HTAP tables.
- Automatic tuning
- Database Advisor Performance Recommendations
- Update Statistics/Defragment/Re-index
- Update Statistics
- Rebuild Indexes
- Database Compatibility Level 15
- Memory Grant Feedback - SQL 2019 new feature applied to Azure SQL DB
- SQL Server 2019 includes built-in query processing capabilities called Intelligent Query Processing. By updating your database compatibility level to 150 (the default level for SQL Server 2019), the query processor in the SQL Server engine can enhance performance through capabilities like batch-mode on row store, scalar UDF inlining,or table variable deferred compilation.
- It can automatically correct memory-related query execution issues through memory grant feedback.
- You can configure an Azure SQL Database as the push subscriber in a one-way transactional or snapshot replication replication topology. The SQL Server acting as publisher and/or distributor can be an instance of SQL Server running on-premises, an Azure SQL Managed Instance, or an instance of SQL Server running on an Azure virtual machine in the cloud.
- SQL Data Sync is a service built on Azure SQL Database that lets you synchronize the data you select bi-directionally across multiple databases, both on-premises and in the cloud.
-
Scale out databases in Azure SQL Database using the Elastic Database tools. Sharding is a technique to distribute large amounts of identically structured data across a number of independent databases. It is especially popular with cloud developers creating Software as a Service (SAAS) multi-tenant offerings for end customers or businesses. Sharding works best when every transaction in an application can be restricted to a single value of a sharding key. That ensures that all transactions are local to a specific database.
-
Partitioned Indexed Views can also be created on a partitioned table, and can themselves be partitioned.
-
A filtered index is an optimized nonclustered index especially suited to cover queries that select from a well-defined subset of data. It uses a filter predicate to index a portion of rows in the table. A well-designed filtered index can improve query performance as well as reduce index maintenance and storage costs compared with full-table indexes.
-
Partitioned Tables and Indexes
- Identify which indexes to partition. - Indexes are put in place to optimize queries. So, first you’ll want to identify the top queries and the top indexes being used in your environment.
- Partition indexes which will (1) benefit from partition elimination to help improve query performance or (2) benefit from reduced impact from maintenance tasks (such as reindexing, statistics rebuild, and bulk loads) by moving to partition level operations instead.
- Performance Guidelines “If you frequently run queries that involve an equi-join between two or more partitioned tables, their partitioning columns should be the same as the columns on which the tables are joined”
- Be aware of limitations when using non-aligned partitioned indexes.
- Creating and rebuilding nonaligned indexes on a table with more than 1,000 partitions is possible, but is not supported. Doing so may cause degraded performance or excessive memory consumption during these operations. We recommend using only aligned indexes when the number of partitions exceed 1,000… column_name must be chosen from among those used as the unique key. This restriction allows the Database Engine to verify uniqueness of key values within a single partition only… You cannot change the compression setting of a single partition if the table has nonaligned indexes.
- Some operations such as switch will not be possible with non-aligned indexes. When a table and its indexes are in alignment, SQL Server can switch partitions quickly and efficiently while maintaining the partition structure of both the table and its indexes.
- To switch partitions, all nonclustered indexes must include the partition key
Partition Switch Operations Allowed? Per-Partition Operations Allowed? (Truncate/ Compression/ Reindex/ Reorg) Partition Aligned Y Y Non-Partition Aligned (clustered index/heap is partitioned + non-clustered indexes are not partitioned) Y, but must disable NC indexes Y, but must disable NC indexes Non-Partition Aligned (clustered index/heap is not partitioned + non-clustered indexes are partitioned) N N
see Azure SQL Database Managed Instance
- Time to resize compute is independent of the size of data
- Decouple storage, compute, transaction logs
- Use for VLDBs and when you need flexibility to scale compute/storage while maintaining many of the performance benefits of business critical (fast IOPS)
- Capabilities include Constant time operations (backups, restores, scale), support for VLDBs, ability to provision one or more read-only/hot-standby nodes, and improved performance due to higher log throughput and faster transaction commit times
- Distributed Architecture
- Migration to Hyperscale tier is currently one-way
- Connect to READ replica
- Automatically scales compute based on workload demand and bills for the amount of compute used per second.
- When to use
- Autoscaling performance/responsiveness
- Video: Serverless Architecture shows three tiers (1) control plan manages connectivity and management ops (2) Backend tier (Data Plane) with database compute (3) Storage tier where files reside