1 Cloud SQL — Managed Relational Databases
Cloud SQL is Google Cloud’s fully managed relational database service, supporting MySQL, PostgreSQL, and SQL Server. Google handles patching, backups, replication, and failover, so you focus on schema and queries rather than running the engine yourself.
Key features include automated backups and point-in-time recovery, high availability (HA) via a synchronously replicated standby in a second zone, and read replicas to scale read traffic. You connect securely through the Cloud SQL Auth Proxy or with private IP over your VPC.
Cloud SQL is best for transactional (OLTP) workloads up to tens of terabytes. For very large, globally distributed relational needs with horizontal scaling, you would reach for Cloud Spanner instead. Choose the machine type and storage to match your workload, and enable HA for production.
# Create a PostgreSQL instance with high availability
gcloud sql instances create shop-db \
--database-version=POSTGRES_15 \
--tier=db-custom-2-7680 \
--region=europe-north1 \
--availability-type=REGIONAL
# Create a database and a read replica
gcloud sql databases create orders --instance=shop-db
gcloud sql instances create shop-db-replica \
--master-instance-name=shop-db --region=europe-north1