All GCP services

GCP · Database

Cloud SQL

Managed MySQL, Postgres, SQL Server.

Official docs

Overview

Cloud SQL handles backups, replicas, HA failover and patching for popular relational engines.

When to use it

  • OLTP workloads
  • Drop-in DB for migrated apps
  • QA fixture DB with PITR

Setup

  1. Enable Cloud SQL Admin API.
  2. Create instance: pick engine, region, machine type, HA.
  3. Set authorized networks or use Cloud SQL Auth Proxy.

How to use

Connect via proxy
./cloud-sql-proxy PROJECT:us-central1:qa-db &
psql 'host=127.0.0.1 dbname=qa user=app'
Clone for test env
gcloud sql instances clone qa-db qa-db-pr-42

QA use cases

  • Clone production-like snapshots for performance and data-migration tests.