GCP database skill (stub). Use when: (1) running managed Postgres/MySQL/SQL Server on Cloud SQL,
Status: stub. Production depth pending.
| Need | Pick |
|---|---|
| Standard relational, <few TB | Cloud SQL (Postgres most common) |
| Postgres compatible, high-perf OLTP (~4x Cloud SQL) | AlloyDB |
| Global consistency, >10TB or multi-region writes | Spanner |
| Serverless doc store, mobile SDK | Firestore (Native) |
| Wide-column, time-series, IoT at petabyte scale | Bigtable |
| In-memory cache | Memorystore (Redis/Memcached/Valkey) |
# Cloud SQL for Postgres
gcloud sql instances create my-pg \
--database-version POSTGRES_16 \
--region africa-south1 \
--tier db-custom-2-7680 \
--storage-type SSD --storage-size 20 --storage-auto-increase \
--availability-type ZONAL \
--backup --enable-point-in-time-recovery
# Firestore (Native mode)
gcloud firestore databases create --location=africa-south1 \
--type=firestore-native
# Memorystore Redis
gcloud redis instances create my-cache \
--size 1 --region africa-south1 --tier basic
# Option 1: Cloud SQL Auth Proxy built in (recommended)
gcloud run services update my-service --region africa-south1 \
--set-cloudsql-instances=my-app-prod:africa-south1:my-pg \
--set-env-vars INSTANCE_UNIX_SOCKET=/cloudsql/my-app-prod:africa-south1:my-pg
# Connect via unix socket — no IP, no network config