Disaggregated WAL log processing, PG 17+ index prefetch, Google Columnar Engine 10.6, Managed Connection Pooling on port 6432, and Zero-ETL Iceberg and BigQuery pipelines.

Series: A five-part series for database engineers moving from AlloyDB Express prototypes to enterprise production without lock-in. Part 1 covers AlloyDB Express, fast provisioning, and Cloud Run lazy connectors. Part 2 builds hybrid RAG with ScaNN, HNSW, and reciprocal rank fusion. Part 3 hardens autonomous database agents behind IAM, MCP policy, and parameterized secure views. Part 4 opens up the AlloyDB engine internals for HTAP, pooling, and Zero-ETL analytics. Part 5 delivers local parity with AlloyDB Omni, zero-downtime migration, and clean exit portability.

This is Part 4.

The problem: when PostgreSQL storage, analytics, and connection storms collide

Stock PostgreSQL was built for a single server where the query engine and the storage disk share one kernel, one page cache, and one I/O budget. Under light load that coupling is simple and predictable. Under enterprise load, three failure modes show up at once.

First, checkpoints and VACUUM contend with live OLTP transactions for the same local block device, turning tail latency into a sawtooth. Second, analytical SUM, GROUP BY, and hash joins over millions of rows thrash shared_buffers, evicting the hot B-tree index pages that OLTP transactions need. Third, a burst of serverless workers or microservices opens thousands of short-lived connections on port 5432, burning backend memory and CPU on connection setup instead of queries.

AlloyDB for PostgreSQL replaces that coupled single-node bottleneck with a disaggregated storage tier, a dual-format row and columnar execution engine, a built-in transaction pooler on port 6432, and Zero-ETL paths to Apache Iceberg and BigQuery. Every piece stays behind standard PostgreSQL wire protocol and SQL.

What you'll be able to do

By the end of this post you should be able to:

  • Identify the components of an AlloyDB cluster across compute (N2, C4A, C4, Z3), disaggregated WAL storage (128 TiB per cluster), and pooling endpoints (5432 vs. 6432).
  • Explain how WAL disaggregation eliminates checkpoint I/O storms, how PostgreSQL 17+ index prefetch avoids shared_buffers pollution (ultra fast cache hit), and how Google Columnar Engine 10.6 executes vectorized scans and joins.
  • Configure google_columnar_engine memory and SSD storage cache, virtual JSON columns (-> and ->>), Managed Connection Pooling flags, and read pool autoscaling policies.
  • Diagnose planner misestimates, stale columnar blocks (invalid_block_count), index scan cost regressions (alloydb.enable_cache_aware_costing), and Transparent Query Forwarding disqualifications in EXPLAIN output.
  • Decide between USING iceberg direct scans, bigquery_fdw federation, and alloydb_sync mirroring, and evaluate machine series and pooling modes for mixed OLTP and HTAP workloads.
  • Build a Zero-ETL operational and analytical pipeline that joins live AlloyDB tables with Iceberg and BigQuery data and feeds a governed Data Agent Kit Medallion (Bronze to Silver to Gold) workflow.

Setup

To run the commands in this post, you need an AlloyDB for PostgreSQL cluster running PostgreSQL 17 or PostgreSQL 18 (PostgreSQL 18 is required for Hot Standby, USING iceberg direct Iceberg access, and alloydb_sync), plus psql and the gcloud CLI.

Your IAM principal needs the AlloyDB Admin predefined role (roles/alloydb.admin) to modify instances, enable Managed Connection Pooling, and update database flags. For Zero-ETL Iceberg and BigQuery labs, the AlloyDB cluster service account also needs roles/storage.objectViewer, roles/biglake.viewer (when using Lakehouse runtime catalog), roles/bigquery.dataViewer, roles/bigquery.readSessionUser, and roles/bigquery.jobUser.

Check your cluster's service account and existing flags before making changes:

gcloud beta alloydb clusters describe CLUSTER_ID \ --region=REGION_ID \ --project=PROJECT_ID \ --format="value(serviceAccountEmail)" 

Keep one operational rule from the docs in mind before updating any flag: gcloud alloydb instances update --database-flags=... replaces the entire flag list on that instance. Always pass every existing non-default flag you want to preserve alongside any new flag.

Part A: Disaggregated storage, WAL offloads, and compute machine shapes

Compute, WAL, and storage as separate scaling planes

Standard PostgreSQL writes dirty 8 KB heap and index pages from shared_buffers to local disk during checkpoints. In AlloyDB, compute nodes are stateless PostgreSQL execution VMs separated from a regional, multi-AZ distributed storage engine that scales automatically up to 128 TiB per cluster.

Architecture diagram of AlloyDB disaggregated compute, storage, and HTAP: client traffic enters Managed Connection Pooling on TCP 6432 and routes writes to a multi-zone HA Primary and reads to an autoscaling Read Pool, while the Primary writes synchronous WAL to the Regional Log Persistor before Async Log Processing Servers materialize 8 KB data blocks into 128 TiB Shared Distributed Storage and zero-compute-impact backups.

Compute nodes hold memory and local SSD cache only; durable state lives in the regional log persistor and shared 8 KB block storage.

Follow the numbered path in the architecture diagram:

  1. Client ingress: Applications connect over PostgreSQL wire protocol on port 5432 directly or port 6432 when Managed Connection Pooling is enabled.
  2. Compute execution plane: Managed Connection Pooling routes writes and transactions to the single Primary instance and read queries to optional Read Pool instances (up to 20 nodes total across all read pools in a cluster behind a load-balanced reader IP), with Transparent Query Forwarding (TQF) bridging eligible primary reads to the read pool.
  3. Synchronous WAL durability: When a transaction commits on the Primary, AlloyDB writes WAL records synchronously to the Regional Log Persistor with a quorum acknowledgment before confirming commit, guaranteeing zero data loss (RPO = 0) across zonal failovers. Dirty data pages stay in primary RAM without checkpoint flushes to disk.
  4. Asynchronous WAL transfer: The Regional Log Persistor streams WAL records asynchronously to Async Log Processing Servers.
  5. Block materialization: Async Log Processing Servers materialize WAL records into 8 KB data blocks inside Shared Distributed Storage across zones and clean up processed WAL segments, so compute nodes never pay checkpoint I/O storms.
  6. Zero-compute-impact backups: Storage-layer snapshots run independently of compute nodes. Continuous backup and recovery defaults to a 14-day point-in-time recovery (PITR) window (configurable from 1 to 35 days with microsecond granularity), alongside automated incremental backups and on-demand full backups. For regulated workloads, Enhanced backups store immutable, indelible backups in a centralized Backup and DR Service vault with enforced retention.
  7. HTAP and Zero-ETL Iceberg: Compute nodes scan local in-memory and SSD columnar tiers in Google Columnar Engine (10.6) and stream or cache Parquet data from Apache Iceberg on Cloud Storage (gs:// or bl://).
  8. BigQuery federation and sync: Compute nodes push filters and aggregations to BigQuery via bigquery_fdw or mirror tables locally via alloydb_sync on PostgreSQL 18.

On PostgreSQL 18 clusters, Hot Standby keeps the primary's cross-zone standby node running as a live replica rather than a cold standby. During failover, the standby transitions faster to read-write mode and already holds warm caches, avoiding the post-failover performance cliff caused by cold shared_buffers.

Choosing compute shapes across N2, C4A, C4, and Z3

Because compute is decoupled from durable storage, AlloyDB supports cross-machine-series configurations: your primary instance and read pool instances in the same cluster can run on different Compute Engine platforms (though HA primary active and standby nodes match each other, and all nodes inside a single read pool share one shape).

Machine series Core platform and CPU Max vCPU and RAM (in AlloyDB) Workload fit
N2 3rd Gen Intel x86 (Ice Lake) Up to 128 vCPU, 864 GB RAM General purpose, widest regional availability
C4A Google Axion ARM 1 to 72 vCPU, up to 576 GB RAM (c4a-highmem-72-lssd) Best price-performance and throughput for cache-fitting workloads
C4 6th Gen Intel x86 (Granite Rapids) + Titanium SSD 4 to 288 vCPU, 2,304 GB RAM (c4-highmem-288-lssd) Lowest latency and largest vertical scale
Z3 4th Gen Intel x86 (Sapphire Rapids) + Titanium SSD Up to 88 vCPU, 704 GB RAM (z3-highmem-88-standardlssd) Storage-dense working sets requiring more local SSD cache per vCPU

Notice one quirk on C4A: the 1-vCPU tier (c4a-highmem-1, 8 GB RAM) has no local SSD, so its columnar engine storage cache size is 0 and its default columnar memory allocation drops from 30% to 10%. Every 2 vCPU and larger tier in C4A, C4, Z3, and N2 pairs compute RAM with local SSD cache.

Documented OLTP throughput baselines

To ground what the disaggregated log pipeline delivers without custom flag tuning, Google Cloud publishes reproducible HammerDB TPC-C and pgbench benchmarks for multi-zone HA AlloyDB clusters (run without read pools, with an e2-standard-32 or n2-standard-64 client in the same zone):

Benchmark Instance size Cache scenario Documented result
HammerDB TPC-C 64 vCPU, 512 GB 100% cached (2,304 warehouses, 1,024 users) 716,138 NOPM (1,665,438 cumulative TPM, 27,757 TPS)
HammerDB TPC-C 64 vCPU, 512 GB 30% cached (12,800 warehouses, 1,024 users) 589,598 NOPM (1,371,160 cumulative TPM, 22,853 TPS)
HammerDB TPC-C 16 vCPU, 128 GB 100% cached (576 warehouses, 256 users) 428,316 NOPM (974,264 cumulative TPM)
HammerDB TPC-C 16 vCPU, 128 GB 30% cached (3,200 warehouses, 256 users) 252,970 NOPM (582,385 cumulative TPM)
pgbench Select Only 64 vCPU, 512 GB Scale 15,000 (~220 GB), 256 clients 467,583 TPS (0.547 ms avg latency, ~95% CPU)
pgbench Index Insert Only 16 vCPU, 128 GB Scale 25,000 (~365 GB), 5 extra indexes on pgbench_history 51,742 TPS (4.947 ms avg latency, ~88% CPU)

Even when five secondary indexes sit on pgbench_history and the dataset exceeds RAM (365 GB on a 128 GB node), AlloyDB sustains 51,742 TPS of concurrent inserts because WAL writes commit to the Regional Log Persistor while background servers materialize blocks.

Part B: Storage engine read/write path, Index Prefetch, and Adaptive Autovacuum

Why B-tree range scans stall on cold working sets

In open-source PostgreSQL 18 and earlier, Bitmap Index Scan prefetches heap blocks, but standard Index Scan and Index Only Scan nodes read scattered table and index pages one I/O at a time. When a query scans thousands of rows across a timestamp range (BETWEEN or ORDER BY ... LIMIT) on a table larger than RAM, the execution thread blocks on every uncached page fetch.

Predict before you look: if an engine prefetches 1,000 scattered table pages ahead of an Index Scan and drops them directly into PostgreSQL shared_buffers, what happens to the rest of your active OLTP sessions?

Dual write and read path diagram: the top write path sends synchronous WAL from Primary TX Commit to the Regional Log Persistor and Async Log Processing Servers that materialize 8 KB blocks into 128 TiB Shared Distributed Storage; the bottom read path checks Cache-Aware Costing and PG Shared Buffers while PG 17+ Index Prefetch looks ahead and stages pages in the Ultra-Fast Local SSD Cache, reporting ultra fast cache hit outside Shared Buffers, while Adaptive Autovacuum reclaims bloat.

Prefetched pages stage in the Ultra-Fast Local SSD Cache outside shared_buffers, keeping OLTP buffer pools untouched.

They would evict your hot transactional working set from shared_buffers. AlloyDB avoids that cache pollution by staging prefetched pages in the Ultra-Fast Local SSD Cache outside PostgreSQL shared_buffers.

On PostgreSQL 17 and later, Index Prefetch is enabled by default with zero flags or SQL changes. It looks ahead on both B-tree index pages and scattered heap pages in parallel, obeys three built-in guardrails (LIMIT boundary stops, index-only scans prefetch index pages only without touching the heap, and single-row PK lookups skip prefetch), and reports local SSD hits directly in EXPLAIN (ANALYZE, BUFFERS) as ultra fast cache hit.

Here is the Buffers line format documented in the AlloyDB execution plan guide:

EXPLAIN (ANALYZE, BUFFERS) SELECT id, value, effective_date FROM public.orders_ledger WHERE effective_date BETWEEN DATE '2026-01-01' AND DATE '2026-01-31' ORDER BY effective_date LIMIT 5000; 
-- Verbatim Buffers line format from AlloyDB's execution plan docs (full-scan example): Buffers: shared hit=1185 read=842625 dirtied=1, ultra fast cache hit=842625 

Notice how shared read=842625 matches ultra fast cache hit=842625 in the docs example: PostgreSQL requested those blocks from outside shared_buffers, and AlloyDB served every single one from its local ultra-fast SSD cache rather than remote storage. On a LIMIT 5000 range scan, you will see smaller counts matching the pages prefetched up to the LIMIT boundary.

Cache-Aware Costing: fixing planner index vs. Seq Scan flips

Even when your hot index and table pages already sit in shared_buffers, standard PostgreSQL cost planning still charges random_page_cost as if reads hit disk. That pessimistic I/O estimate can cause an Index Scan to lose to a Seq Scan.

AlloyDB addresses this with Cache-Aware Costing (alloydb.enable_cache_aware_costing, currently in Preview, no instance restart required). When enabled globally or per session, the planner inspects buffer residency at planning time and scales down the estimated I/O cost of index scans.

In the AlloyDB documentation example, a warmed Index Scan (Buffers: shared hit=926) drops its planner cost estimate from 3906.49 down to 27.49 once cache awareness is turned on:

SET alloydb.enable_cache_aware_costing = on; EXPLAIN (ANALYZE, VERBOSE, BUFFERS) SELECT count(d) FROM t1 WHERE a = 10 AND b > 100 AND c > 100; 

Adaptive Autovacuum: preventing bloat and XID wraparound

On high-churn OLTP tables, static autovacuum throttling leaves dead tuples piling up until VACUUM hits emergency XID wraparound mode and steals I/O during peak traffic. AlloyDB enables Adaptive Autovacuum (enable_google_adaptive_autovacuum=on) by default with no restart required. It dynamically scales vacuum CPU, I/O, worker count, and memory to workload pressure, throttles transaction ID consumption if wraparound approaches, and emits blocker warnings in the postgres log when long-running transactions, orphan prepared transactions, or orphan replication slots pin dead tuples:

Found a backend process PROCESS_ID with a long running transaction whose transaction id age AGE is larger than or equal to the transaction age threshold AGE_THRESHOLD. 

Part C: Google Columnar Engine (10.6), SSD storage cache, and vectorized execution

Dual-format HTAP without ETL

Enabling google_columnar_engine.enabled=on (which triggers one instance restart) activates Google Columnar Engine 10.6 on PostgreSQL 16 and later (10.5 on PostgreSQL 15); run CREATE EXTENSION IF NOT EXISTS google_columnar_engine; in each target database to expose its SQL management functions and g_columnar_* views. It transforms row-oriented heap tables, materialized views, and HNSW/ScaNN vector indexes into a compressed, vectorized column store organized into two memory tiers:

  1. In-Memory Column Store: Defaults to 30% of instance RAM (10% on 1-vCPU instances; 128 MB minimum; 50% recommended max, 70% hard max, or 20% max on 1-vCPU).
  2. SSD Storage Cache: Automatically spills columnar blocks to local Titanium/NVMe SSD via google_columnar_engine.storage_cache_size. Because RAM holds metadata indexes for the SSD tier, AlloyDB recommends sizing the SSD storage cache to 100x to 1,000x the columnar RAM allocation (for example, 1 GB columnar RAM paired with 100 GB to 1,000 GB storage cache).
Instance vCPUs Default Storage Cache (N2 Primary / Read Pool) Default Storage Cache (C4A Primary or Read Pool) Max Configurable (N2 Primary / N2 Read Pool / C4A)
1 vCPU N/A 0 (no local SSD) 0
8 vCPU 18.75 GB / 37.5 GB 37.5 GB 187.5 GB / 375 GB / 375 GB
16 vCPU 37.5 GB / 37.5 GB 75 GB 375 GB / 375 GB / 750 GB
64 vCPU 150 GB / 150 GB 262.5 GB 1,500 GB / 1,500 GB / 2,625 GB

Columnar Engine v10.6 execution flow diagram: incoming OLAP and HTAP SQL hits an Optimizer Cost Check (EXPLAIN ANALYZE COLUMNAR_ENGINE). Point lookups and unsupported or small tables fall back to Row Store Execution; qualifying analytical scans enter the Google Columnar Engine spanning the In-Memory Column Store (30% RAM default) and 100x-1000x SSD Storage Cache, evaluate pre-computed Virtual JSON Columns (-> and ->>), and execute Vectorized Hash Joins and Scans with Bloom filters and Late Materialization.

The PostgreSQL optimizer compares row-store and columnar costs per table; you never rewrite SQL to hit the column store.

Virtual JSON columns, vectorized joins, and EXPLAIN (ANALYZE, COLUMNAR_ENGINE)

Three capabilities in Columnar Engine 10.6 matter for modern JSON-heavy and star-schema workloads:

  • Auto-columnarization: Enabled by default (google_columnar_engine.enable_auto_columnarization=on), sampling queries every hour (EVERY 1 HOUR) to load high-value columns automatically. You can trigger it on demand with SELECT google_columnar_engine_recommend(); or get RAM sizing advice via SELECT * FROM google_columnar_engine_recommend(mode => 'RECOMMEND_SIZE');.
  • Virtual columns for JSON expressions (Preview, PG 16+): Analytical filters on JSON and JSONB payloads (-> and ->>) normally burn CPU parsing JSON row by row. Setting google_columnar_engine.enable_virtual_columns_scan=on (note: while the feature guide mentions on by default, the flag reference lists off, so set it explicitly; no restart required) pre-computes extracted paths into columnar virtual columns:
-- Pre-compute JSONB extraction paths into columnar virtual columns (no restart) SET google_columnar_engine.enable_virtual_columns_scan = on; SELECT google_columnar_engine_add( relation => 'public.events', columns => 'event_id, payload', expressions => '"payload ->> ''region''", "payload -> ''metrics'' ->> ''latency_ms''"' ); SELECT relation_name, description, column_data_type, status FROM g_columnar_virtual_columns; 
  • Vectorized Hash Joins and Late Materialization: Enabling google_columnar_engine.enable_vectorized_join=on (default off, no restart) turns on multithreaded Vectorized Hash Join nodes with runtime Bloom filters (Build bloom filter, Rows Removed by Bloom Filter) and Columnar projection mode: late materialization, which defers fetching non-filtered payload columns until rows survive join and filter predicates.

Predict before you look: you populated a 50-million-row table into the column store, enabled google_columnar_engine.enabled=on, and ran SELECT SUM(amount) FROM orders WHERE status = 'PAID', yet EXPLAIN still shows a Seq Scan or Index Scan. What option reveals the exact first reason the optimizer rejected the column store?

Run EXPLAIN (ANALYZE, COLUMNAR_ENGINE)! Any non-columnar scan node prints a Columnar Check: line telling you why it fell back (for example table is too small, a needed column of the table is not in the CE store, or a needed column has a CE unsupported data type):

EXPLAIN (COLUMNAR_ENGINE, COSTS OFF) SELECT * FROM sample_small_table WHERE col1 > 10000; 
-- Schematic output matching AlloyDB columnar-engine/monitor-tune.md: Seq Scan on sample_small_table Filter: (col1 > 10000) Columnar Check: table is too small 

Once a multi-table join qualifies and google_columnar_engine.enable_vectorized_join=on is active, EXPLAIN (ANALYZE, COSTS OFF, BUFFERS, TIMING OFF, SUMMARY OFF) shows the Vectorized Hash Join operator, runtime Bloom filter, and Custom Scan (columnar scan) nodes:

EXPLAIN (ANALYZE, COSTS OFF, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT l_quantity, l_extendedprice, l_discount, l_tax FROM lineitem, orders WHERE l_shipdate <= DATE '2022-08-06' AND l_orderkey = o_orderkey AND o_orderdate <= DATE '2025-03-07'; 
-- Schematic output matching AlloyDB columnar-engine/monitor-tune.md: Vectorized Hash Join (actual rows=3934686 loops=1) Vectorized partitioning, Partitions: 16 (Disk usage: 208MB) (Peak Memory Usage: 27MB, Threads: 1) Hash Cond: (lineitem.l_orderkey = orders.o_orderkey) Rows Removed by Bloom Filter: 0 Buffers: temp read=26728 written=26728 -> Append (actual rows=3934686 loops=1) -> Custom Scan (columnar scan) on lineitem (actual rows=3934686 loops=1) Filter: (l_shipdate <= '2022-08-06'::date) Rows Removed by Columnar Filter: 56051366 Columnar cache search mode: native -> Seq Scan on lineitem (never executed) -> Vectorized Hash (actual rows=7245824 loops=1) Build bloom filter, Memory Usage: 1024kB ... 

Freshness failure mode: silent degradation from invalid blocks

Columnar blocks are not updated synchronously on every INSERT, UPDATE, or DELETE. Instead, DML marks affected columnar blocks as invalid, and queries transparently blend valid columnar blocks with row-store pages. As invalid_block_count climbs, queries slow down until background refresh kicks in at google_columnar_engine.refresh_threshold_percentage (default 25, meaning 25% invalid blocks).

Diagnose staleness and storage cache saturation directly in SQL:

-- 1. Check columnar freshness and invalid block ratio SELECT relation_name, status, invalid_block_count, total_block_count, invalid_percentage, auto_refresh_recent_status FROM g_columnar_relations; -- 2. Check RAM and SSD storage cache headroom SHOW google_columnar_engine.storage_cache_size; SELECT google_columnar_engine_memory_available() AS ram_free_mb, google_columnar_engine_storage_cache_used() AS ssd_cache_used, google_columnar_engine_storage_cache_available() AS ssd_cache_available; -- 3. Check per-query columnar execution stats (requires pg_stat_statements) SELECT query_id, columnar_unit_read, page_read, rows_filtered, columnar_scan_time, vectorized_join_time FROM g_columnar_stat_statements WHERE page_read > 0; 

Two operational gotchas from the docs: first, partitioned tables cannot be added as parent tables (google_columnar_engine_add must target leaf partitions individually); second, tables with fewer than roughly 5,000 rows or queries hitting an existing B-tree index may still prefer row-store execution. For large OLAP tables where a non-unique index exists solely for analytics, adding those columns to the column store lets you drop the index and remove its write-amplification penalty on the primary.

Part D: Managed Connection Pooling, Transparent Query Forwarding, and LDTM

Scaling to 262,042 client connections on port 6432

Every idle PostgreSQL backend process consumes memory and pollutes snapshot arrays (ProcArray). AlloyDB solves connection storms with Managed Connection Pooling, a built-in, PgBouncer-compatible multiplexer running directly on primary and read pool instances on TCP port 6432.

Managed Connection Pooling is disabled by default and requires roles/alloydb.admin. Enable it at creation or on an existing instance without restarting the database (instances created before November 2024 incur a one-time VPC network update under 15 seconds):

gcloud alloydb instances update INSTANCE_ID \ --project=PROJECT_ID \ --region=REGION_ID \ --cluster=CLUSTER_ID \ --enable-connection-pooling \ --connection-pooling-pool-mode=transaction \ --connection-pooling-max-client-connections=50000 \ --connection-pooling-max-pool-size=100 \ --connection-pooling-query-wait-timeout=120 \ --connection-pooling-stats-users=postgres 

Key configuration bounds from the docs:

Flag Allowed range Default Notes
--connection-pooling-pool-mode transaction or session transaction transaction returns the server connection after each txn
--connection-pooling-max-client-connections 1 to 262,042 5,000 Simultaneous client sockets accepted on port 6432
--connection-pooling-max-pool-size 1 to 262,042 50 Max backend server connections per (user, database) pair
--connection-pooling-min-pool-size 0 to 262,042 0 Warm server connections kept ready
--connection-pooling-query-wait-timeout 0 to 2,147,483 s 120 s Wait limit before rejecting queued client queries
--connection-pooling-max-prepared-statements 0 to 262,042 0 Prepared statement cache in transaction mode
--connection-pooling-server-idle-timeout 0 to 2,147,483 s 600 s Idle server connection tear-down

Note three critical rules:

  1. No Public IP: Managed Connection Pooling works over Private Services Access, Private Service Connect, AlloyDB Language Connectors, and AlloyDB Auth Proxy (--auto-iam-authn, which maintains its own separate pool alloydb_mcp_stats_authproxy_pooler1). It is not supported for Public IP connections or REPLICATION users.
  2. Transaction-mode SQL traps: In default transaction mode, session-scoped state does not survive across transactions. SET/RESET, LISTEN, WITH HOLD CURSOR, SQL PREPARE/DEALLOCATE, PRESERVE/DELETE ROW temp tables, LOAD, session-level advisory locks, and protocol-level prepared plans (unless configured) are unsupported.
  3. Live PgBouncer admin console: Once --connection-pooling-stats-users is set, connect to database alloydb_mcp_stats_1 on port 6432 over private IP and run SHOW POOLS;, SHOW STATS;, and SHOW CLIENTS;.

Pooling, read routing, and LDTM diagram: up to 262,042 client connections arrive on TCP 6432 at Managed Connection Pooling (transaction mode, max-pool-size 50 default, 120s wait timeout). Writes go to the HA Primary; Transparent Query Forwarding on PG 17/18 intercepts eligible read-only SELECTs and routes them to the autoscaling Read Pool (up to 20 nodes) with read-your-writes consistency. Low Downtime Maintenance prepares replacement servers and cuts over in under 1 second on Primary and 0 seconds on Read Pools.

Port 6432 absorbs connection spikes while Transparent Query Forwarding and Read Pool autoscaling offload heavy SELECT traffic.

Transparent Query Forwarding (Preview) and Read Pool autoscaling

Rewriting a legacy monolith to split READ/WRITE and READ_ONLY endpoints is slow, and reading from an async replica breaks read-your-writes consistency. On PostgreSQL 17 and 18, Transparent Query Forwarding (TQF, in Preview) solves this inside the Primary instance:

-- Enable for the current session or persistently per database (no restart) SET alloydb.enable_query_forwarding = TRUE; -- or: ALTER DATABASE appdb SET alloydb.enable_query_forwarding = ON; EXPLAIN SELECT count(*) FROM large_table t1, large_table t2; 
-- Schematic EXPLAIN suffix when TQF qualifies: Query Forwarding: Eligible. (overhead=1250.02) 

Predict before you look: you enable alloydb.enable_query_forwarding = TRUE on a cluster with a 4-node Read Pool, connect via IAM auth from a Python psycopg service using server-side parameter binding (extended query protocol), and run SELECT id, created_at FROM orders WHERE created_at >= CURRENT_DATE. Does TQF forward it?

No, on three separate grounds! Check the strict TQF disqualifiers from transparent-query-forwarding.md:

  • Built-in auth only: TQF requires a built-in PostgreSQL user (postgres or password role); IAM authentication is not supported.
  • Simple query protocol only: Extended query protocol is not supported.
  • No SQL value or volatile functions: CURRENT_DATE, LOCALTIME, USER, CURRENT_SCHEMA, NEXTVAL(), UDFs, SQL procedures, FOR UPDATE row locks, temp/unlogged/catalog tables, and queries whose forwarding overhead exceeds query cost (such as cheap index scans) stay on the primary.

Watch Cloud Monitoring metric alloydb.googleapis.com/internal/database/postgresql/workload/distributed/tqf_query_count (status=completed, fallback, or disqualified) to verify forwarding rates.

For your Read Pool tier (up to 20 nodes across the cluster), enable autoscaling (Preview) combining CPU utilization, connection count, and cron schedule policies (--autoscaler-set-schedule, --autoscaler-schedule-cron-exp, --autoscaler-schedule-duration-seconds). When multiple policies are active, AlloyDB picks the highest recommended node count and waits 10 minutes below target before scaling in. Remember two limits: existing long-lived connections are not rebalanced onto newly added nodes (use Managed Connection Pooling or reconnect), and new nodes need a few minutes to warm caches.

Low Downtime Maintenance (LDTM): <1s primary, 0s read pool

During system patches, OS updates, or scaling operations, AlloyDB uses Low Downtime Maintenance (LDTM): it provisions replacement servers ahead of time, updates read pools concurrently first (0 seconds of read-pool downtime), and switches the primary in under 1 second. Active connections drop momentarily during the primary switchover, so applications should use connection pooling and exponential backoff. For non-production environments where speed matters more than uptime, gcloud beta alloydb instances update --update-mode=FORCE_APPLY completes machine-type changes faster in 10 to 15 minutes with roughly 1 minute of downtime.

Part E: Zero-ETL Lakehouse (USING iceberg), BigQuery Federation, and Data Agent Kit Medallion

Operational PostgreSQL data rarely lives in isolation. AlloyDB PG 18+ supports three native Zero-ETL and sync patterns alongside Google Cloud's Knowledge Catalog and Data Agent Kit Medallion pipelines.

Zero-ETL Lakehouse and Medallion diagram: left column shows AlloyDB Operational Heap and Columnar tables, PG 18+ Native Iceberg (USING iceberg TAM reading Parquet on gs:// or bl://), and bigquery_fdw pushdown plus GA alloydb_sync. Middle column shows Knowledge Catalog (Dataplex) auto-metadata sync and BigQuery Analytics and BigLake (Storage Read API). Right column shows the Data Agent Kit Medallion Pipeline (Bronze raw landing -> Silver Dataform SQLX validated truth -> Gold incremental uniqueKey/partitionBy aggregates) orchestrated by PR+CI-verified Cloud Composer DAGs.

AlloyDB connects directly to Iceberg in Cloud Storage, pushes SQL down to BigQuery, and participates in Knowledge Catalog and Medallion orchestration.

Pattern 1: Direct Apache Iceberg access (USING iceberg, Preview, PG 18+)

Rather than copying Parquet files out of Cloud Storage, AlloyDB PG 18+ implements a PostgreSQL Table Access Method (USING iceberg) wired directly into the Columnar Engine.

  1. Grant roles/storage.objectViewer on the GCS bucket (and roles/biglake.viewer if reading via a bl:// Lakehouse runtime catalog URI in end-user credentials mode) to the cluster service account.
  2. Enable both google_columnar_engine.enabled=on and google_columnar_engine.enable_iceberg_reads=on (requires restart).
  3. As an alloydbsuperuser, declare the table and optionally load it into the columnar store:
CREATE TABLE customer_orders ( order_id BIGINT, customer_id INT, order_status TEXT, total_amount DOUBLE PRECISION, order_date DATE, is_completed BOOLEAN ) USING iceberg WITH ( uri = 'gs://my-iceberg-analytics-bucket/datasets/sales/customer_orders' ); -- Join Iceberg history with live operational heap tables in standard SQL: SELECT c.customer_name, SUM(o.total_amount) AS historical_spend FROM customer_orders o JOIN Source:https://dev.to/gde/inside-alloydb-disaggregated-storage-columnar-engine-and-managed-pooling-5f9o

Related posts