nerdexam
Google

PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #114

Your team recently released a new version of a highly consumed application to accommodate additional user traffic. Shortly after the release, you received an alert from your production monitoring…

The correct answer is A. Identify and optimize slow running queries, or set parallel replication flags. Replication lag in Cloud SQL for MySQL is most commonly caused by slow or long-running queries on the primary that take more time to replay on the replica, or by single-threaded replication not keeping pace with write volume. Optimizing slow queries reduces the volume of work…

Monitoring and optimizing database performance

Question

Your team recently released a new version of a highly consumed application to accommodate additional user traffic. Shortly after the release, you received an alert from your production monitoring team that there is consistently high replication lag between your primary instance and the read replicas of your Cloud SQL for MySQL instances. You need to resolve the replication lag. What should you do?

Options

  • AIdentify and optimize slow running queries, or set parallel replication flags.
  • BStop all running queries, and re-create the replicas.
  • CEdit the primary instance to upgrade to a larger disk, and increase vCPU count.
  • DEdit the primary instance to add additional memory.

How the community answered

(38 responses)
  • A
    82% (31)
  • B
    3% (1)
  • C
    11% (4)
  • D
    5% (2)

Explanation

Replication lag in Cloud SQL for MySQL is most commonly caused by slow or long-running queries on the primary that take more time to replay on the replica, or by single-threaded replication not keeping pace with write volume. Optimizing slow queries reduces the volume of work replicas must do, while enabling parallel replication flags (e.g., slave_parallel_workers, binlog_transaction_dependency_tracking) allows replicas to replay transactions concurrently. Option B (stop queries and recreate replicas) is disruptive and does not fix the root cause. Option C (larger disk and more vCPUs on primary) addresses primary capacity, not replication throughput. Option D (more memory on primary) similarly does not resolve replica replay bottlenecks.

Topics

#Replication Lag#Cloud SQL for MySQL#Performance Optimization#Read Replicas

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DATABASE-ENGINEER Practice