Cloud SQL vs AlloyDB for ordinary PostgreSQL workloads
Quick answer: Cloud SQL is the conventional choice, but not for the reason this comparison usually gives. AlloyDB is not only an analytics product: Google’s documentation describes its C4A series in terms of transaction throughput. The usual minimum-size comparison puts two development shapes side by side, neither backed for production, so it cannot determine where production should run. Decide based on your production floor, availability requirement and total cost.
What is the question?
Section titled “What is the question?”Both run PostgreSQL. Both are managed by Google. The usual framing is that AlloyDB is for analytics, so an ordinary transactional application should use Cloud SQL. That framing is incomplete.
The facts below are divided into two types:
- Vendor-documented: read from Google Cloud documentation on 2026-09-20 and linked. Not measured here.
- Measured: run against PostgreSQL 18.6 in container
dbg-gcpon 2026-09-20, and true of PostgreSQL wherever it runs. These claims concern your own database, not either service.
Nothing here is a benchmark of either product. Benchmarking a managed service requires provisioning it, and the results would depend on region, machine series, storage, client placement and concurrency. If you need that comparison, the method is at the bottom of this page.
Each service documents a way to try it without paying. The two trials differ in shape, so read both sets of terms before planning a benchmark.
Google’s documentation, AlloyDB free trial clusters overview, read 2026-09-20, describes a cluster lasting “until one of the following occurs: 30 days have elapsed since you first created your free trial cluster”, on an “8 vCPU basic primary instance that automatically scales storage up to 1TB”. There is “no charge for free trial clusters and instance resources, but you are charged for data transfer costs for connections outside the region, through the public internet, and for taking and storing your final backup”. Afterwards “your instance stops serving requests” and the cluster is kept for a 15 day grace period before deletion.
Google’s documentation, Try out Cloud SQL for PostgreSQL using a free trial instance, read 2026-09-20, describes a different shape: “The trial lasts for 30 days”, on a “Cloud SQL Enterprise Plus edition instance” on the “N2 machine series with 8 vCPUs and 64 GB memory”, with “100 GB storage” and “375 GB data cache”. “You are allowed only one free trial instance per project”, and “Free trial instances do not support backups or restoration, except for the final backup that you can create when you delete your instance.” Afterwards “the instance stops serving requests”, with a 90 day grace period.
A like-for-like comparison is possible at 8 vCPU on both sides, but neither shape is suitable for production: the Cloud SQL side is Enterprise Plus with a data cache, which is not a default Cloud SQL instance, and neither storage figure is yours.
AlloyDB is not only an analytics product
Section titled “AlloyDB is not only an analytics product”From Choose an AlloyDB machine type, read 2026-09-20, the C4A series:
Provides the best transaction throughput for cache-fitting workloads.
A transactional application can therefore be a reason to evaluate AlloyDB, not a reason to rule it out. Whether it wins depends on your workload and bill, not on whether you have analytics.
The floor comparison is between two development shapes
Section titled “The floor comparison is between two development shapes”This comparison usually uses the smallest shape each service sells. Both halves are in Google’s documentation.
Google’s documentation on
AlloyDB machine types,
read 2026-09-20, lists c4a-highmem-1 at 1 vCPU and 8 GB, and no AlloyDB shape
on that page is smaller. On the Cloud SQL side,
Machine series overview,
read 2026-10-02, lists the shared core machine types as db-f1-micro at 1 vCPU
and 0.614 GB and db-g1-small at 1 vCPU and 1.7 GB.
Neither floor is a production baseline, so it cannot decide the production comparison.
From the Cloud SQL for PostgreSQL FAQ, read 2026-09-20:
Note that shared core instances are not covered by the SLA.
db-f1-micro is a shared-core shape, so the small Cloud SQL floor does not
include a service level agreement.
The AlloyDB floor is not a production shape either. The release note of 2025-04-09, in the AlloyDB release notes read 2026-09-20, introduced the one-vCPU configuration in Preview and described it as:
suitable for development and sandbox environments
Comparing the two therefore tells you about development environments, not production. If staging and preview databases are the cost you are evaluating, it is the relevant comparison, and the Cloud SQL floor is the smaller shape. If you are choosing where production runs, compare production shapes: a supported Cloud SQL configuration with high availability against the AlloyDB configuration you would actually run, including storage, backups, replicas or read-pool nodes, and network egress.
What the documentation says, with the numbers that are sourced
Section titled “What the documentation says, with the numbers that are sourced”Every cell below is from Google documentation read 2026-09-20 or 2026-10-02, not measured here.
| Cloud SQL for PostgreSQL | AlloyDB for PostgreSQL | |
|---|---|---|
| maximum storage | 64 TB with at least one unshared vCPU, 3054 GB on shared vCPU | 16 TiB per cluster by default, 128 TiB maximum supported |
| read scaling | read replicas and cascading replicas, up to 10 replicas for a single primary, up to four levels including the primary | read pool instances, up to 20 nodes total across the cluster |
| columnar engine | no | google_columnar_engine, with the limits below |
| smallest shape | db-f1-micro, shared vCPU, 0.614 GB, no SLA | c4a-highmem-1, 1 vCPU and 8 GB, Preview, development and sandbox |
| PostgreSQL 18 | listed as the default major version | preview 2026-01-27, generally available 2026-03-25 |
The storage row is based on Google’s documentation in About instance settings, read 2026-09-20, which says: “Instances with at least one unshared vCPU can have up to 64 TB” and “Instances with a shared vCPU can have up to 3054 GB”.
The AlloyDB storage cell is from AlloyDB quotas and limits, read 2026-10-02: “The default value for this quota is 16 TiB per cluster. The maximum supported value is 128 TiB per cluster.” The replica cell is from About replication in Cloud SQL, read 2026-10-02: “you can create up to 10 replicas for a single primary instance and create replicas of those replicas, up to four levels including the primary instance.” The shared-core memory is from Machine series overview, read 2026-10-02.
Read pools are not the same construct as replicas
Section titled “Read pools are not the same construct as replicas”From the AlloyDB overview, read 2026-09-20:
You can add one or more read pool instances, each containing up to 20 nodes total across the cluster.
The same page says of maintenance operations:
During this process, primary instances typically experience less than a second of downtime, while read pools remain continuously available.
This says that the read pool stays available. It does not say that writes continue. The primary still has the stated downtime. Clients need reconnect and retry logic on both services.
The columnar engine has conditions, and they are not small
Section titled “The columnar engine has conditions, and they are not small”From About the columnar engine, read 2026-09-20:
The columnar engine does not support tables or materialized views with the following attributes as data sources: Non-leaf partitioned tables
Foreign tables are excluded from the same list. The page also says:
For tables or views with a small number of rows, typically fewer than 5,000, the query planner might choose to use the row-store instead of the column store for better performance
If you’re running an analytical query on a column that has an index, the AlloyDB optimizer may choose to use row-store.
Frequent updates to rows invalidate columnar data.
A mixed workload therefore does not guarantee that the columnar engine will handle its analytical queries. A partitioned fact table, an indexed analytical column, or a high update rate can each prevent the column store from being used for a query. The AlloyDB trial described above can show this in the plan.
How do I tell which workload I have?
Section titled “How do I tell which workload I have?”This part of the question concerns your database rather than either product. Common rules for answering it do not hold up under measurement.
What does not work
Section titled “What does not work”Classifying a workload from pg_stat_user_tables counters fails. Measured on
PostgreSQL 18.6 in container dbg-gcp, 2026-09-20, a single analytical
aggregate over 667,142 rows, run as a nested loop, produced:
| table | idx_scan | tuples per index scan | rows per sequential scan |
|---|---|---|---|
orders | 66,666 | 10.01 | none |
customers | 0 | none | 200,000 |
Many index scans, each fetching about ten rows, are a typical transactional
pattern. On PostgreSQL 18.6 in container dbg-gcp, 2026-09-20, they came from
one analytical query that read 867,866 buffers in 1.19 seconds. The same query
made the other table look analytical. One statement produced two opposite
classifications.
The reverse fails too. Twenty single-value lookups on an unindexed column, on
PostgreSQL 18.6 in container dbg-gcp, 2026-09-20, returned 36 rows in total
and left seq_tup_read / seq_scan reading 666,666 on the largest table. By
the old rule, that looks analytical. It is a missing index.
That figure hides another trap. Those twenty queries recorded sixty sequential
scans because each parallel worker counts as one, on PostgreSQL 18.6 in
container dbg-gcp, 2026-09-20. Rows per query was 2,000,000; rows per
recorded scan was 666,666. Dividing those counters gives a number three times
smaller than the value people think they are reading.
Ruling out storage from the cache hit ratio also fails. The usual query sums
heap_blks_hit and heap_blks_read from pg_statio_user_tables. On PostgreSQL
18.6 in container dbg-gcp, 2026-09-20, it reported 100.00 percent, with
heap_blks_read at 0, for a query that at the same moment wrote 21 MB to a
temporary file and spent 1,528 ms of its 1,871 ms in an external merge sort on
disk.
pg_statio_user_tables has no temporary-file column, no write-ahead log column
and no checkpoint column. A perfect score from it does not show that storage is
irrelevant because the instrument cannot see most of the storage.
What does work
Section titled “What does work”Use pg_stat_statements over an interval, not cumulative totals, and inspect
the plans for the statements it ranks highest:
SELECT calls, round(total_exec_time) AS total_ms, round(mean_exec_time::numeric, 2) AS mean_ms, rows / NULLIF(calls, 0) AS rows_per_call, shared_blks_hit + shared_blks_read AS blocks, left(query, 70) AS queryFROM pg_stat_statementsORDER BY total_exec_time DESCLIMIT 20;Take that measurement twice, with a representative interval between them, and
subtract. rows_per_call in the thousands or millions for statements that
dominate total_ms indicates an analytical shape; single figures indicate a
transactional shape. Confirm the result by reading the plan:
EXPLAIN (ANALYZE, BUFFERS, SETTINGS) SELECT 1;Also inspect the I/O that the cache-hit query cannot see:
SELECT temp_files, pg_size_pretty(temp_bytes) AS temp_written, blks_read, blks_hitFROM pg_stat_databaseWHERE datname = current_database();Rule out the cheap answer first
Section titled “Rule out the cheap answer first”Measured on PostgreSQL 18.6 in container dbg-gcp, 2026-09-20, twenty lookups
on an unindexed column each scanned all 2,000,000 rows to return fewer than two
rows apiece. An index on that column turns the same lookup into an index scan.
That is a statement about a missing index in one fixture, not a law about PostgreSQL and not a figure to expect on your own database. A schema fault can dominate a platform difference, so check for one before comparing platforms. The platform choice still matters afterwards: concurrency, tail latency, high availability, recovery behaviour, read routing and cost remain relevant once the query is fixed.
How do I decide?
Section titled “How do I decide?”There is no single answer. Use this order.
- Fix schema faults first. Missing indexes and accidental sequential scans dominate everything below.
- Write down the production requirement: availability target, p95 and p99 latency, peak read and write concurrency, region, recovery objectives, required extensions and flags.
- Price both at that requirement, not at the catalogue floor. Include compute, storage, backups, replicas or read-pool nodes, and egress.
- If the requirement is modest and conventional, Cloud SQL is the plainer answer, and that is a valid reason to pick it. Which one is cheaper at your requirement is what step 3 is for. This page prices neither, so it does not tell you.
- If throughput, tail latency or read-tier availability is the constraint, AlloyDB is worth benchmarking, whether or not you have analytics. Google describes C4A in terms of transaction throughput.
- If you want the columnar engine, check eligibility against the limits quoted above before relying on it, then test it on the AlloyDB trial described above by reading the plan to see whether the column store was chosen.
If you do benchmark them
Section titled “If you do benchmark them”Publish enough detail for the result to transfer: schema, row counts and distribution, index definitions, PostgreSQL version and machine series on each service, region and zone topology, high-availability and read-pool configuration, client location and driver, connection count and pooling mode, warm-up and duration, read and write mix, then p50, p95 and p99 latency, throughput, errors and retries, and the plans from both services, including whether the columnar engine was eligible and selected. A single average from one run of each does not provide enough information to apply the result to another environment or a later test.
Why does AI-generated code cause this?
Section titled “Why does AI-generated code cause this?”This page makes no claim about which service an assistant prefers because that
would require an evaluation set this page does not have. The narrower failure
is easier to check: generated infrastructure code provisions whichever service
was named, at a shape nobody sized, while the capability that justified the
choice is never enabled. If you have AlloyDB and google_columnar_engine was
never created, you are paying for a product decision nobody finished.
Use a sizing checklist before choosing: workload shape, availability target, region, extension and flag requirements, and budget.
Which should I choose for a normal application database?
Cloud SQL is the conventional default, but not because AlloyDB is an analytics product. Google's own machine-type documentation, read 2026-09-20, says the AlloyDB C4A series provides the best transaction throughput for cache-fitting workloads. Choose on your production floor, availability requirement and total cost, not on whether you have analytics.
Is AlloyDB's minimum really 8 GB against a much smaller Cloud SQL floor?
The AlloyDB half is sourced: Google's AlloyDB machine type documentation, read 2026-09-20, lists c4a-highmem-1 at 1 vCPU and 8 GB. The Cloud SQL half is sourced too: Google's Cloud SQL machine series overview, read 2026-10-02, lists db-f1-micro at 1 vCPU and 0.614 GB. Neither shape is a production shape anyway: Google's Cloud SQL FAQ, read 2026-09-20, says shared core instances are not covered by the SLA, and the AlloyDB release note of 2025-04-09 introduced the 1 vCPU 8 GB configuration in Preview as suitable for development and sandbox environments.
What does AlloyDB's columnar engine do, and when does it not apply?
It keeps a column-oriented copy of selected data so analytical scans read only the columns they need. Google's documentation, read 2026-09-20, records real limits: non-leaf partitioned tables and foreign tables are not supported as sources, tables below roughly 5,000 rows may be served from the row store, an analytical query on an indexed column may be planned against the row store, and frequent updates to rows invalidate columnar data.
Can I tell my workload apart with pg_stat_user_tables?
Not reliably. Measured on PostgreSQL 18.6 in container dbg-gcp, 2026-09-20, one analytical aggregate over 667,142 rows produced 66,666 index scans at 10.01 tuples each, which looks transactional, while making the other table in the same query read 200,000 rows per sequential scan, which looks analytical. Use pg_stat_statements with interval deltas and read the plans.
Do both support PostgreSQL 18?
Yes. Cloud SQL lists PostgreSQL 18 as its default major version. The AlloyDB release notes, read 2026-09-20, record PostgreSQL 18 compatibility as preview on 2026-01-27 and generally available on 2026-03-25.