Azure Fundamentals

Lesson 5 of 6

Azure Databases: Azure SQL and Cosmos DB

Rather than running your own database server on a VM, Azure offers fully-managed database services, Azure handles patching, backups, and failover for you.

Azure SQL Database

A managed, relational SQL Server database, a good fit if your data has a stable, well-defined schema.

az sql server create --name kodstigen-sql --resource-group kodstigen-rg --admin-user sqladmin --admin-password "P@ssword123!"

az sql db create --name kodstigen-db --server kodstigen-sql --resource-group kodstigen-rg --service-objective S0

Azure Cosmos DB

A globally distributed, multi-model NoSQL database, if the flexible, document-style data you worked with in MongoDB sounded appealing, Cosmos DB even offers an API that speaks MongoDB's wire protocol.

az cosmosdb create --name kodstigen-cosmos --resource-group kodstigen-rg --kind GlobalDocumentDB

Which one?

Azure SQL DatabaseCosmos DB
Data shapeRows and columnsFlexible documents
Best forStructured, relational dataHigh-scale, globally distributed apps
Query languageT-SQLSQL-like, or MongoDB/Cassandra/Gremlin APIs

NOTE

Both services are billed based on the capacity/tier you provision, always check the pricing tier before creating one, it's easy to leave an expensive tier running by accident.

📝 Azure Databases Quiz

Passing score: 70%
  1. 1.Which managed Azure database is the best fit for structured, relational data queried with T-SQL?

  2. 2.Azure ____ DB is a globally distributed, multi-model NoSQL database that can even speak the MongoDB wire protocol.

  3. 3.Using a managed database service means Azure handles patching and backups for you.