Subchapter 27.8
references/design-refs/database.mdMarkdown9 KBView on GitHub
Applies to: Cloud SQL, Firestore, BigQuery, Memorystore (Redis), Cloud Spanner
Cloud SQL PostgreSQL/MySQL: Always use this rubric (confidence = inferred). Q6 () selects RDS vs Aurora — see mapping table below. Q12/Q13 tune sizing within that family; they never override Q6.
design_constraints.availabilityRead preferences.json → design_constraints.availability before selecting aws_service:
availability | PostgreSQL target | MySQL target | multi_az in aws_config |
|---|---|---|---|
single-az | RDS PostgreSQL | RDS MySQL | false |
multi-az | RDS PostgreSQL | RDS MySQL | true |
multi-az-ha | Aurora PostgreSQL | Aurora MySQL | true |
multi-region | Aurora PostgreSQL Global Database | Aurora MySQL Global Database | global cluster |
Engine (PostgreSQL vs MySQL) comes from GCP database_version, not from Q12/Q13.
| GCP Service | AWS | Blocker |
|---|---|---|
| Firestore | DynamoDB | ACID transactions spanning >100 items required → use RDS (DynamoDB limit: 100 items/transaction) |
| BigQuery | (no auto-target) | Plugin does not prescribe Athena/Redshift/Glue — use Deferred — specialist engagement in design output; OLTP latency needs → Aurora or DynamoDB per workload review with specialists |
| Cloud SQL (PostgreSQL) | RDS or Aurora | PostGIS extension → supported on both RDS PostgreSQL and Aurora PostgreSQL |
single-az, multi-az): Size from current Cloud SQL tier; database_traffic and db_io_workload select instance class, optional read replicas, and storage type (gp3 default; io2 / Provisioned IOPS when db_io_workload = "high").multi-az-ha, multi-region): Apply Q12 traffic and Q13 I/O for Aurora Standard vs I/O-Optimized, read replicas, Serverless v2, or DSQL review.db.t4g.micro or db.t4g.small single-AZ is appropriate when Q6 = Inconvenient — do not upsell to Aurora Serverless v2.preferences.json → design_constraints.db_size.value (set by Q13b in Clarify) to select the right tool: "<10GB" → pg_dump/pg_restore; "10-100GB" or "100-500GB" → pgcopydb; ">500GB" → AWS DMS strongly recommended; "unknown" → default to pgcopydbConsistentRead parameterDo not use this rubric to pick an AWS product. For any google_bigquery_* resource, follow design-infra.md → BigQuery specialist gate only: set aws_service to Deferred — specialist engagement, human_expertise_required: true, and direct the customer to their AWS account team and/or a data analytics migration partner. Do not output Athena, Redshift, Glue, EMR, or similar as the automated mapping in aws-design.json.
The sections below are background for humans after engagement — not for the agent to select automatically:
google_bigquery_ml_*) uses the same specialist gate — no automated SageMaker/Redshift ML target from this plugin.Apply in order:
single-az / multi-az → RDS (simpler, lower cost for dev and production with acceptable outage windows)multi-az-ha / multi-region → Aurora (faster failover, Global Database when required)preferences.json:
design_constraints.database_traffic — RDS: size writer/replicas; Aurora: replica count, Serverless v2, DSQL review when write-heavy-global and Q6 is Aurora tierdesign_constraints.db_io_workload — RDS: gp3 vs io2; Aurora: Standard vs I/O-Optimized (only when Q6 is Aurora tier)google_sql_database_instance (database_version=POSTGRES_15, tier=db-f1-micro)availability: "single-az"db_io_workload: "low" → gp3 storagedb.t4g.micro, single-AZ, gp3)inferredgoogle_firestore_document (root_path=users, auto_id=true)inferredgoogle_bigquery_dataset (location=us, schema=[large table])aws_service: Deferred — specialist engagement, human_expertise_required: true, confidence: inferred, rubric_applied: ["BigQuery specialist gate — no automated AWS service target"]google_sql_database_instance (database_version=POSTGRES_15, tier=db-custom-2-7680)availability: "multi-az"database_traffic: "read-heavy" → optional RDS read replicainferredgoogle_sql_database_instance (database_version=POSTGRES_15)availability: "multi-az-ha"db_io_workload: "high" → Aurora I/O-Optimizedinferred{
"gcp_type": "google_sql_database_instance",
"gcp_address": "dev-postgres-db",
"gcp_config": {
"database_version": "POSTGRES_15",
"tier": "db-f1-micro"
},
"aws_service": "RDS PostgreSQL",
"aws_config": {
"engine_version": "15",
"instance_class": "db.t4g.micro",
"multi_az": false,
"storage_type": "gp3"
},
"confidence": "inferred",
"human_expertise_required": false,
"rationale": "Q6 single-az → RDS PostgreSQL; dev-tier sizing from Cloud SQL config; gp3 for low I/O",
"rubric_applied": [
"User Preference: availability=single-az",
"Operational Model: RDS over Aurora for low-HA workload",
"Simplicity: RDS PostgreSQL single-AZ"
]
}