Prove portability before you commit: match production semantics locally with AlloyDB Omni, choose PSA or PSC without peering traps, migrate live with pglogical and Query Plan Management, and keep a tested exit back to stock PostgreSQL.
Series: A five-part, hands-on series (
Engineering with AlloyDB: From Express Prototypes to Exit-Ready PostgreSQL) covering AlloyDB from Express prototyping with MCP Toolbox and ADK, through ScaNN vector search and hybrid RAG, zero-trust autonomous agents, disaggregated storage with the Columnar Engine and managed pooling, and finally exit-ready portability.This is Part 5, the capstone. Across Parts 1 through 4 you moved from a scale-to-zero Express prototype to ScaNN hybrid RAG, secured autonomous agents, and high-concurrency HTAP with disaggregated WAL storage and managed pooling. This closing post tackles the hardest architectural question: how to adopt AlloyDB without trapping your schema, your network, your query plans, or your data inside a one-way door.
The problem: managed speed means nothing if you cannot leave
Adopting a managed cloud database always carries one nagging engineering fear: what happens three years from now if data residency rules shift, multi-cloud mandates arrive, or a workload simply belongs back on self-managed Kubernetes or stock PostgreSQL? Most "PostgreSQL-compatible" cloud databases break portability in four quiet places long before SQL syntax ever differs.
First, development drift: engineers build against vanilla PostgreSQL locally, then discover columnar, vector, or extension behavior diverges in production. Second, network lock-in: a cluster created with Private Services Access (PSA) locks into VPC Network Peering that cannot be changed after creation and fails when consumer organizations share overlapping RFC 1918 CIDRs. Third, cutover blindness: schemas load, row counts match, and then a changed libc collation or flipped query plan degrades p99 latency after DNS flips. Fourth, exit friction: a raw pg_dump full of cloud-specific CREATE EXTENSION statements fails to restore on stock PostgreSQL unless you strip them cleanly.
AlloyDB avoids proprietary wire protocols and storage lock-in by grounding every environment, from an Apple Silicon laptop to Google Cloud to an exit target, on the standard PostgreSQL :5432 contract, pglogical 2.4.8 logical streaming, and portable pg_dump archives.
Be explicit about provenance up front: this post was authored without executing commands against a live Google Cloud AlloyDB cluster. Every CLI flag, database flag, extension version, IAM role, SQL view, and ADK evaluation command below is verified directly against the official AlloyDB, AlloyDB Omni, and Agent Development Kit (ADK) documentation. No cluster timings or fabricated command outputs are invented; schematic SQL and pipeline checks are labeled clearly as documentation-verified patterns to run in your own environment.
What you'll be able to do
By the end of this capstone, structured across all six levels of Bloom's taxonomy, you will be able to:
- Identify (Recall) the four AlloyDB Omni runtime tracks (Debian 12
bookwormand FIPS-ready-ubi9containers, macOS Apple Siliconarm64, Kubernetes Operator1.9.0, and RHEL RPM Orchestrator GA18.3.0) and the shared PostgreSQL:5432portability contract. - Explain (Understand) why Private Services Access (PSA) VPC peering is immutable after cluster creation and restricted to non-overlapping RFC 1918 ranges, whereas Private Service Connect (PSC) isolates multi-org VPCs and uses regional network attachments for outbound CDC.
- Configure (Apply)
pglogical2.4.8 (alloydb.enable_pglogical=on,alloydb.logical_decoding=on),WRITE_ENDPOINTDNS abstractions, cross-regionswitchovervs--failover, Enhanced Backup Vaults, and Query Plan Management (google_plan_management). - Diagnose (Analyze) migration and exit blockers before cutover: non-supported
libccollations versus ICU locales, rejectedshared_preload_librariesedits,pg_restoreEXTENSIONerrors, andWRITE_ENDPOINT/ PSC constraints. - Decide (Evaluate) when to choose PSA versus PSC, Database Migration Service (DMS) versus manual
pglogical, plannedswitchoverversus--failoverorchestration, and livepglogicalstreaming exit versus read-poolpg_dump -F customarchive exit. - Build (Create) an automated Cloud Build verification pipeline combining
gcloud alloydb clusters import --sql(orpg_restore -L clean.tocfor binary.dmparchives), parity checks, Query Plan Management approval/denial gates, andadk conformance/pytestregression gates.
Setup and local reference environment
You can validate the local parity and exit mechanics on a laptop before provisioning cloud infrastructure. You need Docker or Podman (or an Apple Silicon Mac for the native macOS package), standard PostgreSQL client tools (psql, pg_dump, pg_restore), and the gcloud CLI if you target Google Cloud AlloyDB.
# 1. Pull and run AlloyDB Omni container (Debian 12 bookworm or FIPS-ready -ubi9) # Check DockerHub google/alloydbomni/tags for the latest minor tag (e.g., 17.10.0, # 17.10.0-ubi9, or 18.3.0/18.4.0 after requesting PG 18 access via the Omni incentives form) docker run --name alloydb-omni \ -e POSTGRES_PASSWORD=omni_dev_password \ -p 5432:5432 \ -d google/alloydbomni:18.3.0 # 2. Verify standard PostgreSQL wire protocol connectivity on :5432 psql -h 127.0.0.1 -U postgres -c "SELECT version();" For production environments, AlloyDB Omni requires a commercial per-vCPU subscription across all environments (development, testing, staging, and production), while evaluation, proof of concept (PoC), and non-commercial development carry no license charge.
Part A: Four-environment PostgreSQL parity with AlloyDB Omni
True portability starts long before you ever migrate out of a cloud. It starts when your laptop, your on-premises Kubernetes clusters, your bare-metal RHEL VMs, and your managed Google Cloud clusters speak the exact same SQL semantics and wire protocol.
Every environment in the topology shares the PostgreSQL 15 through 18 engine contract on port 5432, ICU and C.UTF-8 collations, and standard pglogical 2.4.8 or pg_dump exit paths.
Look across the four columns in the diagram above. Each column maps to a concrete lifecycle stage:
| Environment | Packaging & Versions | Key Parity Capabilities | Operational Boundary |
|---|---|---|---|
| 1. Dev Workstation | Docker/Podman containers (bookworm & -ubi9), macOS Apple Silicon (arm64) installer | PostgreSQL 15 through 18 core, ScaNN + vector, columnar engine, standard clients (psql, SQLAlchemy, psycopg) | macOS installer is for non-production dev, testing, and AI prototyping only |
| 2. Multi-Cloud / On-Prem | Kubernetes Operator 1.9.0 (EKS, AKS, OpenShift, GKE); RHEL RPM Orchestrator GA 18.3.0 | HA failover, read pools, PgBouncer, External KMS TDE (TdeConfig for HashiCorp Vault & Thales CipherTrust Manager), pgBackRest PITR to S3 or GCS | Operator 1.9.0 supports PG 18.4, 17.10, 16.14, 15.18; RPM Orchestrator runs RHEL 9 / Rocky Linux 9 via Ansible & alloydbctl |
| 3. Google Cloud Managed | AlloyDB for PostgreSQL (PG 15 through 18; PG 18 default for new clusters as of Nov 2026) | Disaggregated intelligent storage, active/standby HA, up to 20 read-pool nodes, pglogical 2.4.8, DMS, Cross-Region DR | System-managed flags (such as shared_preload_libraries) controlled via alloydb.enable_* flags |
| 4. Open-Source Exit | Vanilla PostgreSQL (Linux, K8s, Amazon RDS, Cloud SQL PG) | pglogical 2.4.8 subscriber on :5432, or pg_restore from pg_dump -F custom archive | Application SQL, schemas, and connection drivers stay unchanged once AlloyDB extensions are stripped |
Three concrete engineering details in the Omni stack matter when you plan multi-environment parity:
- FIPS 140-3 without stale CVE lag. On Red Hat Universal Base Image 9 (
-ubi9) container builds, AlloyDB Omni separates the frozen NIST CMVP-validated inner cryptographic boundary (Google BoringCrypto Module forpostgresandpgbackrest, plus RHEL 9 OpenSSL FIPS Provider for base OS utilities) from the outer TLS, X.509, ASN.1, and HTTP/2 protocol layers. When the host OS enables FIPS mode (/proc/sys/crypto/fips_enabled=1), all cryptographic operations route through the validated inner boundary withscram-sha-256and TLS 1.2+, while Google still patches outer-layer CVEs across minor releases without invalidating the inner FIPS certificate. - Operator
1.9.0and External KMS TDE. Released GA on October 13, 2026, Kubernetes Operator1.9.0pairs withDBClusterresource limits for PgBouncer andlogrotate-agent, custompg_hba.confrules viaUserDefinedAuthentication, custom non-cert-manager issuers (such as Venafi), andTdeConfigsupporting both HashiCorp Vault and Thales CipherTrust Manager for Transparent Data Encryption (TDE). Combined withpgBackRestPITR archives targeting Amazon S3, GCS, or S3-compatible object stores, your Kubernetes data plane retains zero Google Cloud dependency. - Non-container enterprise HA via RPM Orchestrator. For regulated VM or bare-metal estates where container runtimes are disallowed, the Red Hat RPM Orchestrator (
18.3.0GA September 8, 2026;18.4.0/ orchestrator1.0.1GA October 14, 2026) installs directly on RHEL 9 or Rocky Linux 9ext4/xfsfilesystems, automating HA failover, read pools, SELinux policies, andpgBackRestbackups through Ansible andalloydbctl.
Predict before you look: Suppose you run AlloyDB Omni containers locally during non-commercial development for free, then promote the exact same Kubernetes Operator 1.9.0 manifests to staging and production. Which environments now require a commercial AlloyDB Omni vCPU subscription?
Answer: All of them. Once you plan for production, Google's licensing policy requires licensing all vCPUs across every environment, including development, testing, staging, and production. Plan your vCPU budget across the entire fleet before crossing into production.
Part B: VPC networking without lock-in: PSA vs PSC
Your network topology is the first decision in AlloyDB that is genuinely hard to undo. Choose wrong at cluster creation, and you lock your application architecture into peering exhaustion or IP collisions.
PSA trades multi-org flexibility for simple single-VPC peering that cannot be changed after cluster creation; PSC eliminates VPC peering and overlapping CIDR conflicts while supporting controlled outbound replication through regional network attachments.
Panel A: Private Services Access (PSA)
PSA establishes a permanent VPC Network Peering link between your consumer VPC (same project or Shared VPC) and the Google-managed producer VPC via servicenetworking.googleapis.com. You allocate a contiguous private CIDR block (minimum /24 per region, /16 recommended so multi-region clusters and other Google Cloud services do not exhaust IP space).
Two hard constraints govern PSA:
- Immutability at creation. Once AlloyDB creates a cluster using PSA, you cannot change its PSA network configuration.
- No transitive peering and no PUPI. PSA supports RFC 1918 ranges only (Privately Used Public IPs are rejected), and transitive VPC peering is blocked. If two business units or acquired companies share
10.10.0.0/16, PSA peering collapses.
Panel B: Private Service Connect (PSC)
PSC replaces VPC peering with a producer/consumer attachment model (--enable-private-service-connect at cluster creation). Every primary instance, read pool instance, and secondary instance publishes a unique Service Attachment URL and a pre-generated pscDnsName. Consumer VPCs (even across separate organizations, overlapping 10.10.0.0/16 CIDRs, or PUPI address spaces) connect via forwarding-rule PSC endpoints created either manually or automatically through a Service Connection Policy. Access is gated by --allowed-psc-projects; unapproved projects remain stuck in PENDING.
For outbound operations from AlloyDB back to your consumer network (such as pglogical migration streams or postgres_fdw), PSC uses a regional Network Attachment in your VPC subnet (which must use RFC 1918 IP space):
# 1. Inspect the AlloyDB service-owned project number (needed for ACCEPT_MANUAL attachments) gcloud alloydb clusters describe CLUSTER_ID \ --region=REGION_ID \ --project=PROJECT_ID # Look for pscConfig.serviceOwnedProjectNumber in the output # 2. Attach an existing regional PSC Network Attachment (ACCEPT_AUTOMATIC or ACCEPT_MANUAL) gcloud alloydb instances update INSTANCE_ID \ --cluster=CLUSTER_ID \ --region=REGION_ID \ --project=PROJECT_ID \ --psc-network-attachment-uri="projects/PROJECT_ID/regions/REGION_ID/networkAttachments/NETWORK_ATTACHMENT_ID" Keep three documented PSC caveats in your architecture notes:
- March 1, 2025 cutoff for outbound PSC. AlloyDB instances created prior to March 1, 2025 cannot be updated in-place to add
--psc-network-attachment-uri; you must either create a cross-region replica with outbound connectivity enabled and perform aswitchover, or backup and restore to a newly created cluster. - Private DNS requirements. Inbound AlloyDB Auth Proxy and Language Connectors require a private Cloud DNS zone mapping
pscDnsNameto the local PSC endpoint IP. Conversely, private DNS resolution is not supported on outbound PSC connections (such aspostgres_fdwordblink). - No
WRITE_ENDPOINTon PSC. AlloyDBWRITE_ENDPOINTDNS abstractions (Preview) support PSA-configured instances only.
Predict before you look: Two teams in separate projects both use 10.10.0.0/16 and need private connectivity to one AlloyDB cluster, plus you want WRITE_ENDPOINT global DNS failover. Can one networking mode give you both?
Answer: No. Overlapping
10.10.0.0/16VPCs require PSC, whereasWRITE_ENDPOINT(Preview) currently supports PSA only. With PSC, applications resolve per-consumerpscDnsNamerecords mapped to their local PSC endpoints instead of a PSAWRITE_ENDPOINT.
Part C: Zero-downtime migration, pre-flight blockers, and QPM cutover
An exit-ready cloud migration treats cutover as reversible until production SLOs hold under real load. That requires passing a pre-flight gate before any WAL bytes move, verifying parity on a read pool before traffic flips, pinning execution plans with Query Plan Management (QPM), and keeping a reverse pglogical stream alive during the soak window.
Cutover is not a cliff edge: Step 1 clears locale and extension blockers, Step 3 verifies parity on a read pool, Step 4 captures and approves execution plans in QPM, and Step 5 keeps a reverse pglogical stream running until the rollback window closes.
Step 1: The pre-flight audit (catch blockers before CDC)
Before configuring DMS or pglogical, check three compatibility boundaries on the source database:
- Locales and collations. AlloyDB supports the full set of ICU locales plus
ucs_basic, and only twolibclocales:C.UTF-8anden_US.utf8. If your source PostgreSQL database defaults to anotherlibclocale (such asen_GB.UTF-8orde_DE.UTF-8), data still imports, butORDER BYsorting semantics can change unless you default the target database toC.UTF-8and assign explicit ICU collations to sorted columns:
-- Inspect available ICU collations on the target AlloyDB cluster SELECT collname FROM pg_collation WHERE collprovider = 'i'; -- Pin explicit ICU collation on ORDER BY-sensitive text columns ALTER TABLE customer_orders ALTER COLUMN customer_name SET DATA TYPE varchar(255) COLLATE "en-US-x-icu"; - System-managed
shared_preload_libraries. In AlloyDB, modifyingshared_preload_librariesdirectly is rejected because the control plane manages preloaded shared libraries automatically. Instead, enable extensions through their correspondingalloydb.enable_*instance flags (for examplealloydb.enable_pglogical,alloydb.enable_pgaudit,alloydb.enable_pg_cron, oralloydb.enable_pg_squeeze). - Supported extensions and decoding plugins. AlloyDB ships
pglogical2.4.8 alongside four logical decoding plugins:pgoutput,wal2json,decoderbufs, andtest-decoding. Only members ofalloydbsuperuser(includingpostgresby default) can runCREATE EXTENSION.
Step 2: DMS quick-start vs manual pglogical 2.4.8
You have two paths for Snapshot + CDC ingestion:
- Database Migration Service (DMS): Handles initial snapshot, continuous CDC, networking, and status tracking for homogeneous sources (self-managed PostgreSQL, Cloud SQL, Amazon RDS, Amazon Aurora) and heterogeneous sources (Oracle/SQL Server with Gemini-powered conversion). In Preview, quick-start migrations automatically provision PSC network attachments, subnets, and connection profiles when the source has a private IP in your VPC. Note one strict IAM rule: required roles (
roles/compute.networkAdminfor the migration user androles/compute.networkViewerforservice-DESTINATION_PROJECT_NUMBER@gcp-sa-datamigration.iam.gserviceaccount.comon the source project;roles/datamigration.adminandroles/alloydb.adminfor the migration user on the destination project) must be granted directly to accounts, because roles inherited via Google Groups are not supported for quick-start migrations. - Self-managed
pglogical2.4.8: Ideal when you want symmetrical, bidirectional control (including Step 5 reverse-sync fallback) across AlloyDB Omni, external VMs, or cross-cloud PostgreSQL. Bothalloydb.enable_pglogicalandalloydb.logical_decodingdefault tooffand require an instance restart when enabled:
# Enable pglogical and logical decoding on the AlloyDB instance (triggers restart) # Note: --database-flags overwrites previously set flags; include all existing flags! gcloud alloydb instances update PRIMARY_INSTANCE_ID \ --cluster=CLUSTER_ID \ --region=REGION_ID \ --project=PROJECT_ID \ --database-flags=alloydb.enable_pglogical=on,alloydb.logical_decoding=on Then enable the extension inside the target database as an alloydbsuperuser member:
\c app_db CREATE EXTENSION IF NOT EXISTS pglogical; -- Verify installed extension version (2.4.8 on AlloyDB) SELECT extname, extversion FROM pg_extension WHERE extname = 'pglogical'; Step 3 and Step 4: Read-pool parity and QPM plan capture
Once CDC catches up, run shadow read queries against an AlloyDB Read Pool (up to 20 nodes per cluster) to compare row counts, checksums, replication lag, and p99 latency without touching primary write I/O.
On PSA clusters, you can decouple application connection strings from instance IPs using a WRITE_ENDPOINT (Preview):
# Create a WRITE_ENDPOINT pointing to the AlloyDB primary instance (PSA only) gcloud beta alloydb endpoints create app-write-ep \ --project=PROJECT_ID \ --region=REGION_ID \ --endpoint-type=WRITE_ENDPOINT \ --target-instances="projects/PROJECT_ID/locations/REGION_ID/clusters/CLUSTER_ID/instances/PRIMARY_INSTANCE_ID" # Retrieve dnsConfig.dnsName (strip the trailing period '.' before passing to psql/apps) gcloud beta alloydb endpoints describe app-write-ep \ --project=PROJECT_ID \ --region=REGION_ID Immediately after cutover, protect against PostgreSQL optimizer plan flips by enabling Query Plan Management (QPM) (Preview). Set google_plan_management.enabled=on (requires restart), create the google_plan_management (1.0) extension, and grant google_plan_management_role:
-- Run on the primary instance (QPM is supported on primary only) CREATE EXTENSION IF NOT EXISTS google_plan_management; GRANT google_plan_management_role TO app_dba; -- Inspect tracked plans and compare average time (total_execution_time / num_executions) SELECT logical_query_id, plan_id, num_executions, total_execution_time / NULLIF(num_executions, 0) AS avg_time, left(query, 80) AS query_prefix FROM google_plan_management.tracked_plans_view ORDER BY total_execution_time DESC LIMIT 20; -- Approve verified plan(s) or deny regressed plan(s) SELECT google_plan_management.approve_plan(15480571796188147798, 4740866759615354783); SELECT * FROM google_plan_management.managed_plans_view; Track QPM's documented boundaries: tracked plans are not enforced until explicitly approved, QPM applies to the primary instance only (not read pools), it cannot be used on partitioned tables or grouping sets, and the repository holds up to 100,000 unique plans with no automatic retention eviction. You can disable steering temporarily without deleting approvals by setting google_plan_management.enable_steer_plans=off.
Step 5: The reverse-sync fallback safety net
Because alloydb.logical_decoding=on and pglogical are active on your new AlloyDB primary, you can run a reverse pglogical subscription from AlloyDB back to the original source PostgreSQL database during your post-cutover soak window. If an unforeseen application SLO regression or unmitigated plan failure hits, you drain writes and repoint DNS back to the warm origin host without losing post-cutover transactions.
Predict before you look: You try to enable pglogical on AlloyDB by passing --database-flags=shared_preload_libraries=pglogical. When that fails, you set --database-flags=alloydb.enable_pglogical=on alone and run CREATE EXTENSION pglogical;. Why does it still fail?
Answer: First,
shared_preload_librariesis system-managed and rejected by AlloyDB. Second,pglogicalrequires bothalloydb.enable_pglogical=onandalloydb.logical_decoding=on(followed by instance restart) beforeCREATE EXTENSION pglogical;succeeds. Also remembergcloud alloydb instances update --database-flagsoverwrites all previous flags unless you repeat them.
Part D: Cross-region disaster recovery and verifiable exit
An exit-ready architecture separates two distinct failure domains: surviving a regional Google Cloud outage (Cross-Region DR + Immutable Backups), and leaving Google Cloud altogether back to vanilla open-source PostgreSQL.
Top lane keeps workloads resilient across Google Cloud regions with planned RPO=0 switchover and --failover orchestration plus immutable Backup Vaults; bottom lane proves you can leave via live pglogical streaming or clean pg_dump archives.
Top lane: Cross-region DR (switchover vs --failover) and Enhanced Backup Vaults
AlloyDB supports up to five asynchronous secondary clusters per primary, each supporting up to 20 read nodes. When you create a secondary cluster (gcloud alloydb clusters create-secondary), AlloyDB copies automated and continuous PITR backup settings (unless --no-enable-automated-backup is passed, or CMEK is used, in which case you must supply a regional Cloud KMS key for the secondary).
Choose the right promotion operation for the event:
- Planned
switchover(GA,RPO=0): Reverses primary and secondary roles with zero data loss and updates all other secondary clusters to follow the new primary. Mandatory rule: stop all write traffic to the primary and confirm lag is0before runningswitchover, or the command can time out waiting on in-flight transactions. Remember to re-enable Advanced Query Insights on the new primary afterward. - Unplanned
promotevs--failoverorchestration (Preview): Standardgcloud alloydb clusters promotedetaches the secondary into a standalone primary. Adding--failover(gcloud beta alloydb clusters promote ... --failover, supported only for single-secondary topologies) promotes the secondary, updatesWRITE_ENDPOINTDNS immediately, and automatically recreates the original primary as a secondary (RECREATINGstate) once its region recovers. To guard against split-brain writes during failover, AlloyDB stops writes on the old primary and captures an automatic system backup so you can restore it to a temporary cluster and reconcile any un-replicated transactions manually.
# Planned zero-data-loss switchover (stop writes first!) gcloud alloydb clusters switchover SECONDARY_CLUSTER_ID \ --region=SECONDARY_REGION \ --project=PROJECT_ID # Unplanned cross-region failover with automatic original-primary recreation (Preview) gcloud beta alloydb clusters promote SECONDARY_CLUSTER_ID \ --region=SECONDARY_REGION \ --project=PROJECT_ID \ --failover For ransomware and accidental-deletion protection, pair cross-region replicas with Enhanced backups (GA via Backup and DR Service). Unlike standard AlloyDB backups, enhanced backups reside in a Backup Vault with enforced retention locks (nobody can delete them before expiry, even administrators) and survive source project deletion:
gcloud backup-dr backup-plan-associations create BPA_ID \ --project=WORKLOAD_PROJECT_ID \ --location=REGION_ID \ --resource-type=alloydb.googleapis.com/Cluster \ --resource="projects/WORKLOAD_PROJECT_ID/locations/REGION_ID/clusters/CLUSTER_ID" \ --backup-plan="projects/VAULT_PROJECT_ID/locations/REGION_ID/backupPlans/BP_ID" Bottom lane: Two independent exit paths to stock PostgreSQL
When you want out of Google Cloud entirely, AlloyDB leaves zero proprietary storage or format barriers:
- Path A: Live
pglogicalstreaming exit. Because AlloyDB runspglogical2.4.8 withalloydb.logical_decoding=on, your AlloyDB primary acts as a standardpglogicalpublisher streaming WAL changes over:5432to a vanilla PostgreSQL subscriber (self-managed Linux, Kubernetes, Amazon RDS, or Cloud SQL). Your application drains writes, verifies LSN sync, and cuts over to the open-source subscriber. - Path B: Read-Pool
pg_dump -F custom+ TOC extension stripping. For cold archive exports or offline exits, runpg_dumpagainst an AlloyDB Read Pool instance to avoid adding I/O pressure to your primary. Before restoring into stock open-source PostgreSQL, strip AlloyDB-specificEXTENSIONlines (such asgoogle_columnar_engine,alloydb_scann,google_ml_integration, orgoogle_plan_management) from the custom archive's Table of Contents (TOC):
# 1. Export from a Read Pool IP in PostgreSQL custom binary format pg_dump -h READ_POOL_IP -U postgres -F custom app_db > app_db.dmp # 2. Generate a clean TOC that comments out EXTENSION statements pg_restore -l app_db.dmp | sed -E 's/(.* EXTENSION )/; \1/g' > clean.toc # 3. Restore cleanly into vanilla PostgreSQL (no AlloyDB extensions required) pg_restore -h VANILLA_PG_HOST -U postgres -d app_db -L clean.toc app_db.dmp If you also export global roles across clusters, remember pg_dumpall --globals-only --no-role-passwords because --globals-only without --no-role-passwords requires privileges unavailable in managed AlloyDB.
Predict before you look: Your team exports app_db.dmp from AlloyDB, runs pg_restore -d app_db app_db.dmp straight onto a fresh community PostgreSQL 18 container, and hits ERROR: extension "google_columnar_engine" is not available. What single command fixes the archive without re-dumping?
Answer: Generate a filtered Table of Contents with
pg_restore -l app_db.dmp | sed -E 's/(.* EXTENSION )/; \1/g' > clean.toc, then pass-L clean.toctopg_restore. If your target stock PostgreSQL still needsvectororpglogical, re-create only those open-source extensions explicitly beforehand.
Part E: Automated CI/CD verification gates with QPM and adk conformance
Portability and migration safety collapse if verification happens manually once at cutover. Every schema migration, dump/restore test, and AI agent release needs an automated staging gate that aborts before production traffic is touched.
Every stage must pass sequentially: data loads deterministically, schema and ICU collations match, QPM guards against query plan regressions, and adk conformance verifies agent SQL behavior against a versioned golden baseline.
Each gate in the pipeline catches a distinct class of migration or schema regression:
- Source Trigger & Staging Load (Gates 1 and 2). A Cloud Build trigger runs on schema pull requests or release tags. For plain
.sqlor compressed.sql.gzartifacts in Cloud Storage (never use Requester Pays buckets, because the AlloyDB Service Agentservice-PROJECT_NUMBER@gcp-sa-alloydb.iam.gserviceaccount.comcannot charge requester projects), load into a staging AlloyDB cluster usinggcloud alloydb clusters import --sql(requiringroles/alloydb.adminor customalloydb.clusters.get+alloydb.clusters.importfor the caller, plusroles/storage.objectViewerfor the AlloyDB Service Agent). For binary custom-format.dmparchives, runpg_restore -L clean.tocfrom a Cloud Build step or staging VM. - Data Parity Gate (Gate 3). Verify row counts, aggregate checksums,
pg_extensionversions, and ICU collations (SELECT collname FROM pg_collation WHERE collprovider = 'i') against expected baseline invariants. - Plan Regression Gate (Gate 4). Run synthetic workload queries against the staging primary with
google_plan_management.enabled=on, inspectgoogle_plan_management.tracked_plans_viewfor newly introduced plans or latency regressions, and fail the build or callgoogle_plan_management.deny_plan(...)if an unapprovedSeq Scanreplaces an approved index scan. - ADK Conformance Gate (Gate 5). If your workload includes SQL-backed AI agents built with the Agent Development Kit (ADK), schema or collation drift can silently break tool calls even when unit tests pass. ADK documents four evaluation paths (
adk webUI,pytestwithAgentEvaluator.evaluatefor fast single-session.test.jsonunit tests,adk evalCLI for multi-turn evalsets, andadk conformancefor regression testing live agents against a recorded golden baseline). Key deterministic criteria require no LLM judge:tool_trajectory_avg_score(default1.0, matchingEXACT,IN_ORDER, orANY_ORDER) andresponse_match_score(default0.8, ROUGE-1).
Here is how those verification gates assemble inside a declarative cloudbuild.yaml pipeline (schematic configuration derived from documented gcloud, QPM SQL, and ADK CLI contracts):
steps: # Gate 2: Deterministic staging load from GCS (.sql or .sql.gz) - name: "gcr.io/google.com/cloudsdktool/cloud-sdk" id: "load-staging-sql" args: - "gcloud" - "alloydb" - "clusters" - "import" - "${_STAGING_CLUSTER}" - "--region=${_REGION}" - "--database=${_DATABASE}" - "--gcs-uri=${_GCS_SQL_URI}" - "--user=postgres" - "--sql" # Gate 3 & Gate 4: Data parity, ICU collation check & QPM plan regression check - name: "postgres:18" id: "parity-and-qpm-gate" entrypoint: "bash" args: - "-c" - | set -euo pipefail psql "${_STAGING_DSN}" -v ON_ERROR_STOP=1 -f ci/checks/verify_parity_and_collations.sql python3 ci/checks/qpm_plan_gate.py --dsn "${_STAGING_DSN}" # Gate 5: ADK unit tests (pytest), CLI evalset gate (adk eval), and golden-baseline conformance check - name: "python:3.12-slim" id: "adk-conformance-gate" entrypoint: "bash" args: - "-c" - | set -euo pipefail pytest tests/agent_sql_unit_tests.py -q adk eval agents/sql_assistant evalsets/golden_baseline.evalset.json \ --config_file_path=evalsets/test_config.json \ --print_detailed_results # Pair with `adk conformance` against recorded golden baseline files before promotion If any step exits non-zero, Cloud Build halts cutover, denies unapproved query plans, and leaves your reverse-sync pglogical fallback untouched.
Predict before you look: Your team notices production agents hitting new edge cases, so someone suggests rotating out passing cases in golden_baseline.evalset.json each sprint to keep CI runtime flat. Why does that break adk conformance?
Answer:
adk conformancecompares live behavior against a fixed golden baseline. If you rewrite or rotate existing cases every sprint, you destroy the fixed comparison point and can no longer tell whether a score drop came from a code/schema regression or a harder test set. Append newly discovered failures as new cases while keeping existing evals byte-identical, and split cadence instead (fast.test.jsonunit checks per commit, full evalsets on staging/nightly runs).
Decision table
| If you see... | Use... | Because... |
|---|---|---|
| Local laptop dev or air-gapped CI needing AlloyDB parity | AlloyDB Omni container (bookworm or -ubi9) or macOS arm64 | Shared PG 15 through 18 core, ScaNN, columnar engine, and :5432 wire contract |
| Multi-cloud Kubernetes estate with enterprise KMS & S3/GCS PITR | AlloyDB Omni Kubernetes Operator 1.9.0 + TdeConfig + pgBackRest | Supports HashiCorp Vault & Thales CipherTrust Manager TDE plus S3/GCS WAL archiving |
| Non-container RHEL 9 / Rocky Linux 9 VMs managed via Ansible | AlloyDB Omni RPM Orchestrator (18.3.0+ GA) | Native OS ext4/xfs storage, alloydbctl, SELinux, HA failover without Docker/K8s |
Simple single-VPC workload needing WRITE_ENDPOINT DNS | Private Services Access (PSA) | Supports WRITE_ENDPOINT (Preview), simpler direct routing inside non-overlapping RFC 1918 |
| Overlapping consumer CIDRs, multi-org VPCs, or PUPI ranges | Private Service Connect (PSC) + Network Attachment | Eliminates peering limits/IP collisions; regional attachment enables outbound pglogical/FDW |
| Homogeneous private-IP migration needing fast setup | DMS Quick-Start Migration (Preview) | Auto...Source:https://dev.to/gde/alloydb-without-lock-in-omni-local-parity-pglogical-migration-and-safe-exit-m88 PreviousYour Changelog Is a Retention Tool, Not a ChoreNextInside AlloyDB: Disaggregated Storage, Columnar Engine, and Managed Pooling Related postsAI Agents Will Replace Half Your Data Engineering Team. The Other Half Just Got a Raise.0dev.to Blocking Malicious npm postinstall Scripts and Slopsquatted Packages Before Install0dev.to ![]() Altana AI: El Grafo Federado de 1.000M USD que Mapea las Cadenas de Suministro Globales0dev.to Sub-2ms Local Search Across 10,000 Notes: SQLite FTS5, WAL Mode, and Encrypted Vault Isolation0dev.to Fragments: December 50Martin Fowler A Coverage Number Is Not Proof0dev.to show = false, 2600)"
x-show="show" x-cloak x-transition.opacity.duration.200ms
class="fixed bottom-8 left-1/2 z-[80] -translate-x-1/2 rounded-lg border border-line bg-card px-4 py-2.5 text-sm text-heading shadow-card-hover"
role="status" aria-live="polite">
|





