Azure Database Services
How Azure is organized, the database services it offers, from Azure SQL and Flexible Server to Cosmos DB, and how to choose between them.
Databases on Azure
Microsoft Azure offers a managed service for almost every popular database: SQL Server, PostgreSQL, MySQL, Oracle, and NoSQL databases. An Azure DBA's first job is knowing what's on the menu, so each application gets the right service.
Most of these services share the same building blocks: they live in the same Azure hierarchy, use the same identity and networking, and are monitored and billed the same way. Learn those once, and they apply to every database service.
How Azure is organized
Before creating anything, it helps to know where things live in Azure. Every resource sits inside a simple hierarchy:
- Tenant
- Your organization's identity in Microsoft's cloud, managed in Microsoft Entra ID (formerly Azure Active Directory). Users and groups live here.
- Subscription
- A billing and access boundary. Companies often use separate subscriptions for production and non-production, or for different departments.
- Resource group
- A folder for related resources, such as everything belonging to one application. Permissions, policies, and cost reports can all be applied at this level, and deleting a resource group deletes everything in it.
- Region
- Where resources physically run, such as East US or West Europe. Many regions have three or more availability zones: separate data centers that protect against one failing.
- Logical SQL server
- For Azure SQL Database, a management container for a group of databases: it holds their administrator login, firewall rules, and connection name (such as
kofi-sql-01.database.windows.net). Despite the name, it isn't a machine you can log in to.
Azure's database services
Azure's database services fall into two groups, plus the option of running any database yourself on a virtual machine:
Relational services
- Azure SQL
- A family of three options for Microsoft SQL Server: the fully managed Azure SQL Database, Azure SQL Managed Instance for moving existing SQL Server instances, and SQL Server on Azure Virtual Machines for full control. The next lesson covers them in depth.
- Azure Database for PostgreSQL
- Managed open source PostgreSQL, run as a Flexible Server. Microsoft handles patching, backups, and high availability, and it supports popular PostgreSQL extensions, such as PostGIS for maps and pgvector for AI.
- Azure Database for MySQL
- Managed open source MySQL, also run as a Flexible Server, and widely used for websites and web applications.
- Oracle Database@Azure
- Oracle's own database services, such as Exadata and Autonomous Database, running on Oracle hardware inside Azure data centers. Oracle manages the databases, while they connect directly to Azure networks and applications. It's the Azure option for companies that need Oracle, and links to the OCI module later in this path.
Non-relational services
- Azure Cosmos DB
- A globally distributed NoSQL database, built for applications that need fast responses anywhere in the world and very high availability: up to 99.999% when spread across several regions. It speaks several APIs, so teams can use it like a document database (its native NoSQL API, or the MongoDB API), a wide-column database (Apache Cassandra), a graph (Apache Gremlin), or a key-value table. Capacity is measured in request units (RU/s), and can be provisioned, autoscaled, or serverless.
- Azure Managed Redis
- A managed version of Redis, the in-memory key-value store, used mainly as a cache: a very fast copy of frequently read data that takes load off the main database. It's the successor to Azure Cache for Redis.
For analytics, Azure also offers data warehouse and lakehouse platforms, such as Microsoft Fabric, Azure Synapse Analytics, and Azure Databricks, as covered in the Database Systems lesson.
Self-managed on virtual machines
Any database that runs on Linux or Windows can run on an Azure virtual machine: SQL Server, Oracle, PostgreSQL, MySQL, or anything else. It's IaaS: you get full control, and full responsibility for installing, patching, backups, and high availability. It's the right choice when a managed service doesn't support a version, feature, or configuration you need.
Comparing the managed services
| Service | Engine | Data model | Typical use |
|---|---|---|---|
| Azure SQL Database | SQL Server | Relational | New cloud applications on the Microsoft stack |
| Azure SQL Managed Instance | SQL Server | Relational | Moving existing SQL Server instances to the cloud |
| Azure Database for PostgreSQL | PostgreSQL | Relational | Open source applications, geospatial and AI workloads |
| Azure Database for MySQL | MySQL | Relational | Websites, content management systems, and web apps |
| Oracle Database@Azure | Oracle | Relational | Oracle workloads that need to run close to Azure applications |
| Azure Cosmos DB | Cosmos DB (several APIs) | NoSQL: document, key-value, wide-column, graph | Global apps that need low latency and flexible data |
| Azure Managed Redis | Redis | In-memory key-value | Caching, user sessions, leaderboards |
Choosing a service
The application usually decides the engine, and the engine points to the service:
When an application could use any relational engine, the choice often comes down to the team's skills, licensing costs (PostgreSQL and MySQL have none), and the features it needs. Many applications combine services, such as Azure SQL Database for orders with Azure Managed Redis as a cache in front of it.
What every service has in common
Whichever service you pick, most of the DBA's work looks the same:
- Created and organized the same way, in subscriptions and resource groups, through the portal, the Azure CLI, or infrastructure as code such as Bicep and Terraform.
- Sized by compute tier. Most services offer a small, cheap tier for development and light use, a general purpose tier, and a high-performance tier for the most demanding workloads.
- Backed up automatically, with point-in-time restore for up to 35 days on the relational services.
- Highly available with built-in replicas, with an option to spread them across availability zones.
- Secured with the same tools: Microsoft Entra ID sign-in, private networking, and encryption at rest by default.
- Monitored and billed the same way, with Azure Monitor and Microsoft Cost Management.
The Managing Databases on Azure lesson covers these responsibilities across the services.
In practice: placing five applications
Kofi's company is moving to Azure. The applications decide the services:
| Application | What it needs | Service |
|---|---|---|
| HR system, from a vendor | SQL Server, with SQL Server Agent jobs and queries across databases | Azure SQL Managed Instance |
| New customer web app | PostgreSQL, with the PostGIS extension for store locations | Azure Database for PostgreSQL |
| Marketing website | MySQL, for its content management system | Azure Database for MySQL |
| Finance ERP | Oracle Enterprise Edition with RAC | Oracle Database@Azure |
| Mobile app profiles and carts | Fast reads and writes for users worldwide | Azure Cosmos DB, with Azure Managed Redis caching product pages |
Five applications, five services, one set of Azure skills: the same subscriptions, networking, identity, monitoring, and cost tools apply to all of them.
Key takeaways
- Azure resources live in a hierarchy: tenant, subscription, resource group, then resources such as databases.
- Relational services include the Azure SQL family, Azure Database for PostgreSQL and MySQL (Flexible Server), and Oracle Database@Azure.
- Non-relational services include Azure Cosmos DB, a global NoSQL database with several APIs, and Azure Managed Redis for caching.
- Any engine can also run on Azure virtual machines, with full control and full responsibility.
- The application's engine usually decides the service. Start with the most managed option that fits.
- Hierarchy, sizing, backups, high availability, security, monitoring, and billing work much the same across services.