Skip to content

Chapter 4 of 11

Databases: Azure SQL and Cosmos DB

Select managed relational or globally distributed NoSQL databases from workload requirements.

44 minutes 10 quick checksBy Subha Prasad
Lesson 4 of 11Course navigation

Lesson content

Read, practise, then check your understanding

Databases: Azure SQL and Cosmos DB

Azure SQL Database offers a managed SQL Server-compatible relational platform with backups, scaling, availability, and security features. Azure Cosmos DB provides globally distributed NoSQL APIs with tunable consistency and throughput measured through request units.

Core ideas

  • An Azure SQL logical server is an administrative and connection boundary, not a customer-managed database host.
  • Service tiers and compute models balance latency, scaling, availability, and cost.
  • Cosmos DB partitions data by a partition key; a poor key can create hot partitions.
  • Cosmos DB consistency choices trade freshness guarantees, availability behavior, and latency.

Design and operating model

Start with relationships, transaction boundaries, query patterns, latency, geography, expected scale, and recovery objectives. Use Azure SQL for relational integrity and SQL workloads. Use Cosmos DB when its data model, APIs, global distribution, and scale characteristics fit. Test with representative data and queries.

Example

az sql db create \
  --resource-group learning-rg \
  --server replace-with-sql-server \
  --name learningdb \
  --edition GeneralPurpose \
  --family Gen5 \
  --capacity 2

az cosmosdb show \
  --resource-group learning-rg \
  --name replace-with-cosmos-account

Run examples in a disposable training subscription. Replace names, Regions, identifiers, scopes, sizes, and policies with reviewed values, and confirm current Azure CLI and service requirements before production use.

Production guidance

  • Use Microsoft Entra authentication, private networking, auditing, encryption, and least privilege.
  • Enable and rehearse point-in-time recovery or geo-restore based on business objectives.
  • For Cosmos DB, estimate request units from real operations and monitor throttling and partition distribution.

The chapter quiz follows the lesson and checks both service vocabulary and architecture decisions.

Knowledge check

Answer every question correctly to complete this chapter.

Which statement correctly describes Azure SQL Database?
Which term matches this explanation: A fully managed relational database platform based on SQL Server.
Which statement correctly describes logical SQL server?
Which term matches this explanation: An administrative endpoint and security boundary for Azure SQL databases.
Which statement correctly describes Azure Cosmos DB?
Which term matches this explanation: A globally distributed NoSQL database service supporting multiple APIs.
Which statement correctly describes request unit?
Which term matches this explanation: A normalized measure of Cosmos DB operation cost and provisioned throughput.
Which statement correctly describes geo-replication?
Which term matches this explanation: Maintaining database replicas across regions for availability or read locality.

0 of 10 checks passed

Your progress is saved on this device.