Prev Next

Database / AlloyDB Interview questions

Last updated

1. What is AlloyDB for PostgreSQL? 2. What are the main components of an AlloyDB cluster? 3. What is an AlloyDB primary instance? 4. What is a read pool instance in AlloyDB? 5. What is the AlloyDB columnar engine? 6. What is AlloyDB Omni? 7. What is AlloyDB AI? 8. What are the machine types available in AlloyDB? 9. How do you connect to an AlloyDB instance? 10. What is the AlloyDB Auth Proxy? 11. How do you create an AlloyDB cluster using gcloud? 12. What are the backup options in AlloyDB? 13. What is continuous backup and PITR in AlloyDB? 14. What is the AlloyDB index advisor? 15. What is adaptive autovacuum in AlloyDB? 16. What is a secondary cluster in AlloyDB? 17. What is IAM database authentication in AlloyDB? 18. What PostgreSQL extensions does AlloyDB support? 19. What is managed connection pooling in AlloyDB? 20. What is the availability SLA of AlloyDB? 21. What are database flags in AlloyDB? 22. How does AlloyDB's storage architecture differ from standard PostgreSQL? 23. Why doesn't AlloyDB need full-page writes on the primary? 24. Explain the execution flow of a transaction commit in AlloyDB? 25. How does AlloyDB achieve low replica lag on read pool nodes? 26. What is the difference between AlloyDB and Cloud SQL for PostgreSQL? 27. When should you choose AlloyDB over Cloud SQL for PostgreSQL? 28. What is the difference between AlloyDB and Cloud Spanner? 29. How does AlloyDB differ from Amazon Aurora PostgreSQL? 30. How does the columnar engine decide which data to cache? 31. How do you enable the columnar engine and add columns manually? 32. Explain the execution flow of a query on the columnar engine? 33. How do you perform vector similarity search in AlloyDB? 34. How does the ScaNN index work in AlloyDB? 35. How do you generate embeddings inside AlloyDB with SQL? 36. How does AlloyDB provide near-zero downtime maintenance? 37. What happens when the primary instance fails in AlloyDB? 38. How does cross-region replication and failover work in AlloyDB? 39. How do you migrate a PostgreSQL database to AlloyDB with Database Migration Service? 40. How do you restore an AlloyDB cluster to a point in time? 41. How do you troubleshoot slow queries in AlloyDB? 42. How can you optimize read-heavy workloads in AlloyDB? 43. How do you secure an AlloyDB cluster? 44. How do compute and storage scale independently in AlloyDB? 45. When would you choose AlloyDB Omni over AlloyDB on Google Cloud? 46. How can you optimize cost in AlloyDB? 47. How do you troubleshoot connection exhaustion in AlloyDB? 48. How does AlloyDB integrate with BigQuery for analytics? 49. Why is AlloyDB suitable for HTAP workloads? 50. How do you monitor an AlloyDB instance?

1. What is AlloyDB for PostgreSQL?

AlloyDB for PostgreSQL is a fully managed, PostgreSQL-compatible database service on Google Cloud, built for demanding transactional, analytical and AI workloads. It runs the standard PostgreSQL engine and wire protocol, so existing drivers, ORMs and most extensions keep working.

The difference is underneath. Compute and storage are separated, and a log-based, auto-scaling storage layer replaces the local disk that stock PostgreSQL relies on.

  • Fully PostgreSQL-compatible, so migration usually needs no code changes
  • Disaggregated compute and storage, with storage that grows automatically
  • Built-in columnar engine for analytics on live data
  • 99.99% availability SLA, maintenance included, for HA configurations
  • Google quotes up to 4x faster transactions and up to 100x faster analytics than standard PostgreSQL (vendor figures, so benchmark your own workload)
Take quiz
AlloyDB for PostgreSQL is best described as:
a NoSQL document store exposing a MongoDB API
a globally sharded database with its own SQL dialect
a PostgreSQL fork you can only install on-premises
a managed PostgreSQL-compatible database with separated compute and storage
What lets an existing PostgreSQL app move to AlloyDB with few changes?
PostgreSQL engine and wire-protocol compatibility
a forced redesign into column families
a proprietary AlloyDB-only client driver
an automatic converter for Oracle PL/SQL

2. What are the main components of an AlloyDB cluster?

An AlloyDB cluster is the top-level container for everything that belongs to one database deployment. It lives in a single region and attaches to one VPC network.

Component Role
Primary instance The one read/write node, optionally with a standby in another zone
Read pool instance A load-balanced group of read-only nodes (1 to 20)
Storage layer Shared, regional, log-based storage that grows automatically
Backups Automated, on-demand and continuous (PITR)
Secondary cluster Optional read-only cluster in another region for DR

Instances are the compute; the storage layer is shared by all of them, which is why you never size a disk per node.

Take quiz
Which resource accepts writes in an AlloyDB cluster?
the secondary cluster during normal operation
the primary instance
any node in the read pool
the storage layer directly
Where does the data of a cluster physically live?
inside each individual backup
on a local disk attached to each read pool node
in a shared regional storage layer used by all its instances
on a per-instance persistent disk you size by hand

3. What is an AlloyDB primary instance?

The primary instance is the single read/write node of a cluster. Every INSERT, UPDATE, DELETE and DDL statement goes through it, and it can also serve reads.

With regional availability (HA) enabled, AlloyDB keeps a standby in a different zone of the same region. The standby does not serve traffic; it takes over if the primary fails. Since both attach to the same shared storage, failover does not copy any data.

You pick the vCPU count when you create it (memory is sized in proportion, mostly 8 GB per vCPU) and can resize later, which briefly interrupts connections. Database flags are also set per instance.

Take quiz
How many read/write primary instances can one AlloyDB cluster have?
up to 20, like a read pool
as many as the vCPU count
one per zone
exactly one
What does the HA standby do during normal operation?
waits in another zone and takes over if the primary fails
accepts writes for a different set of tables
holds the only copy of the data
serves load-balanced reads for applications

4. What is a read pool instance in AlloyDB?

A read pool instance is a group of identical read-only nodes that sit behind one connection endpoint. AlloyDB load-balances incoming connections across the nodes, and a pool can have anywhere from 1 to 20 of them.

All nodes read from the same shared storage as the primary, so adding a node does not mean copying the dataset. That is why scaling a pool out takes minutes rather than hours.

Typical uses are dashboards, reporting and read-heavy APIs. Remember that a node can lag the primary by a few milliseconds, so reads that must see a just-committed write belong on the primary.

Take quiz
What is a read pool typically used for?
storing continuous backups
scaling out read-only queries behind a single endpoint
replicating data to another region
running DDL migrations safely
Why can a new read pool node be added without copying the dataset?
it opens a logical replication slot on the primary
it restores from last night's backup
every node attaches to the same shared storage layer
it replicates only the hot tables

5. What is the AlloyDB columnar engine?

The columnar engine is an in-memory, column-oriented cache inside an AlloyDB instance. It speeds up scans, aggregates and joins on the same tables you use for transactions, with no ETL and no second system.

The row store stays the source of truth. The columnar copy is kept consistent in memory, and the PostgreSQL planner decides per query whether a vectorized columnar scan is cheaper than a normal row scan.

  • Good fit: aggregates over many rows of a few columns in wide tables
  • Poor fit: primary-key lookups and single-row writes
  • Columns can be added manually or picked automatically from the workload

Google cites up to 100x faster analytical queries, which depends heavily on the query shape.

Take quiz
Where does the columnar engine keep its column-oriented data?
as Parquet files in Cloud Storage
in a dedicated analytics cluster
in a separate BigQuery dataset
in memory on the instance, next to the row store
Which query benefits most from the columnar engine?
an aggregate over millions of rows touching a few columns
a single-row INSERT
a primary-key lookup returning one row
a TRUNCATE on a tiny table

6. What is AlloyDB Omni?

AlloyDB Omni is a downloadable edition of AlloyDB that you run yourself: on a laptop, in your data center, or on another cloud. It ships as a container and also has a Kubernetes operator.

It keeps the PostgreSQL compatibility and the performance features that live in the database engine, such as the columnar engine, index advisor and vector search. What it does not include is Google's managed, log-based regional storage layer; Omni uses local or attached storage.

Common uses are development and testing, edge sites, data-residency requirements and staging a migration. Developer use is free, while production use needs a paid license.

Take quiz
Where can AlloyDB Omni run?
only as a BigQuery add-on
anywhere you can run a container, including on-premises and other clouds
only inside Google Cloud regions
only in Cloud Shell
What does Omni lack compared with AlloyDB on Google Cloud?
the columnar engine
standard SQL support
the managed, log-based regional storage layer
PostgreSQL compatibility

7. What is AlloyDB AI?

AlloyDB AI is the set of features that let you build generative-AI and semantic-search apps directly on your operational data.

  • pgvector support for storing embeddings and querying by similarity
  • ScaNN index, Google's approximate nearest-neighbor index, for fast vector search at scale
  • google_ml_integration extension to call embedding and prediction models (such as Vertex AI) from SQL
  • Natural-language querying features that translate questions into SQL

The pitch is that embeddings live next to the rows they describe, so filtering by price or tenant and ranking by similarity happen in one SQL statement.

Take quiz
Which extension lets AlloyDB call embedding models from SQL?
pg_stat_statements
pg_trgm
postgis
google_ml_integration
Which vector index type is Google's own in AlloyDB?
ScaNN
GiST on tsvector
Hash
BRIN

8. What are the machine types available in AlloyDB?

AlloyDB instances are sized by vCPU count, from small 2-vCPU shapes for development up to 128 vCPUs for large production primaries. Memory scales with vCPUs, mostly at 8 GB per vCPU, so a 16-vCPU instance has 128 GB.

Primary and read pool nodes can use different sizes, so you might run a large primary and several smaller read nodes. Always check the current docs for the exact list, since new shapes are added over time.

There is no storage size to pick: storage is a separate, automatically scaling layer.

Take quiz
How much memory does a 16-vCPU AlloyDB instance have?
32 GB
128 GB
256 GB
64 GB
What do you NOT have to provision up front in AlloyDB?
the region of the cluster
vCPU count for the primary
storage capacity, because it grows automatically
the VPC network

9. How do you connect to an AlloyDB instance?

Instances get a private IP inside your VPC through private services access or Private Service Connect, so clients in that network can connect with any PostgreSQL driver.

From outside the VPC, or for IAM-authorized encrypted connections, use the AlloyDB Auth Proxy or one of the language connectors (Java, Python, Go). A public IP is possible but optional. Pick the proxy when you want encryption and IAM checks handled for you, and plain private-IP connections when the app already runs inside the VPC.

./alloydb-auth-proxy \
  "projects/my-proj/locations/us-central1/clusters/my-cluster/instances/my-primary" \
  --port 5432

psql "host=127.0.0.1 port=5432 user=postgres dbname=postgres"

Take quiz
Which tool gives IAM-authorized mTLS connections without IP allowlists?
a pgBouncer sidecar
Cloud Armor
Cloud NAT
AlloyDB Auth Proxy
How does an AlloyDB instance get its address by default?
a private IP in your VPC
a Cloud Run URL
a public IP open to the internet
a regional external load balancer

10. What is the AlloyDB Auth Proxy?

The AlloyDB Auth Proxy is a small client-side binary that opens a secure tunnel from your app to an instance. It handles TLS 1.3 encryption, mutual authentication and certificate rotation, and authorizes the connection using IAM.

Your application then connects to 127.0.0.1 as if the database were local, so no IP allowlists are needed. It runs as a local process, a Docker container or a Kubernetes sidecar.

The identity running the proxy needs the AlloyDB Client role (roles/alloydb.client), plus permission to use the service API.

Take quiz
Which IAM role does the identity running the Auth Proxy typically need?
Billing Account Viewer
AlloyDB Client (roles/alloydb.client)
Storage Admin
Compute Instance Admin
What does the Auth Proxy handle for you?
running schema migrations
creating indexes
TLS encryption and certificates with IAM-based authorization
caching query results

11. How do you create an AlloyDB cluster using gcloud?

First enable the AlloyDB API and set up private services access on your VPC. Then create the cluster, and after that its primary instance. A cluster without an instance holds no compute.

gcloud services enable alloydb.googleapis.com

gcloud alloydb clusters create my-cluster \
  --region=us-central1 --network=default --password=CHANGE_ME

gcloud alloydb instances create my-primary \
  --cluster=my-cluster --region=us-central1 \
  --instance-type=PRIMARY --cpu-count=4

Add --availability-type=REGIONAL for an HA primary with a standby in another zone. Instance creation takes several minutes, and you can then connect, create databases and set flags like any PostgreSQL server.

Take quiz
Which gcloud flag makes an instance the read/write primary?
--role=WRITER
--mode=read-write
--primary=true
--instance-type=PRIMARY
What must be configured on the VPC before creating a cluster on a private network?
private services access
a Compute Engine VM running PostgreSQL
a Pub/Sub topic for replication
a Cloud Storage bucket for WAL

12. What are the backup options in AlloyDB?

AlloyDB offers three kinds of backup, and they work together.

Type How it runs Kept for
Automated On a schedule you set Retention window you configure
On-demand Triggered manually Until you delete it
Continuous Always on, WAL streamed to storage Recovery window of 1 to 35 days

Backups are taken from the storage layer, so they do not burn instance CPU. Any backup restores into a new cluster, never over the existing one, and you can protect backups with customer-managed encryption keys (CMEK).

Take quiz
Which backup type is kept until you delete it?
an automated scheduled backup
an on-demand backup
a standby snapshot
the continuous backup recovery window
Where do AlloyDB backups read their data from?
a pg_dump run on the primary
a VM snapshot of each instance
the storage layer, without using instance CPU
a read pool node's local disk

13. What is continuous backup and PITR in AlloyDB?

Continuous backup keeps a rolling stream of WAL in the storage layer, which makes point-in-time recovery (PITR) possible: you can restore to any second inside the recovery window.

The window defaults to 14 days and can be set up to 35. Restoring never rewinds the live cluster. It creates a new cluster as of the timestamp you pick, so you can inspect data, copy back a dropped table, or promote the clone.

This is the safety net for human mistakes such as an accidental DELETE without a WHERE clause.

Take quiz
Restoring to a point in time in AlloyDB produces:
a frozen read pool node
only a logical dump file
an in-place rollback of the existing cluster
a new cluster as of the chosen timestamp
What is the maximum continuous backup recovery window?
35 days
24 hours
90 days
7 days

14. What is the AlloyDB index advisor?

The index advisor watches your query workload and suggests indexes that would speed it up. It evaluates candidate indexes with the planner's cost estimates, then reports the CREATE INDEX statements along with the estimated benefit.

It only recommends. Nothing is built automatically, so you review each suggestion, weigh the write overhead and storage cost of the new index, and create it yourself.

It works best after a representative amount of traffic has run, because it learns from real queries instead of the schema alone.

Take quiz
What does the index advisor produce?
vacuum thresholds
recommended CREATE INDEX statements based on workload analysis
backup schedules
new machine size suggestions
Does the index advisor create indexes on its own?
yes, silently at midnight
yes, but only on read pool nodes
no, it surfaces recommendations you review and apply
only on primary key columns

15. What is adaptive autovacuum in AlloyDB?

Adaptive autovacuum tunes PostgreSQL's vacuuming automatically. Stock autovacuum uses fixed thresholds that suit some tables and starve others. AlloyDB watches each table's activity and adjusts how aggressively and how often it vacuums.

The payoff is less table and index bloat, fresher planner statistics and fewer midnight surprises on busy tables, without hand-tuning per-table settings.

It is on by default, but you can still override autovacuum parameters on an individual table when you know better. Tables with heavy UPDATE or DELETE traffic, such as queues and session stores, tend to benefit the most.

Take quiz
What problem does adaptive autovacuum mainly reduce?
TLS handshake latency
network egress cost
cross-zone replication lag
table bloat from poorly tuned vacuum thresholds
How does it differ from stock autovacuum?
it adjusts vacuum behavior per table based on observed workload
it needs a manual cron schedule
it runs only on weekends
it vacuums only system catalogs

16. What is a secondary cluster in AlloyDB?

A secondary cluster is a read-only AlloyDB cluster in a different region that is fed by asynchronous replication from your primary cluster. It has its own instance and its own storage.

It serves two jobs: a disaster-recovery target if the primary region fails, and a source of low-latency reads for users near that region.

You can run a planned switchover to swap roles, or promote the secondary after an outage, which turns it into a standalone cluster. Because replication is asynchronous, a promote can lose the last few seconds of writes.

Take quiz
Replication to a secondary cluster is:
synchronous across regions
asynchronous
manual via pg_dump
logical, one table at a time
What can a secondary cluster do in normal operation?
run DDL independently
accept writes alongside the primary
serve read-only queries and act as a DR target
hold only the WAL archive

17. What is IAM database authentication in AlloyDB?

IAM database authentication lets people and service accounts log in with their Google identity instead of a stored database password. The client sends a short-lived OAuth 2.0 access token as the password.

Turn it on with the alloydb.iam_authentication flag, create an IAM user in the database, and grant the AlloyDB Database User role. TLS is required.

export PGPASSWORD=$(gcloud auth print-access-token)
psql "host=10.0.0.5 user=alice@example.com dbname=appdb sslmode=require"

The upside is central access control and no passwords to rotate. The token expires after about an hour, so long-lived apps need to refresh it.

Take quiz
Which flag turns on IAM database authentication?
google_iam.auth
iam.enable_login
password_encryption=iam
alloydb.iam_authentication
What is used as the password for an IAM database user?
a short-lived OAuth 2.0 access token
the cluster's postgres password
a static API key in pg_authid
the user's Google account password

18. What PostgreSQL extensions does AlloyDB support?

AlloyDB supports a curated list of popular PostgreSQL extensions plus a few of its own.

Extension Purpose
vector pgvector types and similarity operators
postgis Spatial data and queries
pg_stat_statements Per-query performance statistics
pg_trgm Fuzzy text matching
google_columnar_engine Columnar engine management
google_ml_integration Embeddings and model calls from SQL

SELECT name, default_version FROM pg_available_extensions ORDER BY name;
CREATE EXTENSION IF NOT EXISTS vector;

Not every community extension is allowed, so verify the one you need before you plan a migration.

Take quiz
Which command enables pgvector in a database?
INSTALL EXTENSION vector;
CREATE EXTENSION vector;
ALTER SYSTEM SET vector = on;
CREATE EXTENSION pgvector;
Which view lists the extensions available to install?
information_schema.extensions
pg_installed_modules
pg_available_extensions
pg_extension_catalog

19. What is managed connection pooling in AlloyDB?

Managed connection pooling is a built-in, PgBouncer-based pooler that runs next to the instance. Clients connect to it (port 6432) instead of directly to PostgreSQL on 5432, and it multiplexes many client connections onto a small set of backend processes.

PostgreSQL spawns one process per connection, which gets expensive at a few thousand clients. Pooling cuts memory use and connection-setup latency, and it is a lifesaver for serverless apps that open connections in bursts.

You enable it per instance, so there is no pooler VM to patch. Keep in mind that transaction-mode pooling does not preserve session state such as temp tables or session-level advisory locks.

Take quiz
Which port does the managed connection pooler listen on?
3306
5432
1433
6432
What problem does connection pooling solve?
many client connections consuming backend processes and memory
slow index builds
WAL archiving delays
cross-region replication gaps

20. What is the availability SLA of AlloyDB?

AlloyDB offers a 99.99% monthly uptime SLA, and unlike many managed databases it includes maintenance in that figure. That works out to under five minutes of allowed downtime in a 30-day month.

The SLA applies to primary instances configured for regional availability, meaning a standby exists in another zone to take over. A zonal primary without a standby does not get the same guarantee.

Always read the current SLA text for the exact definitions and credit tiers. Read pool nodes add read capacity but are not what the SLA is measured on, so size the HA primary first.

Take quiz
Which setup is covered by the 99.99% SLA?
a zonal primary with no standby
a primary with regional (HA) availability
a promoted secondary with no instances
a single read pool node on its own
How does the AlloyDB SLA treat maintenance?
only deferred maintenance is excluded
maintenance is excluded entirely
maintenance downtime is included in the uptime figure
only minor version updates are excluded

21. What are database flags in AlloyDB?

Database flags are how you change PostgreSQL parameters and AlloyDB-specific settings on a managed instance, since you cannot edit postgresql.conf directly. They are set per instance through the console, gcloud or the API.

Examples include work_mem, max_connections, alloydb.iam_authentication and google_columnar_engine.enabled. Some flags apply immediately; others trigger an instance restart, and the console tells you which.

gcloud alloydb instances update my-primary \
  --cluster=my-cluster --region=us-central1 \
  --database-flags=google_columnar_engine.enabled=on

Only a supported list of flags is exposed, so a parameter missing from the docs cannot be changed.

Take quiz
Which flag enables the columnar engine?
alloydb.columnar=on
enable_columnar_scan
columnar_store.enable
google_columnar_engine.enabled
How are database flags applied in AlloyDB?
per instance via console, gcloud or API, and some need a restart
by editing postgresql.conf over SSH
by editing pg_hba.conf directly
cluster-wide only, never per instance

22. How does AlloyDB's storage architecture differ from standard PostgreSQL?

In standard PostgreSQL, each server owns its data files on a local or attached disk. The primary writes WAL, a checkpointer and background writer flush dirty pages to those files, and every replica keeps its own full copy fed by streaming replication.

AlloyDB splits this up. The compute node sends only WAL records to a regional, replicated log store. Log processing servers then turn that log into data blocks, and any instance can read the blocks it needs from the shared layer.

flowchart LR
A["Primary instance (compute)"] -- "WAL records" --> B["Regional log storage"]
B --> C["Log processing servers"]
C --> D["Block storage (materialized pages)"]
D -- "page reads" --> A
D -- "page reads" --> E["Read pool nodes"]
Aspect Standard PostgreSQL AlloyDB
Data pages Flushed by checkpointer to local disk Materialized by the storage layer from WAL
Replicas Own copy via streaming replication Share the same storage
Storage growth Provision and resize disks Automatic
Backups Snapshots or base backups Continuous, inside the storage layer

Take quiz
In AlloyDB, which component turns WAL into data blocks?
each read pool node's background writer
the log processing servers in the storage layer
the checkpointer on the primary
the Auth Proxy
What does the AlloyDB primary send to storage when data changes?
logical row diffs for each replica
full 8 KB data pages
WAL records
pg_dump snapshots

23. Why doesn't AlloyDB need full-page writes on the primary?

Stock PostgreSQL writes dirty pages to data files during checkpoints. Because an 8 KB page can be only half-written if the machine crashes, it also logs a full-page image the first time a page changes after each checkpoint. Both add a lot of I/O.

In AlloyDB the compute node never writes data pages at all. The storage layer owns them and rebuilds each page from the WAL stream, so there is no torn page to protect against and no checkpoint flood of dirty buffers.

Two practical results: write amplification drops, and crash recovery is quicker because there is no long replay from the last checkpoint. The instance can simply re-attach to storage that is already up to date.

The trade-off is that you lose the ability to tune checkpoint_timeout style settings the old way, because they no longer drive durability.

Take quiz
Why are full-page images unnecessary on the AlloyDB primary?
data is held only in memory
WAL is disabled entirely
replicas rewrite pages synchronously
the storage layer rebuilds pages from WAL, so the compute node never writes torn pages
Which stock PostgreSQL work does the AlloyDB primary avoid?
flushing dirty buffers to data files at checkpoints
serving read queries
parsing SQL
writing WAL

24. Explain the execution flow of a transaction commit in AlloyDB?

When a client issues COMMIT, the primary writes the transaction's WAL records to the regional log storage. That store replicates them across zones, and only when they are durable does the primary acknowledge the commit.

Block creation happens afterwards and off the critical path: log processing servers apply the log to produce data pages. Read pool nodes are told about the changes so their caches stay current.

sequenceDiagram
participant App
participant Primary
participant Log as Log storage
participant LPS as Log processors
participant RP as Read pool
App->>Primary: COMMIT
Primary->>Log: Write WAL records
Log-->>Primary: Durable across zones
Primary-->>App: Commit acknowledged
Log->>LPS: Apply log asynchronously
LPS->>LPS: Materialize data blocks
Primary->>RP: Cache update notification

This ordering explains the performance profile: commit latency depends on the log write, not on any page flush.

Take quiz
When does AlloyDB acknowledge a commit?
after the next checkpoint finishes
after the WAL records are durably written to log storage
after every read pool node confirms
after the data block is materialized
How are data blocks produced after a commit?
synchronously on the client connection before COMMIT returns
by the application through a flush call
asynchronously by the storage layer
they are never produced, WAL is the only copy

25. How does AlloyDB achieve low replica lag on read pool nodes?

In classic streaming replication each replica receives WAL, replays it page by page on its own disk, and falls behind when replay cannot keep up. AlloyDB read pool nodes avoid that because they share the same storage layer as the primary.

A read node does not store or replay a private copy of the data. It mainly needs to invalidate and refresh what it has cached in memory, then fetch current pages from storage on demand. Lag is usually in the single-digit milliseconds, though it varies with load.

It is still asynchronous, so there is no read-your-writes guarantee on a read node. Send reads that must see a just-committed change to the primary, and watch the replica lag metric in Cloud Monitoring.

Take quiz
Why is replica lag low on AlloyDB read pools?
all reads are secretly routed to the primary
replication is synchronous across all regions
each node holds a full copy updated by logical replication
nodes share the same storage and mostly refresh cached pages
Is read-your-writes guaranteed on a read pool right after a commit?
no, a node may lag slightly, so critical reads go to the primary
yes, if you use SERIALIZABLE
only after restarting the node
yes, always instantly

26. What is the difference between AlloyDB and Cloud SQL for PostgreSQL?

Both are managed PostgreSQL on Google Cloud. Cloud SQL runs standard PostgreSQL on a persistent disk attached to the instance. AlloyDB re-architects the storage and adds engine-level features.

Aspect AlloyDB Cloud SQL for PostgreSQL
Storage Disaggregated, log-based, automatic growth Disk attached to the instance
Read replicas Read pool sharing one storage layer Replicas with their own disk, streaming replication
Analytics Built-in columnar engine No built-in equivalent
Vector search pgvector plus ScaNN index pgvector
Portability AlloyDB Omni for on-prem and other clouds Cloud only
Cost profile Higher unit cost, higher ceiling Cheaper for small and medium workloads

Both keep full PostgreSQL compatibility, so moving between them is mostly an operations decision, not a rewrite.

Take quiz
Which feature exists in AlloyDB but not in Cloud SQL for PostgreSQL?
the PostgreSQL wire protocol
the built-in columnar engine
private IP connectivity
automated backups
How do Cloud SQL read replicas store their data?
they share one log-based storage layer
as objects in Cloud Storage
each has its own disk fed by streaming replication
in a columnar in-memory store only

27. When should you choose AlloyDB over Cloud SQL for PostgreSQL?

Pick AlloyDB when Cloud SQL's ceiling starts to hurt, and keep Cloud SQL when it does not. AlloyDB earns its higher price in these situations:

  • High-throughput OLTP where write latency and recovery time matter
  • Mixed workloads, with heavy reporting on the same live tables as transactions
  • Many read replicas needed, with minimal lag and quick scale-out
  • AI features that need ScaNN-backed vector search near the data
  • A 99.99% SLA including maintenance, or a need to run the same engine on-prem with Omni

Stay on Cloud SQL for small or medium applications, internal tools, dev and test, or any case where budget matters more than peak performance. Because both are PostgreSQL, you can start on Cloud SQL and migrate later with DMS.

Take quiz
Which scenario favors AlloyDB over Cloud SQL?
a dev sandbox used one night a week
a tiny internal wiki with five users
an app that needs MySQL syntax
high-throughput OLTP with heavy reporting on the same data
When is Cloud SQL the more sensible choice?
a small or medium workload where cost matters more than peak performance
a design needing minimal-lag read scale-out
analytics that need an in-memory columnar store
hundreds of millions of vector embeddings

28. What is the difference between AlloyDB and Cloud Spanner?

They solve different scaling problems. AlloyDB is PostgreSQL with one write primary that scales up, plus read pools that scale reads out. Spanner is a horizontally scalable, globally distributed database that spreads writes across many nodes.

Aspect AlloyDB Cloud Spanner
Engine PostgreSQL-compatible Spanner engine, with GoogleSQL and a PostgreSQL interface
Write scaling Vertical, single primary Horizontal, automatic sharding
Multi-region Async secondary clusters Synchronous replication with external consistency
Migration effort Low for PostgreSQL apps Higher, schema and query changes common
Typical cost Lower Higher

If your app is a PostgreSQL app with one write region, AlloyDB is usually the simpler choice. If you need write scale beyond one machine or strongly consistent multi-region writes, look at Spanner.

Take quiz
Which database scales write throughput horizontally across nodes?
AlloyDB, by adding read pool nodes
Cloud Spanner
AlloyDB Omni, by adding containers
Cloud SQL, by adding replicas
Which is the natural fit for an existing PostgreSQL app with a single write region?
Spanner, because it is plain PostgreSQL
Memorystore
AlloyDB
Cloud Bigtable

29. How does AlloyDB differ from Amazon Aurora PostgreSQL?

Architecturally they are cousins: both separate compute from a log-based, replicated storage layer and both stay PostgreSQL-compatible. The differences show up in features and ecosystem.

Aspect AlloyDB Aurora PostgreSQL
Cloud Google Cloud (plus Omni anywhere) AWS only
Analytics acceleration Built-in in-memory columnar engine Relies on other services such as Redshift zero-ETL
Vector search pgvector and ScaNN pgvector
Self-hosted edition AlloyDB Omni None
Serverless scaling Resize by instance Aurora Serverless v2

Both vendors publish price-performance claims that favor themselves, so run your own workload before deciding. For most teams the real driver is which cloud the rest of the stack already lives on.

Take quiz
What do AlloyDB and Aurora PostgreSQL have in common?
both run only on Google Cloud
both are columnar-only warehouses
both require schema rewrites
compute separated from a log-based, replicated storage layer
Which differentiator does AlloyDB have over Aurora?
a built-in columnar engine and a downloadable Omni edition
managed read replicas
automated backups
multi-AZ availability

30. How does the columnar engine decide which data to cache?

There are two paths. You can add columns manually, or you can let auto columnarization pick them. With auto mode on, the engine periodically analyzes the workload, estimates which tables and columns would gain from columnar scans, and loads them within the memory budget.

The budget is the memory reserved for the columnar store, set by a flag. When it fills up, candidates compete, so wide tables you scan rarely will not push out the ones driving your dashboards.

  • The recommendation tool shows what it would cache and the expected benefit
  • Manual choices are best for a few known, critical reporting tables
  • Low-selectivity scans and aggregates score highest; point lookups score near zero
Take quiz
What is auto columnarization?
compressing WAL files
periodic selection of tables and columns to cache based on the observed workload
converting the whole database to a columnar on-disk format
rewriting queries into BigQuery SQL
What limits how much data the columnar store can hold?
the SSL certificate size
the number of read pool nodes
the memory reserved for it
the backup retention window

31. How do you enable the columnar engine and add columns manually?

Enabling takes two steps: set the instance flags (a restart may be needed), then tell the engine which columns to load.

-- Instance flags (console or gcloud):
--   google_columnar_engine.enabled = on
--   google_columnar_engine.memory_size_in_mb = 2048

-- Load the columns your reports use:
SELECT google_columnar_engine_add('public.orders', 'order_date, region, amount');

-- Check what is loaded:
SELECT * FROM g_columnar_columns;

-- Confirm a query uses it:
EXPLAIN SELECT region, sum(amount) FROM orders GROUP BY region;

In the plan, look for a columnar scan node. If you still see a Seq Scan, the columns are not loaded, memory is too small, or the planner judged the row scan cheaper.

Take quiz
Which function adds columns to the columnar store manually?
pg_prewarm_columns
alloydb_columnar_load
columnar_refresh_all
google_columnar_engine_add
How do you confirm a query used the columnar engine?
look for a columnar scan node in the EXPLAIN plan
query pg_hba.conf
check that WAL size grew
look for a Bitmap Heap Scan

32. Explain the execution flow of a query on the columnar engine?

The columnar engine is invisible to the application. The query goes through the usual PostgreSQL parser and planner, and the planner adds a columnar scan as one more path.

  1. The planner checks whether the needed columns of the table are loaded in the columnar store.
  2. It compares the cost of a columnar scan against row-store options such as a seq scan or index scan.
  3. If columnar wins, a vectorized scan processes batches of column values and applies filters and aggregates.
  4. Recent changes not yet reflected in the columnar copy are reconciled, so results match the row store.
  5. If columns are not loaded, the query runs normally on the row store.
flowchart TD
Q["SQL query"] --> PL["Planner"]
PL --> D{"Needed columns loaded?"}
D -- "Yes, and cheaper" --> CS["Vectorized columnar scan"]
D -- "No, or row scan cheaper" --> RS["Row store scan or index"]
CS --> R["Result"]
RS --> R

Since the row store remains the source of truth, a missed cache costs speed but never correctness.

Take quiz
Who decides whether a query uses the columnar scan?
the application, via a request header
the PostgreSQL planner using cost estimates
the Auth Proxy
a cron job at query time
What happens if needed columns are not in the columnar store?
it waits until the columns load
it is redirected to BigQuery
the query runs normally against the row store
it fails with an error

33. How do you perform vector similarity search in AlloyDB?

Use the pgvector extension: store embeddings in a vector column and order by a distance operator. Add an index so the search is approximate instead of scanning every row.

CREATE EXTENSION IF NOT EXISTS vector;

CREATE TABLE docs (
  id bigserial PRIMARY KEY,
  body text,
  embedding vector(768)
);

SELECT id, body
FROM docs
ORDER BY embedding <=> '[0.12, 0.03, ...]'
LIMIT 5;

Operator Distance
<-> Euclidean (L2)
<=> Cosine
<#> Negative inner product

For indexes you can use pgvector's HNSW or IVFFlat, or AlloyDB's own ScaNN index for larger datasets. You can also add normal WHERE filters, such as a tenant id, in the same query.

Take quiz
Which pgvector operator computes cosine distance?
@@
<#>
<->
<=>
What does the vector(768) column type declare?
a column of 768-dimensional embeddings
a 768 MB size limit
a 768-bit hash
a maximum of 768 rows

34. How does the ScaNN index work in AlloyDB?

ScaNN is Google's approximate nearest-neighbor algorithm, and AlloyDB offers it as an index type compatible with pgvector. It combines two ideas: tree-style partitioning and vector quantization.

  1. Vectors are grouped into partitions (called leaves) around learned centers.
  2. At query time only the closest leaves are searched, not the whole table.
  3. Stored vectors are compressed (quantized), so scanning candidates is fast and memory-light.
  4. The best candidates are re-scored for accuracy before returning.
CREATE EXTENSION IF NOT EXISTS alloydb_scann;
CREATE INDEX docs_scann ON docs
  USING scann (embedding cosine) WITH (num_leaves = 1000);

SET scann.num_leaves_to_search = 20;

More leaves searched means better recall and slower queries. Google reports faster index builds and a smaller footprint than HNSW, but tune num_leaves on your own data.

Take quiz
Which parameter sets the number of partitions in a ScaNN index?
lists
num_leaves
m
ef_construction
What does quantization do in ScaNN?
removes duplicate rows
encrypts the vectors
compresses vectors so candidate scans are faster and use less memory
converts vectors to text

35. How do you generate embeddings inside AlloyDB with SQL?

Install the google_ml_integration extension and call embedding(), which sends the text to a model such as a Vertex AI embedding model and returns the vector.

CREATE EXTENSION IF NOT EXISTS google_ml_integration;

SELECT embedding('text-embedding-005', 'refund policy for annual plans');

UPDATE products
SET embedding = embedding('text-embedding-005', description)::vector
WHERE embedding IS NULL;

The function returns a real[], so cast it to vector before storing. The AlloyDB service agent also needs a Vertex AI user role, or the call will fail with a permission error.

For big backfills, run the UPDATE in batches, because every row is a model call that costs time and money.

Take quiz
What does the embedding() function return?
a ScaNN index handle
a JSON schema
a ranked list of rows
a real[] array you can cast to vector
What does the cluster need before it can call a Vertex AI model?
a Vertex AI user role for the AlloyDB service agent
owner role on the VPC
BigQuery dataset editor role
public internet egress on the app VM

36. How does AlloyDB provide near-zero downtime maintenance?

AlloyDB patches and upgrades instances in a rolling way instead of taking the whole cluster offline. On an HA setup, the other nodes are updated first, then traffic moves to an updated node with a short failover, so the visible impact is typically seconds rather than minutes.

You stay in control of timing:

  • Set a preferred maintenance window by day and hour
  • Use deny periods (up to 30 days) around launches or peak seasons
  • Reschedule or apply pending maintenance on demand

Connections still drop during the switch, so apps need retry logic. A zonal instance with no standby cannot do this and will see a longer interruption, which is another reason to use HA in production.

Take quiz
What can you configure for maintenance in AlloyDB?
the exact PostgreSQL commit that gets patched
a preferred maintenance window and deny periods
a separate storage tier that skips updates
which Google engineer runs the patch
How does an HA primary stay available during maintenance?
maintenance runs only on read pools
traffic moves permanently to the secondary region
other nodes are updated first, then traffic switches with a brief connection blip
the cluster is shut down for the whole window

37. What happens when the primary instance fails in AlloyDB?

With regional availability, AlloyDB's health monitoring detects the failure and promotes the standby in another zone to be the new primary. Because it already shares the same storage, there is no data to copy or WAL to ship, which keeps failover short, typically under a minute.

sequenceDiagram
participant App
participant P as Primary (zone A)
participant S as Standby (zone B)
participant Mon as Health monitor
participant St as Shared storage
P--xMon: Health checks fail
Mon->>S: Promote to primary
S->>St: Attach and recover from log
S-->>App: Accepts connections on same endpoint
Mon->>Mon: Provision new standby
  • The connection endpoint keeps the same IP, so no client config changes
  • Open connections drop, and in-flight transactions roll back
  • A replacement standby is created in the background

Applications should reconnect with backoff and retry idempotent work. Read pool nodes keep serving reads throughout.

Take quiz
Why is AlloyDB failover relatively fast?
it rebuilds from WAL archived in Cloud Storage
DNS TTL is set to zero
it restores the latest backup
the standby already shares the same storage, so no data needs copying
What should an application do after a failover?
reconnect and retry failed transactions
manually switch to the secondary region
restart the whole cluster
nothing, open connections are preserved

38. How does cross-region replication and failover work in AlloyDB?

A secondary cluster in another region receives changes from the primary cluster by asynchronous replication. It is read-only until you change its role, and there are two ways to do that.

Operation When Data loss Result
Switchover Planned, both regions healthy None Clusters swap roles, replication continues in reverse
Promote (failover) Primary region down Possible, up to the replication lag Secondary becomes a standalone cluster, replication breaks

gcloud alloydb clusters switchover my-secondary --region=us-east1
gcloud alloydb clusters promote my-secondary --region=us-east1

After a promote you must repoint applications and later rebuild a new secondary. Because the link is asynchronous, your RPO equals roughly the replication lag at the moment of failure, so monitor it.

Take quiz
Which operation swaps primary and secondary roles without data loss?
promoting the secondary after an outage
a planned switchover
resizing the secondary
restoring from backup
Why can promoting a secondary after an outage lose data?
WAL is not written in the primary region
backups are disabled on secondaries
replication to the secondary is asynchronous
the secondary uses a different PostgreSQL version

39. How do you migrate a PostgreSQL database to AlloyDB with Database Migration Service?

For minimal downtime, use Database Migration Service (DMS) in continuous mode. It takes a full initial copy and then keeps the target in sync using logical replication (pglogical) until you cut over.

  1. Prepare the source: set wal_level=logical, install pglogical, allow enough replication slots and open network access.
  2. Create a source connection profile in DMS.
  3. Let DMS create the AlloyDB destination cluster, or pick an existing one.
  4. Test the job, then start it: full dump first, then continuous change capture.
  5. Watch replication lag. When it is near zero, stop writes, let it drain and promote the job.
  6. Point applications at AlloyDB and keep the source for a rollback window.

For small databases where downtime is acceptable, pg_dump and pg_restore are simpler. Check extensions, large objects and sequences before cutover, since those often need manual attention.

Take quiz
Which mechanism does DMS use for continuous PostgreSQL migration?
Cloud Storage Transfer Service
block-level disk snapshots
a physical streaming replica of pg_wal
logical replication through pglogical
What ends a DMS continuous migration?
promoting the job once lag is near zero, then switching applications over
deleting the source database first
adding a read pool node
re-running pg_dump nightly

40. How do you restore an AlloyDB cluster to a point in time?

PITR always creates a new cluster from the source cluster's continuous backup. The original keeps running untouched.

gcloud alloydb clusters restore my-restored \
  --region=us-central1 \
  --source-cluster=projects/my-proj/locations/us-central1/clusters/my-cluster \
  --point-in-time=2026-10-20T09:45:00Z

gcloud alloydb instances create my-restored-primary \
  --cluster=my-restored --region=us-central1 \
  --instance-type=PRIMARY --cpu-count=4

The restore gives you storage only, so you must add a primary instance before you can connect. Then compare data, export what you need, or switch the application over.

The timestamp must fall inside the recovery window, which is 14 days by default and up to 35.

Take quiz
What must you do after restoring a cluster with gcloud?
import a pg_dump
create a primary instance in the restored cluster
nothing, it comes with an instance
enable the columnar engine
Which flag supplies the target time for a point-in-time restore?
--timestamp
--as-of
--point-in-time
--restore-time

41. How do you troubleshoot slow queries in AlloyDB?

Work from the top-level view down to the single plan.

  1. Open Query Insights in the console to find the top queries by load, and see their wait events and sampled plans.
  2. Confirm with pg_stat_statements and sort by mean or total time.
  3. Run EXPLAIN (ANALYZE, BUFFERS) on the culprit and look for seq scans, bad row estimates and heavy disk reads.
  4. Check the index advisor for missing indexes, and consider columnar candidates for big aggregates.
  5. Look for blocking in pg_stat_activity (wait_event, state) and for bloat that needs vacuuming.
  6. Check CPU and memory saturation in Cloud Monitoring.
SELECT query, calls, mean_exec_time
FROM pg_stat_statements
ORDER BY mean_exec_time DESC
LIMIT 10;

Take quiz
Which console tool shows top queries and their wait events in AlloyDB?
Cloud CDN
Cloud Build logs
Artifact Registry
Query Insights
What does EXPLAIN (ANALYZE, BUFFERS) add over plain EXPLAIN?
actual run times and buffer hit and read counts
replica lag values
automatic index creation
a rewritten faster query

42. How can you optimize read-heavy workloads in AlloyDB?

Start by moving read traffic off the primary, then tune what each read costs.

  • Add read pool nodes and send reporting and read APIs to the pool endpoint
  • Turn on managed connection pooling to cut connection overhead
  • Add hot analytical columns to the columnar engine
  • Apply index advisor suggestions, and drop indexes nobody uses
  • Size memory so the working set stays in cache
  • Keep transactions short so vacuum can clean up and replicas stay fresh

Route only lag-tolerant reads to the pool; anything needing read-your-writes belongs on the primary. Measure with Query Insights before and after each change so you know which step actually helped.

Take quiz
What is the first scaling step for read-heavy OLTP traffic?
disable autovacuum
route reads to read pool nodes
double max_connections on the primary
add a secondary cluster for every app
Which change best helps a report that sums one column over 50 million rows?
adding a B-tree index on every column
increasing statement_timeout
adding that column to the columnar engine
enabling IAM authentication

43. How do you secure an AlloyDB cluster?

Layer controls across network, identity, data and audit.

Layer Control
Network Private IP only, Private Service Connect, VPC Service Controls, firewall rules
Identity IAM roles, IAM database authentication, least-privilege database roles
In transit TLS enforced, Auth Proxy with mTLS
At rest Encrypted by default, CMEK for key control
Audit Cloud Audit Logs plus the pgaudit extension for SQL-level logging

Avoid a public IP unless you need it, and if you do, restrict it tightly and use the proxy. Rotate or remove the initial postgres password, and keep backups under the same CMEK policy as the data.

Take quiz
Which option gives you control over the encryption keys used at rest?
a public IP with authorized networks
IAM database authentication
a pgBouncer sidecar
customer-managed encryption keys (CMEK)
Which extension provides detailed SQL-level audit logging?
pgaudit
pg_cron
pg_prewarm
postgres_fdw

44. How do compute and storage scale independently in AlloyDB?

Because storage is a separate layer, each side has its own scaling story.

Resource How it scales Impact
Primary compute Change machine type (vCPUs) Brief interruption while connections move
Read capacity Add or remove read pool nodes, or resize them No effect on the primary
Storage Automatic, grows with data No downtime, billed for use

This removes two classic headaches. You never plan a disk upgrade, and you can add read capacity without cloning data. The limit is the single write primary: write throughput scales only by moving to a bigger machine, up to the largest available shape.

Take quiz
How does AlloyDB storage grow?
by adding read pool nodes
automatically as data grows, with no provisioning step
you resize a persistent disk and restart
by raising max_wal_size
What happens when you resize the primary's machine type?
storage is wiped and rebuilt
the secondary cluster is deleted
a brief interruption while connections move to the resized instance
data must be re-imported

45. When would you choose AlloyDB Omni over AlloyDB on Google Cloud?

Choose Omni when the database cannot or should not live in a Google Cloud region. Choose the managed service when you want Google to run it.

Need Better fit
Data must stay on-premises or in a specific country Omni
Run on AWS or Azure, or at an edge site Omni
Local development and CI with production-like behavior Omni
Managed backups, patching and 99.99% SLA AlloyDB on Google Cloud
Shared regional storage, read pools, cross-region replicas out of the box AlloyDB on Google Cloud

With Omni you own operations, although the Kubernetes operator automates much of it. A common pattern is Omni on laptops and in CI, with managed AlloyDB in production.

Take quiz
Which requirement most clearly points to Omni?
wanting read pools out of the box
wanting Google to run backups and patching
needing a managed 99.99% SLA
data must stay on-premises for residency rules
Who handles day-to-day operations on Omni?
you do, since you run it yourself
Cloud Scheduler by default
Google, automatically
the Auth Proxy

46. How can you optimize cost in AlloyDB?

AlloyDB bills for compute (vCPU and memory), storage, backups and network egress, so each has a lever.

  • Right-size instances using CPU and memory metrics, since over-provisioned primaries are the biggest waste
  • Buy committed use discounts for steady baseline compute
  • Use small read pool nodes, and remove them when traffic drops
  • Shorten backup retention and PITR windows to what you really need, and delete stale on-demand backups
  • Keep traffic in-region to limit egress
  • Use smaller non-HA instances for dev and test, and Omni for local work

A cross-region secondary doubles instance and storage cost and adds replication egress, so keep it only for workloads that truly need DR.

Take quiz
Which discount model can lower AlloyDB compute cost for steady workloads?
a free tier for production
committed use discounts
sustained pre-warming credits
spot VMs for the primary
What does adding a cross-region secondary cluster add to the bill?
nothing, it is free
only the primary's backup cost
instance and storage cost for the secondary plus replication egress
only an SSL certificate fee

47. How do you troubleshoot connection exhaustion in AlloyDB?

The usual symptom is FATAL: remaining connection slots are reserved or timeouts at the client. max_connections is tied to instance memory, so simply raising it can hurt performance.

SELECT state, count(*)
FROM pg_stat_activity
GROUP BY state
ORDER BY count(*) DESC;

  1. Check the mix: lots of idle means oversized app pools; idle in transaction means app code holding transactions open.
  2. Find the top clients with usename and application_name.
  3. Enable managed connection pooling and point apps at port 6432.
  4. Shrink per-instance app pool sizes, especially on autoscaled services such as Cloud Run.
  5. Set idle_in_transaction_session_timeout to kill stuck sessions.
  6. Move read traffic to the read pool to spread the load.
Take quiz
Which view shows the state of current connections?
pg_locks
pg_stat_replication
pg_stat_bgwriter
pg_stat_activity
What is the best fix for many short-lived serverless connections?
enable managed connection pooling
raise work_mem
add more secondary clusters
turn off SSL

48. How does AlloyDB integrate with BigQuery for analytics?

The simplest route is a BigQuery federated query. You create a connection to AlloyDB, then run EXTERNAL_QUERY, which pushes SQL to AlloyDB and returns the result so you can join it with warehouse tables.

SELECT o.region, SUM(o.total) AS revenue
FROM EXTERNAL_QUERY(
  'projects/my-proj/locations/us/connections/alloydb_conn',
  'SELECT region, total FROM orders') AS o
GROUP BY o.region;

Federation suits small lookups and fresh data, but each call loads the operational database. For large scans or heavy history, replicate with a CDC pipeline such as Datastream into BigQuery and query it there.

To keep federated queries cheap, push filters inside the inner SQL, and point the connection at a read pool endpoint.

Take quiz
Which BigQuery function runs SQL inside AlloyDB?
FEDERATED_SELECT
EXTERNAL_QUERY
REMOTE_EXEC
ALLOYDB_RUN
When is replicating into BigQuery better than federated queries?
for tiny lookups needing the freshest row
for single-row point queries
for large heavy scans that should not load the operational database
when the schema must stay hidden

49. Why is AlloyDB suitable for HTAP workloads?

HTAP means running transactions and analytics on the same data. AlloyDB suits it because three features cover each side of the problem.

  • Row store with fast commits handles OLTP on the primary
  • The columnar engine accelerates scans and aggregates on those same tables, with no ETL delay
  • Read pools let heavy reports run away from the primary, over shared storage with low lag

The benefit is fresher analytics and one system to run instead of a database plus a pipeline plus a warehouse. The limits are real, though. Columnar memory competes with the buffer cache, and truly huge history or complex cross-source analysis still belongs in a warehouse such as BigQuery.

Take quiz
What allows analytics on fresh transactional data without ETL in AlloyDB?
a nightly CSV export
a separate Hadoop cluster
an hourly logical dump
the columnar engine working on the same tables
How can heavy reports be isolated from OLTP writes?
run them on read pool nodes
disable the columnar engine
run them on the primary at peak hours
shrink shared_buffers

50. How do you monitor an AlloyDB instance?

AlloyDB integrates with Google Cloud's observability tools, so most monitoring needs no agents.

Tool What it shows
System insights Instance CPU, memory, storage, connections and replica lag in the console
Query Insights Top queries, load by wait event, sampled plans
Cloud Monitoring Metrics, dashboards and alerting policies
Cloud Logging PostgreSQL logs and audit logs
pg_stat_* views In-database detail: statements, activity, replication

Set alerts on CPU, memory pressure, connection count and replica lag, plus an alert on failover events. Review Query Insights weekly to catch regressions after releases.

Take quiz
Which service stores AlloyDB metrics such as CPU and replica lag?
Cloud Build
Cloud Monitoring
Secret Manager
Cloud CDN
What does System insights show?
IAM policy diffs
code coverage reports
instance-level resource metrics such as CPU, memory and connections
billing invoices
«
»

Comments & Discussions