Lesson 2 of 4 · Azure Database Administration

The Azure SQL Family

The three ways to run SQL Server workloads on Azure, the purchasing models and service tiers, and how to choose the right option.

Beginner 7 sections 6 min read

The Azure SQL family

Azure SQL is the family of Azure services for Microsoft SQL Server, and it offers three main ways to run SQL Server workloads. They range from a fully managed database, where Microsoft handles almost everything, to a virtual machine, where you control everything. Choosing the right one is the first decision an Azure DBA makes.

All three run Microsoft's SQL Server engine, so they speak the same dialect, T-SQL, and use the same core skills. What changes is how much of the work is yours.

The three deployment models

The three options split the work between you and Microsoft in different ways:

SQL Server onAzure VMs Azure SQLManaged Instance Azure SQLDatabase IAASPAASPAAS Your databases and queries Security settings High availability setup Backups SQL Server patching Operating system Hardware YouYouYou YouYouYou YouYouYouYou Built inBuilt in MicrosoftMicrosoft MicrosoftMicrosoft MicrosoftMicrosoft MicrosoftMicrosoftMicrosoft
With the two PaaS options, you still choose the settings, such as backup retention and whether to add zone or region redundancy.
Azure SQL Database (PaaS)
A fully managed database. Microsoft handles patching, upgrades, backups, and high availability, with an uptime commitment of 99.99%, or up to 99.995% for zone-redundant databases in the Business Critical tier. It offers serverless compute that scales automatically and can pause when idle, and the Hyperscale tier for very large databases that need to scale quickly. Each database stands on its own, so some instance-level SQL Server features, such as SQL Server Agent jobs and cross-database queries, aren't available.
Azure SQL Managed Instance (PaaS)
A managed SQL Server instance, built for moving existing on-premises SQL Server databases to the cloud with few changes, often called lift and shift. It has near-100% compatibility with SQL Server, including SQL Server Agent, cross-database queries, and Database Mail, and it runs inside your own virtual network (VNet) for network isolation.
SQL Server on Azure Virtual Machines (IaaS)
Full SQL Server installed on a Windows or Linux virtual machine. You get complete control of the operating system and SQL Server, including features and versions the PaaS options don't support. In return, you're responsible for patching, backups, and high availability and disaster recovery, although the SQL IaaS Agent extension can automate some of this work.
Azure SQL DatabaseAzure SQL Managed InstanceSQL Server on Azure VMs
Service modelPaaSPaaSIaaS
What you manageA databaseAn instance with many databasesThe whole server
SQL Server compatibilityHigh, but database-scopedNear 100%100%
Operating system accessNoNoYes
Patching and backupsAutomaticAutomaticYour job, with optional automation
High availabilityBuilt inBuilt inYou configure it, for example with Always On availability groups
Best forNew cloud applications and modern appsMoving existing SQL Server instancesApps that need full control or unsupported features

Purchasing models and service tiers

For Azure SQL Database, you choose how to buy capacity:

DTU-based model
A simple bundle of CPU, memory, and I/O, measured in database transaction units (DTUs), sold in the Basic, Standard, and Premium tiers. Easy to start with, but you can't tune CPU and storage separately.
vCore-based model
You choose the number of virtual cores (vCores), with memory and storage sized separately. It's more flexible, maps easily to on-premises servers, and supports cost savings such as reserved capacity and the Azure Hybrid Benefit, which lets you reuse SQL Server licenses you already own. Microsoft recommends vCore for most new workloads, and it's the only model for Managed Instance.

The vCore model has three service tiers:

TierDesigned forGood to know
General PurposeMost business workloadsBalanced price and performance, with data on remote storage. Supports serverless compute.
Business CriticalWorkloads that need the fastest storage and the most resilienceLocal SSD storage, several replicas kept in sync, and a free readable secondary for reports.
HyperscaleVery large databases, and workloads that grow quicklyStorage grows automatically to many terabytes, compute scales quickly, and backups are near-instant. Azure SQL Database only.

Within a tier, compute can be provisioned, a fixed size billed by the hour, or serverless, which scales automatically and bills per second of use. For many small databases with unpredictable loads, an elastic pool lets them share one set of resources instead of each paying for its own peak.

Choosing the right option

Need OS access, or features PaaS doesn't support? SQL Server onAzure VMs YES NO Moving a SQL Server that uses instance features? Azure SQLManaged Instance YES NO Azure SQL Database
Instance features include SQL Server Agent jobs, cross-database queries, Database Mail, and linked servers.

Microsoft generally recommends starting from the most managed option that meets your needs, Azure SQL Database, and moving down the list only when something requires it. The more Microsoft manages, the more of your time goes to design, performance, and security instead of routine maintenance.

Creating a database

You can create Azure SQL resources in the Azure portal, but DBAs usually script them, so every database is created the same way. With the Azure command-line interface (CLI), creating a logical server and a serverless database looks like this:

# a resource group in East US
$ az group create --name rg-sales --location eastus

# a logical server, with an administrator login
$ az sql server create --name kofi-sql-01 --resource-group rg-sales \
    --location eastus --admin-user sqladmin --admin-password "<strong-password>"

# a General Purpose, serverless database that pauses after an hour idle
$ az sql db create --name salesdb --server kofi-sql-01 --resource-group rg-sales \
    --edition GeneralPurpose --family Gen5 --capacity 2 \
    --compute-model Serverless --auto-pause-delay 60

In practice, these commands usually become infrastructure as code, such as a Bicep or Terraform template, kept in Git and reviewed like any other change.

In practice: migrating a SQL Server estate

Kofi's company has 40 on-premises SQL Server databases to move to Azure. An assessment with Azure Migrate shows which features each one uses, and they fall into three groups:

DatabasesWhat they useDestination
28 small application databasesNothing outside the database itselfAzure SQL Database, most in elastic pools to share capacity
9 databasesSQL Server Agent jobs, queries across databases, and Database MailAzure SQL Managed Instance, which supports all three
3 databases for a vendor productAn old SQL Server version the vendor requires, and an agent installed on the serverSQL Server on Azure Virtual Machines

Most of the estate lands on the most managed option. Only the databases with a real reason, a feature or a vendor requirement, go further down the list, which is exactly the "start from the most managed" rule in action.

Key takeaways

  • Azure SQL is a family of three options for SQL Server, all using the same engine and T-SQL.
  • Azure SQL Database is fully managed and database-scoped; Managed Instance is a managed SQL Server instance for lift and shift; SQL Server on Azure VMs gives full control and full responsibility.
  • The vCore model, with General Purpose, Business Critical, and Hyperscale tiers, is the usual choice; DTUs are a simpler bundle.
  • Compute can be provisioned or serverless, and elastic pools let many small databases share resources.
  • Start with the most managed option that meets your needs, and script your deployments.