Courseiva

PCDE Practice Question: Design innovative, scalable, and highly available cloud database solutions

An organization uses Cloud SQL for PostgreSQL with read replicas to offload reporting queries. During peak, the primary instance's CPU spikes to 90%. The team suspects the read replica is falling behind. Which two settings should they check to diagnose replication lag? (Choose TWO.)

⚠ Common exam trap

Google Cloud exams often test the distinction between PostgreSQL-specific commands and MySQL commands, so the trap here is that candidates familiar with MySQL might choose `SHOW REPLICATION STATUS` (which is `SHOW REPLICA STATUS` in MySQL 8.0.23+) instead of the correct PostgreSQL diagnostic tools.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

pg_stat_replication view on the primary.

The `pg_stat_replication` view on the primary instance shows the WAL sender process state, including the `write_lag`, `flush_lag`, and `replay_lag` columns that directly measure replication lag in PostgreSQL. This view provides real-time data on how far behind each standby (including read replicas) is in receiving, flushing, and applying WAL data, making it the primary diagnostic tool for replication lag.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • pg_stat_replication view on the primary.

    Why this is correct

    Shows replication lag and status.

  • pg_replication_slots view on the replica.

    Why it's wrong here

    That view doesn't exist; use pg_stat_replication on replica.

  • Replica lag metric in Cloud Monitoring.

    Why this is correct

    Provides lag in seconds.

  • max_wal_size configuration parameter.

    Why it's wrong here

    Affects WAL retention but doesn't directly diagnose lag.

  • SHOW REPLICATION STATUS command.

    Why it's wrong here

    Not a valid PostgreSQL command.

About these practice questions

Courseiva writes every PCDE question from scratch — 1,446 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PCDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCDE exam.