google_ sql_ database_ instance cost estimation
A managed MySQL, PostgreSQL, or SQL Server database. Priced by tier, storage, and HA mode. Sustained-use discounts apply.
A google_
First, compute. The instance tier defines vCPU and memory. Shared-core tiers (db-f1-micro, db-g1-small) are cheap and right for dev. Custom and standard tiers scale up to db-n1-highmem-96 (96 vCPU, 624 GB RAM). Compute is billed per vCPU-hour and per GB-RAM-hour. Sustained-use discounts apply automatically to monthly running instances.
Second, storage. SSD storage is $0.17/GB-month; HDD is $0.09/GB-month. Storage can be auto-scaled (storage_
Third, high availability. Setting availability_
Backups are free up to the size of the database. Backup storage above that is billed at $0.08/GB-month. Point-in-time recovery requires binary logging or WAL retention, slightly increasing storage cost.
SQL Server has license-included pricing that's 2-3x more expensive than PostgreSQL or MySQL at equivalent instance sizes. License costs can be reduced with Bring-Your-Own-License if you have eligible Microsoft licenses.
c3x reads tier, disk_
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "google_sql_database_instance" "main" {
name = "production-postgres"
database_version = "POSTGRES_16"
region = "us-central1"
settings {
tier = "db-custom-4-16384"
availability_type = "REGIONAL"
disk_size = 200
disk_type = "PD_SSD"
disk_autoresize = true
backup_configuration {
enabled = true
point_in_time_recovery_enabled = true
retained_backups = 14
}
}
deletion_protection = true
}Pricing dimensions
What you actually pay for when you provision google_.
| Dimension | Unit | What's being charged |
|---|---|---|
| vCPU hours | per vCPU per hour | Compute charge for the instance tier. Custom tiers bill by vCPU count. $0.041/vCPU-hour for PostgreSQL in us-central1 |
| Memory hours | per GB-RAM per hour | Memory charge for the instance tier. $0.007/GB-RAM-hour |
| Storage (SSD) | per GB-month | Provisioned SSD storage. Cannot be reduced after creation. $0.17/GB-month |
| Storage (HDD) | per GB-month | Provisioned HDD storage. Cheaper but lower performance. $0.09/GB-month |
| Backups (above database size) | per GB-month | Backups up to the database size are free. Anything beyond is billed. $0.08/GB-month |
| Regional HA (multiplier) | doubles compute + storage | availability_ |
Optimization tips
Common ways to reduce google_ cost without changing the workload.
Use shared-core tiers for non-production
Up to 95%db-f1-micro and db-g1-small are 90%+ cheaper than standard or custom tiers. Right for dev/staging, ephemeral databases, and personal projects. Not for production.
Skip Regional HA for non-production
About 50%Regional HA doubles compute and storage cost. Non-production rarely needs the 99.95% SLA. Disable for dev/staging.
Commit to 1-year or 3-year usage
25-52%Committed Use Discounts cut Cloud SQL compute prices by 25% (1-year) or 52% (3-year). Right for production databases that won't move.
Use HDD storage for write-heavy archive workloads
About 50% on storageHDD is roughly half the per-GB cost of SSD. Lower IOPS but fine for append-only logs, audit databases, or any workload where IOPS aren't critical.
FAQ
Does c3x apply Sustained Use Discounts to Cloud SQL?
Yes. SUDs apply automatically to instances running more than 25% of the month, up to a 30% discount for full-month running. c3x applies these to monthly estimates.
What's the difference between Cloud SQL and AlloyDB?
AlloyDB is a separate higher-performance PostgreSQL service with different pricing (priced by vCPU + RAM + storage like Cloud SQL but more expensive). Right for analytical or high-performance workloads. Cloud SQL is right for general-purpose application databases.
Are backups really free?
Yes, up to the size of the database. A 100 GB database gets 100 GB of free backup. Beyond that, you pay. Long retention windows (>30 days) can push backup costs above the free amount.
Why is SQL Server more expensive?
Cloud SQL for SQL Server includes the Microsoft license cost, which roughly doubles or triples the per-vCPU rate. Use BYOL if you have eligible licenses, or consider PostgreSQL if compatible.
Related resources
More Google Cloud resources
Further reading
- Cloud SQL vs RDS for PostgreSQL: a line-by-line cost comparison
Google prices Cloud SQL by vCPU and GB separately; AWS prices RDS by fixed instance shape. That single difference changes which cloud is cheaper for your particular ratio of CPU to memory. Here is the comparison at real prices.
- GCP AlloyDB cost: compute per vCPU-hour plus regional storage
AlloyDB bills compute per vCPU-hour and memory, plus regional storage per GB-month with no separate I/O charge, plus backups. It is a PostgreSQL-compatible database aimed at demanding workloads. Here is how it prices versus Cloud SQL.
- GCP Cloud SQL editions cost: Enterprise vs Enterprise Plus
Cloud SQL now has two editions: Enterprise and Enterprise Plus. Enterprise Plus costs more per vCPU and memory but adds a data cache, better performance, and near-zero-downtime maintenance. Here is how the editions price and when the upgrade pays off.
- GCP Cloud SQL high availability cost: what HA roughly doubles
Enabling high availability on Cloud SQL provisions a standby instance in another zone, which roughly doubles the compute and storage cost of the database. Here is exactly what HA adds and when the resilience is worth the price.
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including google_.