Google CloudAlloyDB for PostgreSQLDatabase

google_alloydb_instance cost estimation

A PostgreSQL-compatible instance within an AlloyDB cluster. Priced per vCPU-hour and per GB of memory-hour, plus separately-billed cluster storage.

A google_alloydb_instance is the compute half of AlloyDB, Google's PostgreSQL-compatible database built for high performance. An AlloyDB deployment is a cluster (google_alloydb_cluster) containing one primary instance and optional read-pool instances; this resource is an individual instance, and it's where most of the cost lives.

Instance compute bills on two meters: per vCPU-hour and per GB-of-memory-hour. AlloyDB uses a fixed 8 GB of memory per vCPU, so a 2-vCPU instance carries 16 GB of memory. At roughly $0.066/vCPU-hour and $0.0112/GB-hour, a 2-vCPU primary runs about $227/month. Read-pool instances are priced the same way per node, so a read pool multiplies the instance cost.

Storage is billed at the cluster level, not per instance, on actual data stored plus a continuous backup component, so it appears on google_alloydb_cluster rather than here. c3x prices this instance from machine_config.cpu_count, applying both compute meters at 730 hours/month. Add the cluster resource for the storage side of the bill.

Terraform example

A minimal but realistic configuration that C3X can estimate.

resource "google_alloydb_instance" "primary" {
  cluster       = google_alloydb_cluster.main.name
  instance_id   = "primary"
  instance_type = "PRIMARY"

  machine_config {
    cpu_count = 4
  }
}

Pricing dimensions

What you actually pay for when you provision google_alloydb_instance.

DimensionUnitWhat's being charged
vCPU hoursper vCPU-hourPer-vCPU rate for the instance, billed continuously. c3x reads machine_config.cpu_count and assumes 730 hours/month.
$0.06608/vCPU-hour in us-central1
Memory hoursper GB-hourMemory is fixed at 8 GB per vCPU. Billed per GB-of-memory-hour across the instance's total memory.
$0.0112/GB-hour in us-central1
Cluster storage (separate resource)per GB-monthData storage and continuous backup bill at the cluster level on google_alloydb_cluster, not per instance.

Sample C3X output

Example output from c3x estimate for a 4-vCPU primary (32 GB):

google_alloydb_instance.primary
├─ vCPU hours (4)         2,920  vCPU-hours    $192.95
└─ Memory hours (32 GB)  23,360  GB-hours       $261.63

OVERALL TOTAL                                  $454.58
(cluster storage billed via google_alloydb_cluster)

Optimization tips

Common ways to reduce google_alloydb_instance cost without changing the workload.

Right-size vCPU count to real load

Proportional to over-provisioning

Cost scales linearly with vCPUs (and memory follows at 8 GB each). An over-provisioned primary pays for both meters. Pull query and CPU metrics and drop to the smallest cpu_count that holds peak.

Add read-pool instances only when read load demands it

Per avoided read node

Each read-pool instance is a full-priced node. Scale the pool to actual read QPS rather than provisioning replicas speculatively.

Compare against Cloud SQL for modest workloads

Workload-dependent

AlloyDB targets high-performance PostgreSQL. For modest databases, google_sql_database_instance (Cloud SQL) is often cheaper. Estimate both before committing to AlloyDB's compute rates.

FAQ

How does c3x estimate AlloyDB instance cost?

It reads machine_config.cpu_count, derives memory at 8 GB per vCPU, and prices both the vCPU-hour and memory-GB-hour meters at 730 hours/month. Cluster storage is priced separately on google_alloydb_cluster.

Why is storage not on the instance estimate?

AlloyDB bills storage and continuous backup at the cluster level, shared across the primary and read-pool instances. So those charges appear on google_alloydb_cluster, while compute appears per instance.

How much memory does an AlloyDB instance have?

A fixed 8 GB per vCPU. You set cpu_count and memory follows automatically, so a 4-vCPU instance has 32 GB. Both contribute to the per-instance cost.

Are read-pool instances priced like the primary?

Yes. Each read-pool instance bills the same per-vCPU and per-memory meters as the primary. A read pool of two 4-vCPU nodes costs roughly twice a single 4-vCPU instance.

Is AlloyDB cheaper than Cloud SQL?

Not usually for small databases. AlloyDB's compute rates target high-performance workloads. For modest needs, Cloud SQL (google_sql_database_instance) is typically cheaper. Estimate both for your size.

Related resources

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_alloydb_instance.