Cloud

Building block · 11 min

Relational databases

Managed Postgres and MySQL, cloud-native engines like Aurora and AlloyDB, and distributed SQL.

Most systems in this course start on a relational database, and most of them should (SQL or NoSQL?). On a cloud, the choice is less "Postgres or MySQL" and more "which architecture do I rent?". The three clouds sell three quite different designs under similar names:

  • A classic instance with a standby. One server writes, a standby in another zone waits to take over, and read replicas copy changes asynchronously. This is plain Postgres or MySQL, run for you.
  • Shared, replicated storage. The database engine is separated from a storage layer that replicates across zones by itself. Replicas read the same storage instead of copying it.
  • Distributed SQL. Data is split and replicated across many machines, often across Regions, and the system coordinates transactions between them.

Each step down that list removes an operational job (failover, replica lag, sharding) and adds a constraint you have to design around. This page compares what each cloud offers at each step, and what goes wrong in production. For the background, see Read replicas, Failover and Sharding.

Side by side

AWS Google Cloud Azure Self-hosted
Classic managed instance RDS for PostgreSQL / MySQL: synchronous standby that can't serve reads; or a Multi-AZ DB cluster with two readable standbys Cloud SQL: primary and standby in two zones, writes committed to both zones' disks Azure Database for PostgreSQL: warm standby, synchronous, in another zone Postgres with Patroni, or MySQL with Orchestrator: you run failover
Shared storage engine Aurora: six storage nodes across three zones, up to 15 replicas on the same volume AlloyDB: compute and storage separated, plus an in-memory columnar engine Azure HorizonDB: compute and storage separated, replicas share one copy of the data; in preview as of late 2026 Neon-style designs exist, but you would be operating a storage system
Distributed SQL Aurora DSQL: serverless, active-active across Regions, optimistic concurrency Spanner: externally consistent, with a PostgreSQL-dialect interface Elastic clusters in Azure Database for PostgreSQL (Citus) CockroachDB, YugabyteDB, Vitess (MySQL), Citus
What you pay for Instance-hours and storage; Aurora Standard also bills I/O Instances and storage Server compute and storage; the HA standby is billed like the primary Machines, disks and the people who run them