2.10 Azure Database Services
Key Takeaways
- Azure SQL Database is fully managed PaaS based on the latest stable SQL Server engine, with a 99.99% availability SLA and serverless auto-scaling.
- Azure SQL Managed Instance gives near-100% on-premises SQL Server compatibility (SQL Server Agent, cross-database queries, CLR) for lift-and-shift migrations.
- SQL Server on Azure VMs is the IaaS option when you need full OS and instance control.
- Azure Cosmos DB is globally distributed multi-model NoSQL with single-digit-millisecond latency, five consistency levels, and a 99.999% multi-region SLA.
- Azure Database for MySQL and PostgreSQL are managed open-source engines; MariaDB is retired, so migrate those workloads to MySQL.
Quick Answer: Azure SQL Database = fully managed SQL Server (PaaS) for new apps. SQL Managed Instance = near-100% SQL Server compatibility for migrations. SQL Server on Azure VMs = IaaS, full control. Cosmos DB = globally distributed multi-model NoSQL, single-digit-millisecond latency. Managed open-source: MySQL and PostgreSQL (MariaDB is retired). On the exam, the verbs "migrate existing," "globally distributed," and "build new" each point to a different service.
The Relational Options (the PaaS-to-IaaS ladder)
Azure SQL Database
Azure SQL Database is a fully managed platform-as-a-service (PaaS) relational engine built on the latest stable version of Microsoft SQL Server. Azure handles OS patching, engine updates, backups, monitoring, and high availability, and provides a 99.99% availability SLA. Notable capabilities:
- Serverless tier that auto-scales compute and auto-pauses when idle, billing per second — ideal for spiky or intermittent workloads.
- Elastic pools that share a budget of compute across many databases so unpredictable individual loads even out.
- Intelligent features: automatic tuning, threat detection, and vulnerability assessment.
Two purchasing models appear on the exam:
| Model | How you pay | Pick when |
|---|---|---|
| DTU (Database Transaction Unit) | Bundled compute + storage + I/O | You want simple, one-dial pricing |
| vCore | Choose vCores and storage separately | You need flexibility or Azure Hybrid Benefit |
A worked example: a startup ships a new web app whose traffic is light and bursty. Serverless SQL Database is the cost-smart pick because compute scales down and pauses during quiet hours, so you stop paying for idle compute — versus a fixed provisioned tier billing 24/7. If that same startup later runs 50 small per-tenant databases with unpredictable individual spikes, an elastic pool lets them share one compute budget instead of over-provisioning each database.
Azure SQL Managed Instance
SQL Managed Instance targets customers moving existing on-premises SQL Server databases to the cloud with near-100% compatibility. It is still PaaS (Azure patches and backs up), but it restores instance-level features that SQL Database lacks.
| Feature | SQL Database | SQL Managed Instance |
|---|---|---|
| Cross-database queries | Limited | Yes |
| SQL Server Agent (jobs) | No | Yes |
| CLR (Common Language Runtime) | No | Yes |
| Database Mail | No | Yes |
| Best for | New cloud-native apps | Lift-and-shift migrations |
SQL Server on Azure VMs
When an app needs full control of the operating system and the SQL Server instance (specific build, OS-level agents, third-party extensions), run SQL Server on an Azure Virtual Machine. This is infrastructure-as-a-service (IaaS): you own patching and configuration. The three options form a ladder — VM (most control, most work) -> Managed Instance -> SQL Database (least work).
Azure Cosmos DB (the NoSQL flagship)
Azure Cosmos DB is Microsoft's globally distributed, multi-model NoSQL service for mission-critical apps:
| Capability | Detail |
|---|---|
| Global distribution | Add or remove regions with a click; multi-region writes |
| Latency | Single-digit-millisecond reads and writes at the 99th percentile |
| Availability SLA | Up to 99.999% for multi-region accounts |
| Elastic throughput | Scales request units automatically or manually |
| Consistency | Five tunable levels |
Five Consistency Levels
From strongest to weakest: Strong, Bounded staleness, Session, Consistent prefix, Eventual. Strong always returns the latest committed write but adds latency because it confirms replication first; Eventual is fastest and cheapest but readers may briefly see stale data. This is the classic trade-off: stronger consistency costs latency and throughput.
Cosmos DB APIs
| API | Data model | Compatible with |
|---|---|---|
| NoSQL (native) | Document (JSON) | Cosmos DB native |
| MongoDB | Document (BSON) | MongoDB wire protocol |
| Cassandra | Wide-column | Apache Cassandra |
| Gremlin | Graph | Apache TinkerPop |
| Table | Key-value | Azure Table Storage |
On the Exam: The phrases "globally distributed," "multi-region writes," "single-digit-millisecond latency," "graph" (Gremlin), or "existing MongoDB app" all point to Cosmos DB.
Managed Open-Source Engines
| Service | Engine | Note |
|---|---|---|
| Azure Database for MySQL | MySQL | Flexible Server, zone-redundant HA |
| Azure Database for PostgreSQL | PostgreSQL | Flexible Server; Citus for sharded scale-out |
| Azure Database for MariaDB | MariaDB | Retired — migrate to MySQL |
All three are PaaS: Azure runs the host OS, patches the engine, takes automated backups, and offers built-in high availability, so your team only manages schemas and data. They are the right answer whenever a question names an existing open-source engine ("we run PostgreSQL on-premises and want it managed") rather than asking you to re-platform onto SQL Server or Cosmos DB.
Cost and Management Trade-off
A useful mental model for the relational ladder: as you move from IaaS toward PaaS you trade control for lower operational effort.
| Option | You manage | Azure manages |
|---|---|---|
| SQL Server on Azure VM (IaaS) | OS, patches, backups, instance | Hardware, virtualization |
| SQL Managed Instance (PaaS) | Database, security | OS, patching, backups, HA |
| SQL Database (PaaS) | Database, security | OS, patching, backups, HA, scaling |
Decision Guide
| Scenario | Service |
|---|---|
| New cloud-native relational app | Azure SQL Database |
| Migrate existing SQL Server, minimal change | SQL Managed Instance |
| Need full OS/instance control | SQL Server on Azure VMs |
| Globally distributed low-latency NoSQL | Cosmos DB |
| Existing MongoDB/Cassandra/graph app | Cosmos DB (matching API) |
| Open-source MySQL or PostgreSQL | Azure Database for MySQL/PostgreSQL |
An organization is migrating a decade-old on-premises SQL Server database that relies on SQL Server Agent jobs and cross-database queries, and wants minimal code changes. Which service fits best?
A retail app needs to serve a product catalog from regions worldwide with guaranteed single-digit-millisecond reads and the ability to write in multiple regions. Which service is the answer?
In Cosmos DB, which consistency level always returns the most recent committed write but adds the most latency?
A team wants a fully managed relational database for a brand-new app, prefers not to patch any OS or SQL engine, and wants compute to pause automatically when idle. Which option fits?