2.10 Azure Database Services
Key Takeaways
- Azure SQL Database is a fully managed PaaS relational database based on the latest stable version of Microsoft SQL Server.
- Azure SQL Managed Instance provides near-100% compatibility with on-premises SQL Server for easier migration.
- Azure Cosmos DB is a globally distributed, multi-model NoSQL database with single-digit millisecond response times.
- Azure Database for MySQL, PostgreSQL, and MariaDB provide fully managed open-source database engines.
- Choose SQL Database for new cloud-native apps, SQL Managed Instance for migration, and Cosmos DB for global, low-latency NoSQL workloads.
Azure Database Services
Quick Answer: Azure SQL Database = managed SQL Server (PaaS). Azure SQL Managed Instance = near-100% SQL Server compatibility for migration. Azure Cosmos DB = globally distributed NoSQL with single-digit millisecond latency. Azure also offers managed MySQL, PostgreSQL, and MariaDB.
Azure SQL Database
Azure SQL Database is a fully managed relational database engine based on the latest stable version of Microsoft SQL Server. Azure handles patching, backups, monitoring, and high availability.
Key features:
- Fully managed PaaS — No OS or SQL Server patching required
- Built-in HA — 99.99% availability SLA
- Auto-scaling — Serverless tier automatically scales compute based on demand
- Intelligent performance — Automatic tuning, threat detection, and vulnerability assessment
- Elastic pools — Share resources across multiple databases for cost optimization
Purchasing models:
| Model | Description |
|---|---|
| DTU (Database Transaction Unit) | Bundled measure of compute, storage, and I/O. Simple pricing. |
| vCore | Choose compute (vCores) and storage independently. More flexible. |
| Serverless | Auto-scales compute and bills per second of use. Auto-pauses when idle. |
Azure SQL Managed Instance
SQL Managed Instance is designed for customers migrating on-premises SQL Server workloads to Azure with near-100% compatibility with the on-premises SQL Server engine.
Differences from SQL Database:
| Feature | SQL Database | SQL Managed Instance |
|---|---|---|
| SQL Server compatibility | High (most features) | Near-100% |
| Cross-database queries | Limited | Yes |
| SQL Server Agent | Not available | Available |
| CLR support | Not available | Available |
| Database mail | Not available | Available |
| Best for | New cloud-native apps | Migrating existing SQL Server workloads |
SQL Server on Azure VMs
For workloads that require full SQL Server control, you can run SQL Server on Azure Virtual Machines. This is an IaaS option where you manage the SQL Server instance, patching, and configuration.
Azure Cosmos DB
Azure Cosmos DB is Microsoft's globally distributed, multi-model NoSQL database service designed for mission-critical applications.
Key features:
| Feature | Description |
|---|---|
| Global distribution | Replicate data to any number of Azure regions with one click |
| Multi-model | Supports multiple data models and APIs |
| Single-digit millisecond latency | Guaranteed low latency reads and writes at the 99th percentile |
| Automatic scaling | Throughput scales automatically based on demand |
| Five consistency levels | From Strong to Eventual consistency |
| 99.999% availability | Five-nines SLA for multi-region deployments |
Supported APIs:
| API | Data Model | Compatibility |
|---|---|---|
| NoSQL (native) | Document (JSON) | Azure Cosmos DB native |
| MongoDB | Document (BSON) | MongoDB wire protocol compatible |
| Cassandra | Wide-column | Apache Cassandra compatible |
| Gremlin | Graph | Apache TinkerPop compatible |
| Table | Key-value | Azure Table Storage compatible |
| PostgreSQL | Relational | PostgreSQL compatible |
On the Exam: Cosmos DB questions often test its GLOBAL distribution and multi-model capabilities. Remember: Cosmos DB is the answer when a question mentions "globally distributed," "multi-region writes," "single-digit millisecond latency," or "NoSQL."
Azure Database for Open-Source Engines
Azure provides fully managed versions of popular open-source database engines:
| Service | Engine | Key Feature |
|---|---|---|
| Azure Database for MySQL | MySQL | Flexible Server with zone-redundant HA |
| Azure Database for PostgreSQL | PostgreSQL | Flexible Server with Citus for distributed tables |
| Azure Database for MariaDB | MariaDB | Community MariaDB engine (retiring — migrate to MySQL) |
These are all PaaS offerings where Azure manages the underlying infrastructure, patching, backups, and high availability.
Database Service Decision Guide
| Scenario | Recommended Service |
|---|---|
| New cloud-native SQL application | Azure SQL Database |
| Migrating existing SQL Server with minimal changes | Azure SQL Managed Instance |
| Full SQL Server control and customization | SQL Server on Azure VMs |
| Globally distributed, low-latency NoSQL | Azure Cosmos DB |
| Existing MongoDB application | Azure Cosmos DB (MongoDB API) |
| Open-source MySQL or PostgreSQL workload | Azure Database for MySQL/PostgreSQL |
| Graph database for relationship modeling | Azure Cosmos DB (Gremlin API) |
Which Azure database service provides globally distributed, multi-model NoSQL with single-digit millisecond latency?
A company wants to migrate their existing on-premises SQL Server to Azure with near-100% compatibility. Which service should they use?
Which Cosmos DB consistency level provides the strongest guarantees but the highest latency?
Which Azure database service supports multiple APIs including MongoDB, Cassandra, and Gremlin?