Cloud Computing Tutorial · Storage and Databases · Lesson 17 of 24

Managed Relational Databases

RDS, Aurora, Azure SQL and Cloud SQL: what managed means, Multi-AZ, read replicas, backups, and choosing an engine.

Create a free account to save this page, take notes and track your progress. Sign in

What "managed" gives you

The provider handles installation, patching, backups, point-in-time recovery, monitoring, failover and storage growth. You choose the engine, size, network placement and parameters, and you still own schema design, queries and access control.

AWS Azure Google Cloud
PostgreSQL / MySQL RDS, Aurora Azure Database for PostgreSQL / MySQL (Flexible Server) Cloud SQL, AlloyDB (PostgreSQL)
SQL Server RDS for SQL Server Azure SQL Database / Managed Instance Cloud SQL for SQL Server
Global, horizontally scaled relational Aurora DSQL (Cosmos DB for PostgreSQL) Spanner

High availability and scaling

  • Multi-AZ / zone-redundant HA: a synchronous standby in another zone takes over automatically (typically in under a minute or two). Protects against zone failure, not against bad writes.
  • Read replicas: asynchronous copies for read scaling and reporting; they can lag behind.
  • Backups: automated daily snapshots plus transaction logs enable point-in-time restore (to any second within the retention window).
Replica lag in actionTry it yourself
replica_lag_s = 2.5
events = [(0.0, "write: order 7 status=paid (primary)"), (1.0, "read on replica"), (3.0, "read on replica")]
status_on_replica = "pending"
for t, e in events:
    if e.startswith("read"):
        current = "paid" if t >= replica_lag_s else status_on_replica
        print(f"t={t:3.1f}s {e:36} -> order 7 is '{current}'")
    else:
        print(f"t={t:3.1f}s {e}")
print("read-your-own-writes: send reads right after a write to the primary")

Output

t=0.0s write: order 7 status=paid (primary)
t=1.0s read on replica                      -> order 7 is 'pending'
t=3.0s read on replica                      -> order 7 is 'paid'
read-your-own-writes: send reads right after a write to the primary

Connect from private subnets only, use IAM/Entra ID authentication or managed secrets, and size connection pools: databases have connection limits that serverless and autoscaled apps can exhaust.

Test yourself

What does a Multi-AZ database deployment protect against?

  1. Accidental DELETE statements
  2. The failure of the primary's availability zone or instance
  3. Slow queries
  4. Region-wide outages
Show answer

Answer: The failure of the primary's availability zone or instance

A synchronous standby takes over; bad writes are replicated too, so you still need backups.

Was this page helpful?