PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #131
Your application uses Cloud SQL for MySQL. Your users run reports on data that relies on near- real time; however, the additional analytics caused excessive load on the primary database. You created…
The correct answer is A. Create secondary indexes on the replica. C. Disable replication on the read replica, and set the flag for parallel replication on the read replica. Two independent problems exist: slow query performance on the replica, and high replication lag. Option A addresses slow queries by adding secondary indexes directly on the read replica. In Cloud SQL for MySQL, replica indexes are independent of the primary and do not affect…
Question
Your application uses Cloud SQL for MySQL. Your users run reports on data that relies on near- real time; however, the additional analytics caused excessive load on the primary database. You created a read replica for the analytics workloads, but now your users are complaining about the lag in data changes and that their reports are still slow. You need to improve the report performance and shorten the lag in data replication without making changes to the current reports. Which two approaches should you implement? (Choose two.)
Options
- ACreate secondary indexes on the replica.
- BCreate additional read replicas, and partition your analytics users to use different read replicas.
- CDisable replication on the read replica, and set the flag for parallel replication on the read replica.
- DDisable replication on the primary instance, and set the flag for parallel replication on the primary
- EMove your analytics workloads to BigQuery, and set up a streaming pipeline to move data and
How the community answered
(38 responses)- A71% (27)
- B8% (3)
- D5% (2)
- E16% (6)
Explanation
Two independent problems exist: slow query performance on the replica, and high replication lag. Option A addresses slow queries by adding secondary indexes directly on the read replica. In Cloud SQL for MySQL, replica indexes are independent of the primary and do not affect replication; they allow the replica's query engine to satisfy analytical queries more efficiently without touching the primary. Option C addresses replication lag by enabling parallel replication on the replica. Stopping the SQL thread (effectively disabling active replication momentarily) is required to safely configure the parallel_replication flags (slave_parallel_workers, slave_parallel_type=LOGICAL_CLOCK), which allow the replica to apply multiple transactions simultaneously rather than serially, dramatically reducing lag. Option B adds more replicas but does not fix the lag on any individual replica. Option D incorrectly targets the primary instance, which should never have replication disabled for this purpose. Option E moves analytics to BigQuery, which requires changes to the reports and violates the 'without making changes to current reports' constraint.
Topics
Community Discussion
No community discussion yet for this question.