Courseiva

PCDE Practice Question: Manage a solution that can span multiple database technologies

You are troubleshooting a Cloud SQL read replica that is experiencing high replication lag. You check the 'replication_lag' metric and see it is consistently above 60 seconds. What is the most likely cause of this lag?

⚠ Common exam trap

A common pitfall is assuming replication lag is caused by replica configuration issues (like storage or PITR) rather than the primary's write-heavy workload, which is the most direct and common cause in Cloud SQL.

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

The primary instance has a heavy write workload.

High replication lag in Cloud SQL is most commonly caused by a heavy write workload on the primary instance. When the primary processes a large volume of write operations (e.g., INSERT, UPDATE, DELETE), the replica must replay those changes from the binary log, and if the rate of writes exceeds the replica's ability to apply them, lag accumulates. This is a fundamental behavior of MySQL asynchronous replication, where the replica is always slightly behind the primary under load.

Answer analysis

Option-by-option breakdown

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

  • The replica's automatic storage increase is disabled.

    Why it's wrong here

    Storage increase settings do not affect replication lag.

  • The replica has point-in-time recovery enabled.

    Why it's wrong here

    PITR on replicas can add some overhead but is not a primary cause of high lag.

  • The primary instance has a heavy write workload.

    Why this is correct

    A heavy write load on the primary generates more changes than the replica can apply, causing lag.

  • The replica is using a different storage type than the primary.

    Why it's wrong here

    Storage type mismatch does not cause replication lag; it affects performance but not replication directly.

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

Same concept, more angles

8 more ways this is tested on PCDE

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. An engineer needs to monitor the replication lag of a Cloud SQL read replica. Which metric should they use in Cloud Monitoring?

easy
  • A.replication_lag
  • B.sent_bytes_count
  • C.disk_bytes_used
  • D.cpu_utilization

Why A: The `replication_lag` metric in Cloud Monitoring directly measures the time delay between a primary Cloud SQL instance and its read replica, reported in seconds. This is the standard metric for monitoring how far behind the replica is in applying changes from the primary, which is critical for ensuring read-after-write consistency and data freshness.

Variation 2. A DevOps engineer needs to monitor Cloud SQL for MySQL replication lag on a read replica to ensure data freshness. Which Cloud Monitoring metric should they create an alert on?

easy
  • A.cloudsql.googleapis.com/database/replication/lag
  • B.cloudsql.googleapis.com/database/replica/state
  • C.cloudsql.googleapis.com/database/postgresql/replication/lag
  • D.cloudsql.googleapis.com/database/mysql/replication/seconds_behind_master

Why A: The metric 'replication_lag' in Cloud SQL measures the seconds behind the primary. Cloud SQL for MySQL uses 'seconds_behind_master' internally, but the exposed metric is 'replication_lag'.

Variation 3. A team is using Cloud SQL for PostgreSQL and wants to monitor replication lag on their read replicas. Which metric should they use?

easy
  • A.cloudsql.googleapis.com/database/replication/lag
  • B.cloudsql.googleapis.com/database/network/received_bytes_count
  • C.cloudsql.googleapis.com/database/disk/bytes_used
  • D.cloudsql.googleapis.com/database/cpu/utilization

Why A: Cloud SQL provides a metric called 'replication_lag' for read replicas, which measures the time (in seconds) the replica is behind the primary. CPU utilisation and disk usage are for performance, not replication. For PostgreSQL, the metric is valid.

Variation 4. A Cloud SQL for MySQL instance has a read replica in a different region. The team wants to monitor replication lag and receive alerts if lag exceeds 60 seconds. Which two steps should they take? (Choose TWO.)

medium
  • A.Create a Cloud Monitoring alerting policy with a condition on 'cloudsql.googleapis.com/database/replication/replica_lag' with threshold >60s.
  • B.Configure a Cloud Function to query the replica status every minute.
  • C.Set up a Cloud Scheduler job to run a query on the replica to check lag.
  • D.Promote the replica to standalone if lag exceeds 60 seconds.
  • E.Enable the 'replication_lag' metric in Cloud SQL monitoring.

Why A: The replication_lag metric is available in Cloud Monitoring. An alerting policy based on this metric with a threshold of 60 seconds will trigger notifications when lag exceeds that value.

Variation 5. A company wants to monitor Cloud SQL database latency for read replicas and set up an alert if the replica lag exceeds 30 seconds. Which metric should be used?

medium
  • A.cloudsql.googleapis.com/database/postgresql/num_backends
  • B.cloudsql.googleapis.com/database/replication/replication_lag
  • C.cloudsql.googleapis.com/database/cpu/utilization
  • D.cloudsql.googleapis.com/database/disk/bytes_used

Why B: The 'replication_lag' metric in Cloud SQL measures the lag between primary and read replica. It is the correct metric to set alerts for replica lag.

Variation 6. A company uses Cloud Bigtable to store session data. They need to monitor replication lag between clusters in different zones. Which metric should they use?

medium
  • A.Instance-level 'replication_lag' metric.
  • B.Cluster-level 'cpu_load' metric.
  • C.Use Key Visualizer to identify replication delays.
  • D.Table-level 'rows_returned' metric.

Why A: Cloud Bigtable exposes an instance-level 'replication_lag' metric that measures the time delay (in seconds) between clusters in a replicated instance. This metric directly reflects how far behind a replica cluster is relative to the primary cluster, making it the appropriate choice for monitoring replication lag between zones.

Variation 7. A Cloud SQL for PostgreSQL instance has a read replica lagging behind the primary. The team needs to monitor the replica lag and set up an alert if it exceeds 60 seconds. Which metric should they use?

medium
  • A.bytes_received
  • B.disk_read_ops
  • C.replication_lag
  • D.cpu_utilization

Why C: The correct metric is `replication_lag` because it directly measures the delay in seconds between the primary and read replica in Cloud SQL for PostgreSQL. This metric reflects how far behind the replica is in applying changes from the primary's write-ahead log (WAL), making it the precise indicator for alerting when lag exceeds 60 seconds.

Variation 8. A company uses Cloud SQL for PostgreSQL. They need to monitor the replication lag on a read replica. Which metric should they use in Cloud Monitoring?

medium
  • A.cloudsql.googleapis.com/database/replication/replica_lag
  • B.cloudsql.googleapis.com/database/postgresql/replication/replica_lag
  • C.cloudsql.googleapis.com/database/replication/lag_seconds
  • D.cloudsql.googleapis.com/database/postgresql/replication/lag

Why B: For PostgreSQL replicas in Cloud SQL, the metric 'cloudsql.googleapis.com/database/postgresql/replication/replica_lag' measures lag in bytes (seconds can be derived). The metric 'replication_lag' is available for MySQL. For PostgreSQL, the specific metric is 'replica_lag'.

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.