Skip to content

You are viewing a free preview of this lesson.

Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.

Database Options on Azure

Database Options on Azure

Microsoft Azure provides a comprehensive portfolio of managed database services, spanning relational, NoSQL, in-memory, and graph workloads. Understanding which service to choose — and when — is essential for building cost-effective, scalable, and resilient data architectures in the cloud.


Why Managed Databases?

Before cloud, organisations purchased servers, installed database software, configured replication, scheduled backups, and managed patches. This consumed significant time and budget. Azure's managed database services shift that operational burden to Microsoft:

Responsibility Self-Managed Azure Managed
Hardware provisioning You Azure
OS patching You Azure
Database engine patching You Azure
Backups You Azure (automated)
High availability You Azure (built-in)
Scaling You Azure (elastic)
Monitoring You (install agents) Azure Monitor (built-in)
Security patches You Azure

With managed services you focus on schema design, query optimisation, and application logic rather than infrastructure.


Azure Relational Database Services

Azure SQL Database

Azure SQL Database is a fully managed platform-as-a-service (PaaS) built on the Microsoft SQL Server engine. It is the most widely adopted Azure database service for new cloud-native applications.

  • Single Database — an isolated database with its own resources
  • Elastic Pool — multiple databases sharing a pool of compute and storage
  • Serverless — auto-pauses and auto-scales compute for intermittent workloads

Azure SQL Database supports T-SQL, stored procedures, views, triggers, and most SQL Server features. It provides automatic backups, point-in-time restore, and built-in high availability with a 99.99% SLA.

Azure SQL Managed Instance

SQL Managed Instance provides near-100% compatibility with the on-premises SQL Server engine. It is designed for lift-and-shift migrations that require features such as SQL Server Agent, cross-database queries, CLR integration, linked servers, and Service Broker.

Managed Instance deploys into a virtual network, giving you full control over network isolation — unlike Azure SQL Database, which uses firewall rules and private endpoints.

SQL Server on Azure VMs (IaaS)

For workloads that need full control over the SQL Server instance — such as specific OS-level configurations, third-party software, or legacy features — you can run SQL Server on Azure Virtual Machines. Microsoft provides pre-configured VM images with SQL Server pre-installed. You manage the OS and database engine, but Azure handles the underlying hardware.

Azure Database for PostgreSQL

A fully managed PostgreSQL service available in two deployment modes:

  • Flexible Server (recommended) — configurable compute, storage, and high availability with zone redundancy
  • Single Server (legacy, approaching retirement) — simpler model with fewer configuration options

Supports PostgreSQL extensions such as PostGIS, pg_stat_statements, and pgvector for AI workloads.

Azure Database for MySQL

A fully managed MySQL service, also available in Flexible Server and Single Server modes. It supports MySQL 5.7 and 8.0, read replicas, and automatic backups. Commonly used for web applications, content management systems, and e-commerce platforms.

Azure Database for MariaDB

A managed MariaDB service. Note that Microsoft has announced the retirement path for this service, recommending migration to Azure Database for MySQL Flexible Server.


Azure NoSQL and Multi-Model Services

Azure Cosmos DB

Azure Cosmos DB is a globally distributed, multi-model database designed for mission-critical applications requiring single-digit millisecond latency and 99.999% availability.

Cosmos DB supports multiple APIs:

API Data Model
NoSQL (native) JSON documents
MongoDB BSON documents
PostgreSQL (distributed) Relational (Citus-based)
Cassandra Wide-column
Gremlin Graph
Table Key-value

Throughput is measured in Request Units (RUs), and data is automatically partitioned and replicated across regions.

Azure Table Storage

A simple NoSQL key-value store within Azure Storage accounts. It stores semi-structured data using PartitionKey and RowKey pairs. Table Storage is inexpensive for large volumes of data that do not require complex queries. For more advanced NoSQL needs, Cosmos DB (Table API) is recommended.


In-Memory and Caching Services

Azure Cache for Redis

Azure Cache for Redis provides a fully managed Redis instance for caching, session management, real-time analytics, and message brokering. It supports Redis data structures (strings, hashes, lists, sets, sorted sets, streams) and features such as Redis clustering, geo-replication, and data persistence.

Tiers range from Basic (development) through Standard and Premium to Enterprise (Redis Enterprise with RediSearch, RedisJSON, and RedisTimeSeries modules).


Migration Services

Azure Database Migration Service (DMS)

DMS is a fully managed service for migrating databases to Azure with minimal downtime. It supports:

  • SQL Server to Azure SQL Database or Managed Instance
  • PostgreSQL to Azure Database for PostgreSQL
  • MySQL to Azure Database for MySQL
  • MongoDB to Azure Cosmos DB
  • Oracle to Azure Database for PostgreSQL

DMS supports both offline (one-time) and online (continuous sync) migration modes. Online migrations keep the source database operational during migration, cutting over when you are ready.


Choosing the Right Service

Requirement Recommended Service
Cloud-native relational app (SQL Server) Azure SQL Database
Lift-and-shift SQL Server migration Azure SQL Managed Instance
Full SQL Server control, specific OS needs SQL Server on Azure VMs
Open-source PostgreSQL Azure Database for PostgreSQL Flexible Server
Open-source MySQL Azure Database for MySQL Flexible Server
Globally distributed, low-latency NoSQL Azure Cosmos DB
Simple key-value storage Azure Table Storage
In-memory caching and sessions Azure Cache for Redis
Database migration to Azure Azure Database Migration Service

Decision Factors

When choosing a database service, consider:

  1. Data model — relational (tables, rows, joins) or NoSQL (documents, key-value, graph)
  2. Compatibility — do you need SQL Server features like CLR, Agent, or linked servers?
  3. Scale — single-region or global distribution?
  4. Latency — millisecond acceptable, or do you need sub-millisecond?
  5. Cost — serverless tiers for intermittent workloads vs provisioned for steady traffic
  6. Compliance — data residency, encryption, and regulatory requirements
  7. Migration path — are you migrating an existing database or building new?

Common Architecture Patterns

Polyglot Persistence

Many modern applications use multiple database services together:

Web Application
  |
  |-- Azure SQL Database (transactional data: orders, users)
  |-- Azure Cosmos DB (product catalogue: global, low-latency reads)
  |-- Azure Cache for Redis (session cache, shopping cart)
  |-- Azure Table Storage (audit logs, telemetry)

Each database is chosen for its strengths, rather than forcing all data into a single engine.

CQRS (Command Query Responsibility Segregation)

Separate write and read models using different databases:

Writes → Azure SQL Database (normalised, ACID)
  |
  |-- Change feed / event
  |
Reads → Azure Cosmos DB (denormalised, fast reads)

Summary

Azure offers a rich set of managed database services covering relational, NoSQL, in-memory, and migration workloads. Azure SQL Database and SQL Managed Instance serve SQL Server workloads. Azure Database for PostgreSQL and MySQL support open-source engines. Cosmos DB provides globally distributed NoSQL with multiple APIs. Azure Cache for Redis delivers in-memory performance. The Azure Database Migration Service helps you move existing databases to Azure with minimal downtime. In the next lesson, we will take a deep dive into Azure SQL Database.