Azure SQL Type Database Flashcards
What are the types of Azure SQL Databases (MS)
SQL on a Virtual Machine
Azure SQL Managed Instance
– General purpose
– Buisness critical
Azure SQL Database
– General purpose
– Buisness critical
– Elastic pool
Azure SQL Database (hyperscale)
– General purpose
– Buisness critical
– Elastic pool
When should I use Azure SQL Managed Instance?
Most compatible, suitable for lift and shift.
Azure SQL Managed Instance is an ideal choice when you need a fully managed SQL Server instance in the cloud that supports the following scenarios:
Easy Lift-and-Shift for On-Premises SQL Server Workloads: SQL Managed Instance offers near-full compatibility with on-premises SQL Server, making it an excellent option for migrating existing SQL Server workloads with minimal application or database refactoring.
Extended SQL Server Features: SQL Managed Instance includes features not available in Azure SQL Database, such as SQL Agent, cross-database queries, and Service Broker, which are useful for applications with dependencies on these features.
High Availability and Built-In Disaster Recovery: SQL Managed Instance supports built-in high availability and offers options for automated backups, point-in-time restore, and geo-redundancy, making it well-suited for applications with strict recovery time objectives (RTO) and recovery point objectives (RPO).
Network Isolation and Enhanced Security: If you need to isolate your database within a private network and integrate it with on-premises resources, Managed Instance can be deployed within a virtual network (VNet), enabling private IP access and additional security configurations.
Compliance with Enterprise Requirements: Managed Instance supports compliance requirements for businesses needing features like Azure Active Directory (Entra ID) authentication, Transparent Data Encryption (TDE), and Advanced Threat Protection (ATP).
Scaling for Enterprise Workloads: Managed Instance provides scaling options in terms of both compute and storage, which is beneficial for enterprise applications with demanding performance and storage requirements.
Hybrid Cloud and Application Modernization: If you’re looking to modernize a portion of an on-premises SQL Server setup while keeping certain components in the cloud, Managed Instance allows for seamless integration and hybrid setups with features like Linked Servers and cross-premises connectivity.
When should I use Azure SQL Database elastic pools?
Best fit for modern cloud applications where you can change the application code to account for not having full SQL server capabilities.
Also when having several databases thet wnat to spread the available resources across the databases because several databases are not all taking resources at once.
Azure SQL Database elastic pools are a great choice when you have multiple databases that:
Have variable and unpredictable usage patterns: If your databases have varying or unpredictable demand, elastic pools allow you to balance the performance cost across multiple databases, making it cost-effective.
Need resource sharing and cost savings: Elastic pools let multiple databases share a set of resources (DTUs or vCores) at a fixed price. This can be more economical than provisioning resources for each database individually, especially if some databases have low or intermittent usage.
Have databases with a single-tenant or multi-tenant SaaS model: In multi-tenant SaaS scenarios, where each tenant might have its database, elastic pools allow for predictable costs while supporting varying tenant usage.
Require scaling for numerous databases: Elastic pools allow you to manage and scale a group of databases easily without scaling each database individually. This can simplify operations if you have multiple databases with similar performance needs.
Operate under a fixed budget: By placing multiple databases into an elastic pool, you can control costs while providing enough resources to handle varying workload demands across the databases.
When is it best to use Azure SQL Virtual Machines?
Best fit when you need operating system level access and the most compatability.
Who is responsible for patching the operating system when using Azure SQL on virtual machines?
You are responsible for patching.
When using Azure SQL on virtual machines (SQL Server on Azure VMs), the customer is responsible for patching the operating system. Azure provides platform-managed services to assist with SQL Server updates and maintenance, but the underlying VM and OS are managed by the customer, including OS patches and updates.
In contrast, Azure SQL Database (a fully managed PaaS offering) handles both OS and database patching as part of the service, reducing the customer’s maintenance burden.
Who is responsible for patching when using Azure SQL Database?
When using Azure SQL Database, Microsoft is responsible for patching the operating system, database engine, and all underlying infrastructure. This is part of the fully managed platform-as-a-service (PaaS) model, which includes regular updates, patches, and backups to ensure availability, security, and compliance.
When using Azure SQL on virtual machines, what VM type should you be considering?
Consider a memory-optimized virtual machine.
Storage-optimized virtual machine.
How can you quickly back up the VM running your SQL on a virtual machine?
To quickly back up a VM running SQL Server on a virtual machine in Azure, you can follow these steps:
- Use Azure Backup for VM-level Backup
Azure Backup can perform a backup of the entire VM, including the OS and data disks. This backup is typically file-system consistent (not application-consistent) by default, meaning it’s not aware of the SQL Server state.
Steps to back up a VM with Azure Backup:
Go to the Azure portal.
Navigate to Backup Center or search for Backup.
Create a Recovery Services Vault if you don’t have one.
In the vault, select Backup and then choose Azure Virtual Machine as the backup item.
Select the VM running SQL Server and configure the backup schedule.
Run an immediate backup or let the backup run on the schedule you’ve set.
Important Note: This backup will capture the VM at the disk level but is not SQL Server-aware (it’s file-system consistent).
- Use SQL Server Backup for Application-Consistent Backup
If you need application-consistent backups, you should also back up the SQL Server databases while the VM is running. This ensures that the SQL Server database files (including transaction logs) are in a consistent state and recoverable.
Use SQL Server Management Studio (SSMS) or Transact-SQL (T-SQL) commands to back up the databases. You can back up the database files using BACKUP DATABASE and include transaction logs (BACKUP LOG).
You can schedule these backups or trigger them manually as needed.
Example:
BACKUP DATABASE [YourDatabase] TO DISK = N’C:\Backup\YourDatabase.bak’
WITH INIT;
BACKUP LOG [YourDatabase] TO DISK = N’C:\Backup\YourDatabase_log.trn’;
3. Use Azure Backup with SQL Server Integration (Application-Consistent Backup)
For more seamless integration, you can enable SQL Server-aware backups through Azure Backup. This provides an application-consistent backup that takes SQL Server into account (ensuring that transaction logs and open transactions are handled).
In Azure Backup, enable SQL Server protection in the Recovery Services Vault.
Select the VM running SQL Server and configure SQL Server backup options.
Azure Backup will back up the SQL Server databases in an application-consistent manner, ensuring that the SQL Server transaction logs and database states are consistent.
4. Use VM Snapshot for Quick Backups (Not SQL Consistent)
A snapshot of the VM disk is another option for a quick backup, but keep in mind that snapshots are not application-consistent. It’s a quick way to back up the VM, but to ensure SQL Server data consistency, you need to ensure that SQL Server has flushed transaction logs before taking the snapshot.
To take a snapshot:
In the Azure portal, navigate to your VM.
Go to the Disks section and select the disk you want to back up.
Click on Create snapshot.
Configure the snapshot and create it.
This is a quick method, but again, it’s not suitable for SQL Server database consistency unless done in conjunction with SQL Server-aware backup methods.
Key Points:
Azure Backup provides a simple method for VM-level backup but is not application-consistent by default for SQL Server.
SQL Server native backups (via SSMS or T-SQL) provide application-consistent backups for SQL databases.
You can combine SQL Server backup with Azure Backup for an application-consistent VM backup.
For mission-critical SQL Server applications, it’s important to ensure the backup is both file-system consistent and SQL Server application-consistent, typically achieved through SQL Server-aware backups.
What is Azure SQL Database latency when data stays in the same region as going to a secondary?
All data passing over the network in a region is less than 2ms.
Explain how availability is achieved for the general-purpose tier for Azure SQL Database and Azure SQL Instance?
Data from the primary is stored in Azure Blob Storage, and there are three replicas; if the primary node compute fails, there are spare nodes kept available in the regional and one will be selected and pointed to the storage and booted to replace the failed primary
Explain how availability is achieved for the business-critical tier for Azure SQL Database and Azure SQL Instance.
The business-critical data is stored on the node’s local disk, with several secondary nodes; data is sync replication and acknowledged from at least one node. This is called SQL always on
Where is data stored when using the business-critical tier for Azure SQL Database and Azure SQL Instance?
Node local storage
Where is data stored when using the general-purpose tier for Azure SQL Database and Azure SQL Instance?
Azure Blog Storage
Explain always-on the context of Azure SQL Database and Azure SQL Instance?
In always-on, data is replicated between primary and secondary replicas; data can be synced or async.
What the the tiers available in Azure SQL?
General-purpose
Buisness-critical
Hyperscale
When would I use the General-Purpose Tier?
- Most general-purpose workloads
- moderate performance needs.
- Budget-friendly: Provides cost-effective options.
- Storage: Uses Azure Premium SSD for storage, with up to 8 TB of database size.
- Availability: Provides high availability using the Always On availability groups with automated backups and replication.
- Sutable for: Applications with standard OLTP workloads.
- Sutable for: Moderate transaction rates and throughput.
- Sutable for: Applications that need balanced performance at a lower cost.
How is High-Availability achieved for the General-Purpose Tier for Azure SQL Database?
Availability: Provides high availability using the Always On availability groups with automated backups and replication.
What workload is suitable for the General-Purpose Tier for Azure SQL Database?
- Most general-purpose workloads
- Moderate performance needs.
- Budget-friendly: Provides cost-effective options.
What workload is suitable for the General-Purpose Tier for Azure SQL Instance?
- Most general-purpose workloads
- Moderate performance needs.
- Budget-friendly: Provides cost-effective options.
What workload is suitable for the General-Purpose Tier for Azure SQL Instance?
- Applications with standard OLTP workloads.
- Moderate transaction rates and throughput.
- Applications that need balanced performance at a lower
What workload is suitable for the General-Purpose Tier for Azure SQL Database?
- Applications with standard OLTP workloads.
- Moderate transaction rates and throughput.
- Applications that need balanced performance at a lower
What are the purchasing models available for both Azure SQL Database and Instance?
- vCore
- DTU
For the purchasing model for both Azure SQL Database and Instance, what is the MS recommended model?
We recommend the vCore-based model because it allows you to independently select compute and storage resources. The DTU-based model is a bundled compute, storage, and I/O resource measure.
What SSD types are used with the General-Purpose Tier for Azure SQL Database?
Azure Premium SSD for storage (Blob Storage)