2 packs: 15% off with code BUY2. 3 or more: 20% off with code BUY3.

Free Google Professional Cloud Database Engineer Practice Questions

49 free Google Professional Cloud Database Engineer practice questions from the CertStash pack of 197, each with the correct answer and a full explanation. The rule is the same for every exam: ten free on the product page, 49 free here, all 197 in the pack, and each step includes the one before it.

Question 1

You host an application in Google Cloud. The application is located in a single region and uses Cloud SQL for transactional data. Most of your users are located in the same time zone and expect the application to be available 7 days a week, from 6 AM to 10 PM. You want to ensure regular maintenance updates to your Cloud SQL instance without creating downtime for your users. What should you do?

  1. Configure a maintenance window during a period when no users will be on the system. Control the order of update by setting nonproduction instances to earlier and production instances to later.
  2. Create your database with one primary node and one read replica in the region.
  3. Enable maintenance notifications for users, and reschedule maintenance activities to a specific time after notifications have been sent.
  4. Configure your Cloud SQL instance with high availability enabled.
Show answer and explanation

Correct answer: A. Configure a maintenance window during a period when no users will be on the system. Control the order of update by setting nonproduction instances to earlier and production instances to later.

The scenario specifies users are available only 6 AM to 10 PM in a single timezone, creating a clear maintenance window from 10 PM to 6 AM when no users are active. Option A correctly identifies this approach: schedule maintenance during the 10 PM to 6 AM window and control update ordering by applying updates to nonproduction instances first (earlier times) before production instances (later times). This ensures zero downtime for users while allowing regular maintenance.

Why the other options are wrong

  • B. Read replicas help with read scaling but do not eliminate downtime during primary instance maintenance; the primary must still be updated.
  • C. Notifying users and rescheduling maintenance doesn't solve the core requirement of maintaining availability during necessary updates.
  • D. High availability in Cloud SQL provides automatic failover for failures, but planned maintenance still requires downtime unless a maintenance window strategy is employed.

Question 2

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?

  1. Identify and optimize slow running queries, or set parallel replication flags.
  2. Stop all running queries, and re-create the replicas.
  3. Edit the primary instance to upgrade to a larger disk, and increase vCPU count.
  4. Edit the primary instance to add additional memory.
Show answer and explanation

Correct answer: A. Identify and optimize slow running queries, or set parallel replication flags.

Replication lag occurs when the primary instance cannot write changes to replicas fast enough, typically due to slow or resource-intensive queries on the primary. The solution is to identify and optimize these slow queries using Query Insights or slow query logs, and configure parallel replication flags to process binary log events in parallel. This addresses the root cause of the lag without requiring infrastructure changes.

Why the other options are wrong

  • B. Stopping queries and recreating replicas is destructive, causes significant downtime, and does not address the underlying cause of lag.
  • C. Upgrading disk and vCPU does not solve replication lag caused by slow queries; the lag persists even with more resources if queries are inefficient.
  • D. Adding memory alone does not resolve replication lag; the issue is typically query efficiency and binary log processing, not memory constraints.

Question 3

Your organization operates in a highly regulated industry. Separation of concerns (SoC) and security principle of least privilege (PoLP) are critical. The operations team consists of: Person A is a database administrator. Person B is an analyst who generates metric reports. Application C is responsible for automatic backups. You need to assign roles to team members for Cloud Spanner. Which roles should you assign?

  1. roles/spanner.databaseAdmin for Person A roles/spanner.databaseReader for Person B roles/spanner.backupWriter for Application C
  2. roles/spanner.databaseAdmin for Person A roles/spanner.databaseReader for Person B roles/spanner.backupAdmin for Application C
  3. roles/spanner.databaseAdmin for Person A roles/spanner.databaseUser for Person B roles/spanner databaseReader for Application C
  4. roles/spanner.databaseAdmin for Person A roles/spanner.databaseUser for Person B roles/spanner.backupWriter for Application
Show answer and explanation

Correct answer: A. roles/spanner.databaseAdmin for Person A roles/spanner.databaseReader for Person B roles/spanner.backupWriter for Application C

Separation of concerns and principle of least privilege require assigning the minimum necessary permissions. Person A (DBA) needs databaseAdmin to manage schema and operations. Person B (analyst) needs only databaseReader to generate reports without modification rights. Application C (backup automation) needs backupWriter to create backups without requiring full admin privileges. This combination follows least privilege by granting only the specific permissions needed for each role's responsibilities.

Why the other options are wrong

  • B. BackupAdmin grants excessive permissions to Application C; it should only need backupWriter to create backups automatically.
  • C. DatabaseUser for Person B allows write operations unnecessary for an analyst generating read-only reports; databaseReader is more restrictive and appropriate.
  • D. DatabaseUser for Person B allows write access unsuitable for an analyst, and backupWriter is correctly identified but the Person B role is wrong.

Question 4

You are designing an augmented reality game for iOS and Android devices. You plan to use Cloud Spanner as the primary backend database for game state storage and player authentication. You want to track in-game rewards that players unlock at every stage of the game. During the testing phase, you discovered that costs are much higher than anticipated, but the query response times are within the SLA. You want to follow Google-recommended practices. You need the database to be performant and highly available while you keep costs low. What should you do?

  1. Manually scale down the number of nodes after the peak period has passed.
  2. Use interleaving to co-locate parent and child rows.
  3. Use the Cloud Spanner query optimizer to determine the most efficient way to execute the SQL query.
  4. Use granular instance sizing in Cloud Spanner and Autoscaler.
Show answer and explanation

Correct answer: D. Use granular instance sizing in Cloud Spanner and Autoscaler.

The requirement is to reduce costs while maintaining performance and high availability. Cloud Spanner Autoscaler automatically adjusts node count based on actual demand, scaling down during low-traffic periods and up during peaks. This follows Google-recommended practices for cost optimization in Cloud Spanner. Granular instance sizing allows right-sizing of compute resources, and the combination of both achieves cost reduction without sacrificing performance or availability.

Why the other options are wrong

  • A. Manual scaling is reactive and requires constant human intervention; Autoscaler provides automated, continuous optimization.
  • B. Interleaving optimizes query performance but does not reduce costs; it's a schema design pattern unrelated to pricing.
  • C. The query optimizer improves execution efficiency but does not address the broader cost problem; queries already meet SLA response times.

Question 5

You recently launched a new product to the US market. You currently have two Bigtable clusters in one US region to serve all the traffic. Your marketing team is planning an immediate expansion to APAC. You need to roll out the regional expansion while implementing high availability according to Google-recommended practices. What should you do?

  1. Maintain a target of 23% CPU utilization by locating: cluster-a in zone us-central1-a cluster-b in zone europe-west1-d cluster-c in zone asia-east1-b
  2. Maintain a target of 23% CPU utilization by locating: cluster-a in zone us-central1-a cluster-b in zone us-central1-b cluster-c in zone us-east1-a
  3. Maintain a target of 35% CPU utilization by locating: cluster-a in zone us-central1-a cluster-b in zone australia-southeast1-a cluster-c in zone europe-west1-d cluster-d in zone asia-east1-b
  4. Maintain a target of 35% CPU utilization by locating: cluster-a in zone us-central1-a cluster-b in zone us-central2-a cluster-c in zone asia-northeast1-b cluster-d in zone asia-east1-b
Show answer and explanation

Correct answer: D. Maintain a target of 35% CPU utilization by locating: cluster-a in zone us-central1-a cluster-b in zone us-central2-a cluster-c in zone asia-northeast1-b cluster-d in zone asia-east1-b

For regional expansion with high availability, clusters must be distributed across geographically diverse regions to serve US and APAC markets. Option D locates clusters in us-central1-a (US), us-central2-a (US backup), asia-northeast1-b (Japan/APAC), and asia-east1-b (Taiwan/APAC), providing geographic redundancy. The 35% CPU utilization target aligns with Google-recommended practices for Bigtable clusters to maintain performance headroom and handle traffic spikes.

Why the other options are wrong

  • A. 23% CPU utilization target is too conservative and unnecessary; the 35% target is Google-recommended. Including europe-west1-d does not serve the APAC expansion requirement.
  • B. Locating all three clusters within US regions (us-central1-a, us-central1-b, us-east1-a) does not address APAC expansion and uses 23% target.
  • C. While geographically diverse, this option includes europe-west1-d which is not necessary for US-to-APAC expansion, and the cluster distribution does not optimally serve the stated regions.

Question 6

Your ecommerce website captures user clickstream data to analyze customer traffic patterns in real time and support personalization features on your website. You plan to analyze this data using big data tools. You need a low-latency solution that can store 8 TB of data and can scale to millions of read and write requests per second. What should you do?

  1. Write your data into Bigtable and use Dataproc and the Apache Hbase libraries for analysis.
  2. Deploy a Cloud SQL environment with read replicas for improved performance. Use Datastream to export data to Cloud Storage and analyze with Dataproc and the Cloud Storage connector.
  3. Use Memorystore to handle your low-latency requirements and for real-time analytics.
  4. Stream your data into BigQuery and use Dataproc and the BigQuery Storage API to analyze large volumes of data.
Show answer and explanation

Correct answer: A. Write your data into Bigtable and use Dataproc and the Apache Hbase libraries for analysis.

Bigtable is purpose-built for millions of reads and writes per second at low latency with petabyte-scale storage. It is the optimal choice for 8 TB of clickstream data requiring real-time analysis. Using Dataproc with Apache HBase libraries provides the necessary big data analysis tools. This combination meets all requirements: low-latency storage, massive scalability, and support for big data processing.

Why the other options are wrong

  • B. Cloud SQL with read replicas cannot scale to millions of requests per second and is not designed for high-volume streaming data; Datastream adds unnecessary complexity.
  • C. Memorystore is an in-memory cache, not a persistent store suitable for 8 TB of data; it cannot replace a primary database for this use case.
  • D. BigQuery is optimized for analytical queries on historical data, not low-latency transactional access for millions of real-time writes per second.

Question 7

You are managing multiple applications connecting to a database on Cloud SQL for PostgreSQL. You need to be able to monitor database performance to easily identify applications with long-running and resource-intensive queries. What should you do?

  1. Use log messages produced by Cloud SQL.
  2. Use Query Insights for Cloud SQL.
  3. Use the Cloud Monitoring dashboard with available metrics from Cloud SQL.
  4. Use Cloud SQL instance monitoring in the Google Cloud Console.
Show answer and explanation

Correct answer: B. Use Query Insights for Cloud SQL.

Query Insights for Cloud SQL is the dedicated feature for identifying resource-intensive and long-running queries across multiple applications. It provides detailed visibility into individual query execution, resource consumption, and performance patterns, allowing operators to pinpoint which applications are causing performance issues. This is specifically designed for the stated requirement of monitoring database performance and identifying problematic queries by application.

Why the other options are wrong

  • A. Cloud SQL logs contain general database events but lack the detailed query-level insights needed to identify resource-intensive operations.
  • C. Cloud Monitoring dashboards provide aggregate metrics but not the granular per-query analysis required to isolate problematic applications.
  • D. Instance monitoring in the Cloud Console shows overall instance health but not query-level details needed to identify long-running or resource-intensive queries.

Question 8

You are building an application that allows users to customize their website and mobile experiences. The application will capture user information and preferences. User profiles have a dynamic schema, and users can add or delete information from their profile. You need to ensure that user changes automatically trigger updates to your downstream BigQuery data warehouse. What should you do?

  1. Store your data in Bigtable, and use the user identifier as the key. Use one column family to store user profile data, and use another column family to store user preferences.
  2. Use Cloud SQL, and create different tables for user profile data and user preferences from your recommendations model. Use SQL to join the user profile data and preferences
  3. Use Firestore in Native mode, and store user profile data as a document. Update the user profile with preferences specific to that user and use the user identifier to query.
  4. Use Firestore in Datastore mode, and store user profile data as a document. Update the user profile with preferences specific to that user and use the user identifier to query.
Show answer and explanation

Correct answer: C. Use Firestore in Native mode, and store user profile data as a document. Update the user profile with preferences specific to that user and use the user identifier to query.

Firestore in Native mode is the optimal choice for this scenario because it supports dynamic schemas with flexible document structures, allowing users to add or delete profile information without predefined schemas. Firestore integrates seamlessly with BigQuery through native export capabilities and can automatically trigger updates to downstream data warehouses. The user identifier provides an efficient query mechanism, and the document-based model perfectly matches the dynamic profile requirements described.

Why the other options are wrong

  • A. Bigtable lacks native BigQuery integration triggers and automatic update mechanisms required for downstream warehouse synchronization.
  • B. Cloud SQL requires rigid schema definitions incompatible with dynamic user profiles that change frequently, and joining separate tables adds unnecessary complexity.
  • D. Datastore mode is deprecated and lacks the modern features and BigQuery integration capabilities of Native mode.

Question 9

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.)

  1. Create secondary indexes on the replica.
  2. Create additional read replicas, and partition your analytics users to use different read replicas.
  3. Disable replication on the read replica, and set the flag for parallel replication on the read replica. Re-enable replication and optimize performance by setting flags on the primary instance.
  4. Disable replication on the primary instance, and set the flag for parallel replication on the primary instance. Re-enable replication and optimize performance by setting flags on the read replica.
  5. Move your analytics workloads to BigQuery, and set up a streaming pipeline to move data and update BigQuery.
Show answer and explanation

Correct answer: B, E. Create additional read replicas, and partition your analytics users to use different read replicas; Move your analytics workloads to BigQuery, and set up a streaming pipeline to move data and update BigQuery.

Creating secondary indexes on the replica improves query performance for analytics workloads without affecting the primary instance. Moving analytics workloads to BigQuery with a streaming pipeline provides the most scalable solution for near-real-time analytics, eliminating replication lag concerns and offloading compute from Cloud SQL entirely. These two approaches address both the performance and replication lag issues without modifying existing reports.

Why the other options are wrong

  • A. While secondary indexes help performance, this alone does not address the replication lag problem users are experiencing.
  • C. Disabling replication defeats the purpose of having a read replica and creates inconsistency issues.
  • D. Modifying primary instance flags and disabling replication on the primary undermines the read replica's purpose and risks data consistency.

Question 10

You are evaluating Cloud SQL for PostgreSQL as a possible destination for your on-premises PostgreSQL instances. Geography is becoming increasingly relevant to customer privacy worldwide. Your solution must support data residency requirements and include a strategy to: configure where data is stored control where the encryption keys are stored govern the access to data What should you do?

  1. Replicate Cloud SQL databases across different zones.
  2. Create a Cloud SQL for PostgreSQL instance on Google Cloud for the data that does not need to adhere to data residency requirements. Keep the data that must adhere to data residency requirements on-premises. Make application changes to support both databases.
  3. Allow application access to data only if the users are in the same region as the Google Cloud region for the Cloud SQL for PostgreSQL database.
  4. Use features like customer-managed encryption keys (CMEK), VPC Service Controls, and Identity and Access Management (IAM) policies.
Show answer and explanation

Correct answer: D. Use features like customer-managed encryption keys (CMEK), VPC Service Controls, and Identity and Access Management (IAM) policies.

Customer-managed encryption keys (CMEK) allow control over encryption key storage locations, VPC Service Controls enforce network boundaries to govern data access and residency, and IAM policies provide fine-grained access control. Together, these Google Cloud features comprehensively address all three requirements: controlling data storage location through regional instances, managing encryption key storage through CMEK, and governing access through VPC Service Controls and IAM policies.

Why the other options are wrong

  • A. Cross-zone replication does not address key management or access governance requirements for data residency compliance.
  • B. Splitting data between on-premises and cloud introduces operational complexity and does not leverage Google Cloud's compliance features.
  • C. Geographic access restrictions based on user location do not provide the infrastructure-level data residency guarantees required by regulatory frameworks.

What people say about the full Professional Cloud Database Engineer pack 5.0 from 2

The Professional Cloud Database Engineer exam was challenging, but I managed to pass after studying with practice tests and solid study resources. Knowing what to expect made the exam less stressful.
Cora EllisProfessional Cloud Database Engineer
Cloud database concepts were deep but well explained in practice questions. Practice questions tested real-world tasks and prepared me strongly.
Ira VermaProfessional Cloud Database Engineer

Question 11

You are troubleshooting a connection issue with a newly deployed Cloud SQL instance on Google Cloud. While investigating the Cloud SQL Proxy logs, you see the message Error 403: Access Not Configured. What should you do?

  1. Check the app.yaml value cloud_sql_instances for a misspelled or incorrect instance connection name.
  2. Check whether your service account has cloudsql.instances.connect permission.
  3. Enable the Cloud SQL Admin API.
  4. Ensure that you are using an external (public) IP address interface.
Show answer and explanation

Correct answer: C. Enable the Cloud SQL Admin API.

The Error 403: Access Not Configured message indicates that required Google Cloud APIs are not enabled. The Cloud SQL Admin API must be explicitly enabled in the Google Cloud project before Cloud SQL Proxy can communicate with Cloud SQL instances. This is a service enablement issue, not a configuration or permission issue.

Why the other options are wrong

  • A. Misspelled instance names produce different errors; this specific error indicates API enablement issues.
  • B. Missing permissions produce different authorization errors; Access Not Configured specifically refers to APIs.
  • D. Public vs. private IP addresses do not cause Access Not Configured errors; this is an API enablement issue.

Question 12

Your team uses thousands of connected IoT devices to collect device maintenance data for your oil and gas customers in real time. You want to design inspection routines, device repair, and replacement schedules based on insights gathered from the data produced by these devices. You need a managed solution that is highly scalable, supports a multi-cloud strategy, and offers low latency for these IoT devices. What should you do?

  1. Use Firestore with Looker.
  2. Use Cloud Spanner with Data Studio.
  3. Use MongoD8 Atlas with Charts.
  4. Use Bigtable with Looker.
Show answer and explanation

Correct answer: D. Use Bigtable with Looker.

Bigtable is purpose-built for time-series data from IoT devices with extreme scalability, low-latency reads and writes, and managed multi-region capabilities supporting multi-cloud strategies. Looker provides advanced analytics and visualization on top of Bigtable data, enabling the inspection routine and maintenance scheduling insights required. This combination delivers the high scalability, low latency, and multi-cloud support essential for thousands of connected IoT devices.

Why the other options are wrong

  • A. Firestore is optimized for document stores and mobile apps, not high-volume time-series IoT data.
  • B. Cloud Spanner provides strong consistency for transactional workloads but is not purpose-built for time-series IoT analytics.
  • C. MongoDB Atlas is a third-party solution that does not integrate as seamlessly with Google Cloud native services.

Question 13

You are deploying a new Cloud SQL instance on Google Cloud using the Cloud SQL Auth proxy. You have identified snippets of application code that need to access the new Cloud SQL instance. The snippets reside and execute on an application server running on a Compute Engine machine. You want to follow Google-recommended practices to set up Identity and Access Management (IAM) as quickly and securely as possible. What should you do?

  1. For each application code, set up a common shared user account.
  2. For each application code, set up a dedicated user account.
  3. For the application server, set up a service account.
  4. For the application server, set up a common shared user account.
Show answer and explanation

Correct answer: C. For the application server, set up a service account.

When using Cloud SQL Auth proxy on Compute Engine, the recommended practice is to set up a single service account for the application server itself. The Auth proxy authenticates to Cloud SQL using the service account's credentials, which is the most secure and operationally efficient approach. This follows Google-recommended practices by using workload identity and avoiding database-level user management for infrastructure-level access control.

Why the other options are wrong

  • A. Shared user accounts violate least privilege principles and create security risks.
  • B. Dedicated database user accounts per application code add unnecessary complexity; service account authentication is the standard approach.
  • D. Shared user accounts at the database level violate least privilege and security best practices.

Question 14

Your online delivery business that primarily serves retail customers uses Cloud SQL for MySQL for its inventory and scheduling application. The required recovery time objective (RTO) and recovery point objective (RPO) must be in minutes rather than hours as a part of your high availability and disaster recovery design. You need a high availability configuration that can recover without data loss during a zonal or a regional failure. What should you do?

  1. Set up all read replicas in a different region using asynchronous replication.
  2. Set up all read replicas in the same region as the primary instance with synchronous replication.
  3. Set up read replicas in different zones of the same region as the primary instance with synchronous replication, and set up read replicas in different regions with asynchronous replication.
  4. Set up read replicas in different zones of the same region as the primary instance with asynchronous replication, and set up read replicas in different regions with synchronous replication.
Show answer and explanation

Correct answer: C. Set up read replicas in different zones of the same region as the primary instance with synchronous replication, and set up read replicas in different regions with asynchronous replication.

To meet RTO and RPO requirements in minutes with protection against zonal and regional failures, you need synchronous replication within the same region for zero data loss during zonal failures, combined with asynchronous replicas in different regions for disaster recovery. Synchronous replication within-region ensures no data loss, while asynchronous cross-region replicas provide recovery from regional failures with acceptable RPO.

Why the other options are wrong

  • A. Using only asynchronous cross-region replicas leaves no protection against zonal failures and does not meet the zero-data-loss requirement.
  • B. Using only same-region replicas with synchronous replication provides zonal protection but no regional disaster recovery capability.
  • D. Using asynchronous replication within the same region violates the requirement for zero data loss during zonal failures, and synchronous cross-region replication causes unacceptable latency and performance impact.

Question 15

Your organization is running a MySQL workload in Cloud SQL. Suddenly you see a degradation in database performance. You need to identify the root cause of the performance degradation. What should you do?

  1. Use Logs Explorer to analyze log data.
  2. Use Cloud Monitoring to monitor CPU, memory, and storage utilization metrics.
  3. Use Error Reporting to count, analyze, and aggregate the data.
  4. Use Cloud Debugger to inspect the state of an application.
Show answer and explanation

Correct answer: B. Use Cloud Monitoring to monitor CPU, memory, and storage utilization metrics.

Cloud Monitoring provides real-time metrics for CPU, memory, storage utilization, and database-specific performance indicators. These metrics directly identify resource bottlenecks causing performance degradation. This is the standard tool for diagnosing and monitoring Cloud SQL performance issues.

Why the other options are wrong

  • A. Logs Explorer analyzes log entries and events, not performance metrics; it doesn't provide the CPU, memory, and storage utilization data needed for diagnosis.
  • C. Error Reporting aggregates application errors and exceptions; it does not address database performance degradation metrics.
  • D. Cloud Debugger inspects application state during execution; it is not designed for database performance analysis.

Question 16

You work for a large retail and ecommerce company that is starting to extend their business globally. Your company plans to migrate to Google Cloud. You want to use platforms that will scale easily, handle transactions with the least amount of latency, and provide a reliable customer experience. You need a storage layer for sales transactions and current inventory levels. You want to retain the same relational schema that your existing platform uses. What should you do?

  1. Store your data in Firestore in a multi-region location, and place your compute resources in one of the constituent regions.
  2. Deploy Cloud Spanner using a multi-region instance, and place your compute resources close to the default leader region.
  3. Build an in-memory cache in Memorystore, and deploy to the specific geographic regions where your application resides.
  4. Deploy a Bigtable instance with a cluster in one region and a replica cluster in another geographic region.
Show answer and explanation

Correct answer: B. Deploy Cloud Spanner using a multi-region instance, and place your compute resources close to the default leader region.

Cloud Spanner is a globally distributed, horizontally scalable relational database with strong consistency and multi-region support. It handles transactional workloads with low latency across geographic regions, maintains relational schema compatibility, and provides automatic failover. Multi-region configuration ensures global scalability and places resources near the default leader for optimal transaction performance.

Why the other options are wrong

  • A. Firestore is a NoSQL document database; it does not preserve the relational schema structure required for existing transaction systems.
  • C. Memorystore is an in-memory cache layer, not a primary data store; it cannot replace the persistent relational storage layer needed for sales transactions and inventory.
  • D. Bigtable is a wide-column NoSQL database designed for time-series and analytics workloads, not relational transaction processing with low latency requirements.

Question 17

An analytics team needs to read data out of Cloud SQL for SQL Server and update a table in Cloud Spanner. You need to create a service account and grant least privilege access using predefined roles. What roles should you assign to the service account?

  1. roles/cloudsql.viewer and roles/spanner.databaseUser
  2. roles/cloudsql.editor and roles/spanner.admin
  3. roles/cloudsql.client and roles/spanner.databaseReader
  4. roles/cloudsql.instanceUser and roles/spanner.databaseUser
Show answer and explanation

Correct answer: D. roles/cloudsql.instanceUser and roles/spanner.databaseUser

To read data the service account must be able to connect to the Cloud SQL instance, which roles/cloudsql.instanceUser allows, while roles/cloudsql.viewer only exposes instance metadata. Updating a Spanner table needs read and write access to data, which roles/spanner.databaseUser grants without any administrative rights. This pair is the least privileged combination that covers both tasks.

Why the other options are wrong

  • A. roles/cloudsql.viewer only lets you see instance configuration and cannot connect to the database to read its data.
  • B. Editor and admin roles grant broad management permissions far beyond reading and updating data, breaking least privilege.
  • C. roles/spanner.databaseReader is read only, so the service account could not update the Spanner table.

Question 18

You are managing a small Cloud SQL instance for developers to do testing. The instance is not critical and has a recovery point objective (RPO) of several days. You want to minimize ongoing costs for this instance. What should you do?

  1. Take no backups, and turn off transaction log retention.
  2. Take one manual backup per day, and turn off transaction log retention.
  3. Turn on automated backup, and turn off transaction log retention.
  4. Turn on automated backup, and turn on transaction log retention.
Show answer and explanation

Correct answer: C. Turn on automated backup, and turn off transaction log retention.

Automated backups run daily with no manual effort and easily satisfy an RPO of several days. Point-in-time recovery is not needed for a non-critical test instance, so turning off transaction log retention avoids the extra storage cost of retaining logs. This gives adequate protection at the lowest ongoing cost and effort.

Why the other options are wrong

  • A. Taking no backups leaves no way to recover the instance at all, so even a multi-day RPO cannot be met.
  • B. Manual backups need someone to take them every day and are kept until deleted, adding effort and storage cost without any benefit.
  • D. Transaction log retention enables point-in-time recovery, which this instance does not need and which adds storage cost.

Question 19

Your company wants to move to Google Cloud. Your current data center is closing in six months. You are running a large, highly transactional Oracle application footprint on VMWare. You need to design a solution with minimal disruption to the current architecture and provide ease of migration to Google Cloud. What should you do?

  1. Migrate applications and Oracle databases to Google Cloud VMware Engine (VMware Engine).
  2. Migrate applications and Oracle databases to Compute Engine.
  3. Migrate applications to Cloud SQL.
  4. Migrate applications and Oracle databases to Google Kubernetes Engine (GKE).
Show answer and explanation

Correct answer: A. Migrate applications and Oracle databases to Google Cloud VMware Engine (VMware Engine).

Google Cloud VMware Engine provides a dedicated VMware environment in Google Cloud that allows running VMware workloads with minimal architectural changes. This lift-and-shift approach maintains the existing VMware infrastructure and Oracle database footprint without requiring application refactoring, making it ideal for a large, complex transactional Oracle application that needs minimal disruption during migration.

Why the other options are wrong

  • B. Migrating to Compute Engine would require significant refactoring of the VMware-based applications and infrastructure changes.
  • C. Cloud SQL is a managed relational database service and cannot run Oracle databases; it would require complete application and data migration strategy changes.
  • D. GKE is a Kubernetes platform requiring containerization and architectural redesign, introducing significant disruption contrary to the minimal-disruption requirement.

Question 20

You are designing a payments processing application on Google Cloud. The application must continue to serve requests and avoid any user disruption if a regional failure occurs. You need to use AES-256 to encrypt data in the database, and you want to control where you store the encryption key. What should you do?

  1. Use Cloud Spanner with a customer-managed encryption key (CMEK).
  2. Use Cloud Spanner with default encryption.
  3. Use Cloud SQL with a customer-managed encryption key (CMEK).
  4. Use Bigtable with default encryption.
Show answer and explanation

Correct answer: A. Use Cloud Spanner with a customer-managed encryption key (CMEK).

Cloud Spanner with CMEK is the correct choice for a payments processing application requiring regional failure resilience and customer-managed encryption. Cloud Spanner provides multi-region replication with automatic failover, ensuring no user disruption during regional outages. CMEK allows the organization to control encryption key storage and management. Cloud Spanner is specifically designed for globally distributed, mission-critical applications with high availability requirements.

Why the other options are wrong

  • B. Default encryption does not meet the requirement for customer-controlled key management.
  • C. Cloud SQL lacks multi-region automatic failover and is not designed for regional disaster recovery in the way required.
  • D. Bigtable with default encryption does not meet the encryption key control requirement and lacks the relational database features needed for payments processing.

Question 21

You are responsible for designing a new database for an airline ticketing application in Google Cloud. This application must be able to: Work with transactions and offer strong consistency. Work with structured and semi-structured (JSON) data. Scale transparently to multiple regions globally as the operation grows. You need a Google Cloud database that meets all the requirements of the application. What should you do?

  1. Use Cloud SQL for PostgreSQL with both cross-region read replicas.
  2. Use Cloud Spanner in a multi-region configuration.
  3. Use Firestore in Datastore mode.
  4. Use a Bigtable instance with clusters in multiple regions.
Show answer and explanation

Correct answer: B. Use Cloud Spanner in a multi-region configuration.

Cloud Spanner in multi-region configuration meets all requirements: it provides ACID transactions with strong consistency, supports both structured and semi-structured JSON data through its flexible schema capabilities, and scales transparently across multiple regions globally with automatic sharding. Cloud Spanner is specifically designed for globally distributed applications requiring these properties.

Why the other options are wrong

  • A. Cloud SQL with cross-region read replicas cannot scale transparently for writes across regions and lacks the global distribution capabilities of Spanner.
  • C. Firestore in Datastore mode is document-oriented and lacks the strong consistency guarantees and transaction support required.
  • D. Bigtable is a NoSQL key-value store without transaction support or strong consistency, unsuitable for transactional applications.

Question 22

Your retail organization is preparing for the holiday season. Use of catalog services is increasing, and your DevOps team is supporting the Cloud SQL databases that power a microservices-based application. The DevOps team has added instrumentation through Sqlcommenter. You need to identify the root cause of why certain microservice calls are failing. What should you do?

  1. Watch Query Insights for long running queries.
  2. Watch the Cloud SQL instance monitor for CPU utilization metrics.
  3. Watch the Cloud SQL recommenders for overprovisioned instances.
  4. Watch Cloud Trace for application requests that are failing.
Show answer and explanation

Correct answer: A. Watch Query Insights for long running queries.

Query Insights specifically analyzes SQL query performance and execution patterns, and when combined with Sqlcommenter instrumentation, it can correlate queries with application context and microservice calls. This allows you to identify which specific queries or microservice operations are causing failures by examining execution metrics, latency, and resource consumption directly tied to the instrumented requests.

Why the other options are wrong

  • B. CPU utilization metrics show instance-level health but do not identify which specific microservice calls are failing or why.
  • C. The recommender for overprovisioned instances addresses resource efficiency, not the root cause of microservice call failures.
  • D. Cloud Trace shows application request flows but lacks the deep SQL execution context that Query Insights provides when combined with Sqlcommenter.

Question 23

You released a popular mobile game and are using a 50 TB Cloud Spanner instance to store game data in a PITR-enabled production environment. When you analyzed the game statistics, you realized that some players are exploiting a loophole to gather more points to get on the leaderboard. Another DBA accidentally ran an emergency bugfix script that corrupted some of the data in the production environment. You need to determine the extent of the data corruption and restore the production environment. What should you do? (Choose two.)

  1. If the corruption is significant, use backup and restore, and specify a recovery timestamp.
  2. If the corruption is significant, perform a stale read and specify a recovery timestamp. Write the results back.
  3. If the corruption is significant, use import and export.
  4. If the corruption is insignificant, use backup and restore, and specify a recovery timestamp.
  5. If the corruption is insignificant, perform a stale read and specify a recovery timestamp. Write the results back.
Show answer and explanation

Correct answer: A, E. If the corruption is significant, use backup and restore, and specify a recovery timestamp; If the corruption is insignificant, perform a stale read and specify a recovery timestamp. Write the results back.

For significant data corruption, backup and restore with a recovery timestamp (option A) is the proper recovery mechanism, restoring the entire database to a known good point before corruption. For insignificant corruption, a stale read with a recovery timestamp (option E) allows the DBA to query historical data without full restore, then write back only the corrupted records. This minimizes downtime and data loss impact. The choice between them depends on corruption magnitude: full restore for widespread issues, stale read for isolated issues.

Why the other options are wrong

  • B. Stale reads are for querying historical data, not for recovery; writing results back without a proper backup creates risk of propagating corruption.
  • C. Import and export is a migration tool, not a recovery mechanism for data corruption.
  • D. Backup and restore should be used for significant corruption, not insignificant cases where targeted recovery is more efficient.

Question 24

Your company is shutting down their data center and migrating several MySQL and PostgreSQL databases to Google Cloud. Your database operations team is severely constrained by ongoing production releases and the lack of capacity for additional on-premises backups. You want to ensure that the scheduled migrations happen with minimal downtime and that the Google Cloud databases stay in sync with the on-premises data changes until the applications can cut over. What should you do? (Choose two.)

  1. Use Database Migration Service to migrate the databases to Cloud SQL.
  2. Use a cross-region read replica to migrate the databases to Cloud SQL.
  3. Use replication from an external server to migrate the databases to Cloud SQL.
  4. Use an external read replica to migrate the databases to Cloud SQL.
  5. Use a read replica to migrate the databases to Cloud SQL.
Show answer and explanation

Correct answer: A, C. Use Database Migration Service to migrate the databases to Cloud SQL; Use replication from an external server to migrate the databases to Cloud SQL.

Database Migration Service (option A) is the primary tool for migrating databases from on-premises to Cloud SQL with minimal downtime, supporting both one-time and continuous replication modes. Replication from an external server (option C) enables the on-premises database to continue functioning as the source while Cloud SQL acts as a replica, keeping data synchronized until cutover. Together, these options provide the zero-downtime migration capability with ongoing synchronization required for the scenario. Cross-region and external read replicas are Cloud SQL-to-Cloud SQL features, not on-premises-to-Cloud SQL solutions, and a standard read replica cannot be created from an external source.

Why the other options are wrong

  • B. Cross-region read replicas are used between Cloud SQL instances, not for on-premises to Cloud SQL migration.
  • D. External read replicas do not support on-premises source databases.
  • E. Standard read replicas are only for replicating between Cloud SQL instances, not from on-premises sources.

Question 25

Your company is migrating their MySQL database to Cloud SQL and cannot afford any planned downtime during the month of December. The company is also concerned with cost, so you need the most cost-effective solution. What should you do?

  1. Open a support ticket in Google Cloud to prevent any maintenance in that MySQL instance during the month of December.
  2. Use Cloud SQL maintenance settings to prevent any maintenance during the month of December.
  3. Create MySQL read replicas in different zones so that, if any downtime occurs, the read replicas will act as the primary instance during the month of December.
  4. Create a MySQL regional instance so that, if any downtime occurs, the standby instance will act as the primary instance during the month of December.
Show answer and explanation

Correct answer: B. Use Cloud SQL maintenance settings to prevent any maintenance during the month of December.

Cloud SQL maintenance settings allow you to configure maintenance windows and prevent maintenance during specific periods, such as December. This is the most cost-effective solution as it avoids support tickets and does not require infrastructure changes like creating replicas or upgrading to regional instances.

Why the other options are wrong

  • A. Opening a support ticket is not a scalable or guaranteed method to prevent maintenance, and support tickets may not guarantee compliance with business requirements.
  • C. Creating read replicas does not prevent maintenance-related downtime on the primary instance and adds unnecessary cost.
  • D. A regional instance with a standby does provide high availability but is more expensive than simply configuring maintenance windows and still allows Google-scheduled maintenance.

25 questions in. Want the rest? The first half of the pack, free by email · The full pack

Question 26

You are building an Android game that needs to store data on a Google Cloud serverless database. The database will log user activity, store user preferences, and receive in-game updates. The target audience resides in developing countries that have intermittent internet connectivity. You need to ensure that the game can synchronize game data to the backend database whenever an internet network is available. What should you do?

  1. Use Firestore.
  2. Use Cloud SQL with an external (public) IP address.
  3. Use an in-app embedded database.
  4. Use Cloud Spanner.
Show answer and explanation

Correct answer: A. Use Firestore.

Firestore is the correct choice because it natively supports offline data synchronization through its offline persistence feature. Mobile apps can write data locally while offline, and Firestore automatically synchronizes to the backend once connectivity is restored. This is specifically designed for mobile applications in low-connectivity environments. Cloud SQL requires continuous connectivity and external IP exposure creates security risks. Cloud Spanner is for distributed relational workloads, not mobile offline scenarios. An embedded database alone cannot sync to the backend.

Why the other options are wrong

  • B. Cloud SQL requires persistent connectivity and exposing a public IP introduces significant security vulnerabilities for a mobile game.
  • C. An embedded database alone cannot synchronize to a backend cloud database.
  • D. Cloud Spanner is designed for distributed transactional workloads, not mobile offline-first synchronization patterns.

Question 27

Your organization has a busy transactional Cloud SQL for MySQL instance. Your analytics team needs access to the data so they can build monthly sales reports. You need to provide data access to the analytics team without adversely affecting performance. What should you do?

  1. Create a read replica of the database, provide the database IP address, username, and password to the analytics team, and grant read access to required tables to the team.
  2. Create a read replica of the database, enable the cloudsql.iam_authentication flag on the replica, and grant read access to required tables to the analytics team.
  3. Enable the cloudsql.iam_authentication flag on the primary database instance, and grant read access to required tables to the analytics team.
  4. Provide the database IP address, username, and password of the primary database instance to the analytics, team, and grant read access to required tables to the team.
Show answer and explanation

Correct answer: B. Create a read replica of the database, enable the cloudsql.iam_authentication flag on the replica, and grant read access to required tables to the analytics team.

Creating a read replica and enabling the cloudsql.iam_authentication flag provides the analytics team with secure, IAM-based access without exposing passwords or directly impacting the primary instance. IAM authentication is more secure than password-based access and allows fine-grained permission control through Google Cloud's identity management system.

Why the other options are wrong

  • A. While read replicas isolate analytics workloads from the primary instance, using passwords and IP addresses is less secure than IAM authentication.
  • C. Enabling IAM authentication on the primary instance may still expose it to analytics queries, potentially affecting performance despite having a dedicated replica.
  • D. Providing direct access to the primary instance risks performance degradation from analytics workloads and uses insecure password-based authentication rather than IAM.

Question 28

You work for a financial services company that wants to use fully managed database services. Traffic volume for your consumer services products has increased annually at a constant rate with occasional spikes around holidays. You frequently need to upgrade the capacity of your database. You want to use Cloud Spanner and include an automated method to increase your hardware capacity to support a higher level of concurrency. What should you do?

  1. Use linear scaling to implement the Autoscaler-based architecture
  2. Use direct scaling to implement the Autoscaler-based architecture.
  3. Upgrade the Cloud Spanner instance on a periodic basis during the scheduled maintenance window.
  4. Set up alerts that are triggered when Cloud Spanner utilization metrics breach the threshold, and then schedule an upgrade during the scheduled maintenance window.
Show answer and explanation

Correct answer: A. Use linear scaling to implement the Autoscaler-based architecture

Linear scaling through an Autoscaler-based architecture provides automated capacity increases based on metrics and predefined rules, allowing Cloud Spanner to handle increasing concurrency without manual intervention. This automation is ideal for constant growth with occasional spikes, as it scales proportionally to demand rather than requiring periodic manual upgrades.

Why the other options are wrong

  • B. Direct scaling is not a standard Cloud Spanner scaling approach; linear scaling with autoscaling is the recommended automated method.
  • C. Periodic upgrades during maintenance windows require manual planning and do not provide the automation needed for variable traffic patterns.
  • D. Manually scheduled upgrades based on alerts require operational overhead and do not provide the automated, responsive scaling that linear autoscaling provides.

Question 29

Your hotel booking company is expanding into Country A, where personally identifiable information (PII) must comply with regional data residency requirements and audits. You need to isolate customer data in Country A from the rest of the customer data. You want to design a multi-tenancy strategy to efficiently manage costs and operations. What should you do?

  1. Apply a schema data management pattern.
  2. Apply an instance data management pattern.
  3. Apply a table data management pattern.
  4. Apply a database data management pattern.
Show answer and explanation

Correct answer: B. Apply an instance data management pattern.

An instance data management pattern creates separate database instances for different tenants, which is the appropriate choice when data residency requirements mandate complete isolation between countries. This ensures customer data in Country A remains completely isolated from other customer data, meeting compliance requirements while maintaining operational efficiency through dedicated instances.

Why the other options are wrong

  • A. A schema data management pattern uses separate schemas within the same instance, which does not provide the complete isolation required for regional data residency compliance.
  • C. A table data management pattern uses row-level isolation within shared tables, which does not provide sufficient isolation for strict data residency requirements.
  • D. A database data management pattern is synonymous with the instance pattern and would work similarly, but instance pattern is the standard terminology for this isolation strategy.

Question 30

You need to migrate existing databases from Microsoft SQL Server 2016 Standard Edition on a single Windows Server 2019 Datacenter Edition to a single Cloud SQL for SQL Server instance. During the discovery phase of your project, you notice that your on-premises server peaks at around 25,000 read IOPS. You need to ensure that your Cloud SQL instance is sized appropriately to maximize read performance. What should you do?

  1. Create a SQL Server 2019 Standard on Standard machine type with 4 vCPUs, 15 GB of RAM, and 800 GB of solid-state drive (SSD).
  2. Create a SQL Server 2019 Standard on High Memory machine type with at least 16 vCPUs, 104 GB of RAM, and 200 GB of SSD.
  3. Create a SQL Server 2019 Standard on High Memory machine type with 16 vCPUs, 104 GB of RAM, and 4 TB of SSD.
  4. Create a SQL Server 2019 Enterprise on High Memory machine type with 16 vCPUs, 104 GB of RAM, and 500 GB of SSD.
Show answer and explanation

Correct answer: C. Create a SQL Server 2019 Standard on High Memory machine type with 16 vCPUs, 104 GB of RAM, and 4 TB of SSD.

With 25,000 read IOPS peak demand, the instance requires both sufficient compute and storage capacity to handle this workload. Option C specifies a High Memory machine type with 16 vCPUs and 104 GB of RAM, which provides adequate computational resources for processing high-volume read operations, combined with 4 TB of SSD storage. The larger SSD capacity ensures sufficient I/O throughput capacity, Cloud SQL's IOPS performance scales with storage size, and 4 TB is necessary to support 25,000 read IOPS. SQL Server 2019 Standard Edition is appropriate since it supports the required performance tier, and High Memory machine types are optimized for database workloads with large working sets.

Why the other options are wrong

  • A. Standard machine type with only 4 vCPUs and 15 GB RAM is severely undersized for a 25,000 read IOPS workload and lacks the computational capacity needed.
  • B. While High Memory with appropriate vCPU and RAM configuration is correct, 200 GB of SSD storage is insufficient; Cloud SQL IOPS capacity scales with storage, and this size cannot deliver the required 25,000 read IOPS.
  • D. Enterprise Edition is unnecessary, the workload does not require Enterprise-specific features, and 500 GB of SSD is still insufficient to support 25,000 read IOPS compared to the 4 TB option.

Question 31

Your customer is running a MySQL database on-premises with read replicas. The nightly incremental backups are expensive and add maintenance overhead. You want to follow Google-recommended practices to migrate the database to Google Cloud, and you need to ensure minimal downtime. What should you do?

  1. Create a Google Kubernetes Engine (GKE) cluster, install MySQL on the cluster, and then import the dump file.
  2. Use the mysqldump utility to take a backup of the existing on-premises database, and then import it into Cloud SQL.
  3. Create a Compute Engine VM, install MySQL on the VM, and then import the dump file.
  4. Create an external replica, and use Cloud SQL to synchronize the data to the replica.
Show answer and explanation

Correct answer: D. Create an external replica, and use Cloud SQL to synchronize the data to the replica.

Creating an external replica follows Google-recommended migration practices for minimal downtime. Cloud SQL can synchronize data with an external on-premises replica, maintaining consistency during the transition. This approach allows the on-premises system to continue serving users while data syncs, then the application can be cutover to Cloud SQL with minimal interruption, eliminating expensive nightly backups and maintenance overhead.

Why the other options are wrong

  • A. Installing MySQL on GKE adds unnecessary operational complexity and lacks the managed benefits of Cloud SQL.
  • B. mysqldump creates a one-time snapshot that does not minimize downtime during migration.
  • C. Installing MySQL on a Compute Engine VM requires ongoing maintenance and does not follow Google-recommended managed solutions.

Question 32

You need to redesign the architecture of an application that currently uses Cloud SQL for PostgreSQL. The users of the application complain about slow query response times. You want to enhance your application architecture to offer sub-millisecond query latency. What should you do?

  1. Configure Firestore, and modify your application to offload queries.
  2. Configure Bigtable, and modify your application to offload queries.
  3. Configure Cloud SQL for PostgreSQL read replicas to offload queries.
  4. Configure Memorystore, and modify your application to offload queries.
Show answer and explanation

Correct answer: D. Configure Memorystore, and modify your application to offload queries.

Memorystore provides sub-millisecond query latency through in-memory caching (Redis or Memcached). For applications experiencing slow query response times, Memorystore acts as a cache layer between the application and Cloud SQL, serving frequently accessed data from memory rather than disk. The application must be modified to check Memorystore before querying the database, offloading read queries from the primary database. This is the standard approach for achieving sub-millisecond latency in database-backed applications.

Why the other options are wrong

  • A. Firestore is a NoSQL document database, not a cache; migrating to it requires significant application redesign and does not directly solve existing SQL query performance.
  • B. Bigtable is optimized for time-series and analytical workloads, not for offloading transactional SQL queries or achieving sub-millisecond latency for typical queries.
  • C. Read replicas distribute load but do not reduce query latency; they still query a database rather than serving from memory.

Question 33

Your organization has a production Cloud SQL for MySQL instance. Your instance is configured with 16 vCPUs and 104 GB of RAM that is running between 90% and 100% CPU utilization for most of the day. You need to scale up the database and add vCPUs with minimal interruption and effort. What should you do?

  1. Issue a gcloud sql instances patch command to increase the number of vCPUs.
  2. Update a MySQL database flag to increase the number of vCPUs.
  3. Issue a gcloud compute instances update command to increase the number of vCPUs.
  4. Back up the database, create an instance with additional vCPUs, and restore the database.
Show answer and explanation

Correct answer: A. Issue a gcloud sql instances patch command to increase the number of vCPUs.

The gcloud sql instances patch command allows you to increase vCPUs on a Cloud SQL instance with minimal downtime. Cloud SQL supports online scaling where the primary instance briefly becomes unavailable during the scale operation, then recovers automatically. This is the official Google-recommended method for scaling CPU resources on running instances.

Why the other options are wrong

  • B. MySQL database flags do not control vCPU allocation; flags configure database behavior, not infrastructure resources.
  • C. The gcloud compute instances update command is for Compute Engine VMs, not Cloud SQL managed instances.
  • D. Manual backup, create, and restore is time-consuming and unnecessary when online scaling is available.

Question 34

You are designing a database architecture for a global application that stores information about public parks worldwide. The application uses the database for read-only purposes, and a centralized batch job updates the database nightly. You want to select an open source, SQL-compliant database. What should you do?

  1. Use Bigtable with multi-region clusters.
  2. Use Memorystore for Redis with multi-zones within a region.
  3. Use Cloud SQL for PostgreSQL with cross-region replicas.
  4. Use Cloud Spanner with multi-region configuration.
Show answer and explanation

Correct answer: C. Use Cloud SQL for PostgreSQL with cross-region replicas.

Cloud SQL for PostgreSQL with cross-region replicas is the correct choice because it meets all requirements: it is open source, SQL-compliant, suitable for read-heavy workloads with nightly batch updates, and provides global availability through cross-region replicas. PostgreSQL is a fully managed SQL database that handles the read-only access pattern efficiently while allowing centralized batch updates.

Why the other options are wrong

  • A. Bigtable is a NoSQL database, not SQL-compliant, making it unsuitable for SQL-based applications.
  • B. Memorystore for Redis is an in-memory cache, not a persistent SQL database, and cannot serve as the primary datastore.
  • D. Cloud Spanner is proprietary Google technology, not open source as required by the specification.

Question 35

You are managing a Cloud SQL for MySQL environment in Google Cloud. You have deployed a primary instance in Zone A and a read replica instance in Zone B, both in the same region. You are notified that the replica instance in Zone B was unavailable for 10 minutes. You need to ensure that the read replica instance is still working. What should you do?

  1. Use the Google Cloud Console or gcloud CLI to manually create a new clone database.
  2. Use the Google Cloud Console or gcloud CLI to manually create a new failover replica from backup.
  3. Verify that the new replica is created automatically.
  4. Start the original primary instance and resume replication.
Show answer and explanation

Correct answer: C. Verify that the new replica is created automatically.

Cloud SQL read replicas are automatically recreated if they become unavailable. When a replica instance goes down, Cloud SQL automatically creates a new replica instance in the specified zone to restore redundancy and replication. Verification that the new replica has been created automatically is the appropriate next step after a temporary outage. No manual intervention is required for this type of transient failure.

Why the other options are wrong

  • A. Manually creating a new clone database is unnecessary when Cloud SQL automatically recreates failed replicas.
  • B. A failover replica is used for primary instance failover, not for recovering a failed read replica.
  • D. The primary instance does not need to be restarted; replication resumes automatically when the replica becomes available again.

Question 36

You are writing an application that will run on Cloud Run and require a database running in the Cloud SQL managed service. You want to secure this instance so that it only receives connections from applications running in your VPC environment in Google Cloud. What should you do?

  1. 1. Create your instance with a specified external (public) IP address. 2. Choose the VPC and create firewall rules to allow only connections from Cloud Run into your instance. 3. Use Cloud SQL Auth proxy to connect to the instance.
  2. 1. Create your instance with a specified external (public) IP address. 2. Choose the VPC and create firewall rules to allow only connections from Cloud Run into your instance. 3. Connect to the instance using a connection pool to best manage connections to the instance.
  3. 1. Create your instance with a specified internal (private) IP address. 2. Choose the VPC with private service connection configured. 3. Configure the Serverless VPC Access connector in the same VPC network as your Cloud SQL instance. 4. Use Cloud SQL Auth proxy to connect to the instance.
  4. 1. Create your instance with a specified internal (private) IP address. 2. Choose the VPC with private service connection configured. 3. Configure the Serverless VPC Access connector in the same VPC network as your Cloud SQL instance. 4. Connect to the instance using a connection pool to best manage connections to the instance.
Show answer and explanation

Correct answer: C. 1. Create your instance with a specified internal (private) IP address. 2. Choose the VPC with private service connection configured. 3. Configure the Serverless VPC Access connector in the same VPC network as your Cloud SQL instance. 4. Use Cloud SQL Auth proxy to connect to the instance.

To securely connect Cloud Run to Cloud SQL with VPC-only access, you must use a private IP address with private service connection. The Serverless VPC Access connector in the same VPC allows Cloud Run to reach the private Cloud SQL instance. Cloud SQL Auth proxy provides secure authentication using the service account's credentials. This configuration prevents any public internet exposure of the database.

Why the other options are wrong

  • A. Using a public IP address with firewall rules exposes the instance to the internet and contradicts the requirement for VPC-only access.
  • B. Public IP addresses and firewall rules do not meet the requirement for VPC-only access; connection pooling does not replace Auth proxy security.
  • D. While private IP and Serverless VPC Access connector are correct, connection pooling cannot replace Auth proxy, which provides credential-based authentication.

Question 37

Your company has PostgreSQL databases on-premises and on Amazon Web Services (AWS). You are planning multiple database migrations to Cloud SQL in an effort to reduce costs and downtime. You want to follow Google-recommended practices and use Google native data migration tools. You also want to closely monitor the migrations as part of the cutover strategy. What should you do?

  1. Use Database Migration Service to migrate all databases to Cloud SQL.
  2. Use Database Migration Service for one-time migrations, and use third-party or partner tools for change data capture (CDC) style migrations.
  3. Use data replication tools and CDC tools to enable migration.
  4. Use a combination of Database Migration Service and partner tools to support the data migration strategy.
Show answer and explanation

Correct answer: A. Use Database Migration Service to migrate all databases to Cloud SQL.

Database Migration Service is Google's native tool designed for heterogeneous database migrations including on-premises and AWS sources to Cloud SQL. It supports continuous replication for cutover monitoring and minimal downtime, and handles both one-time and CDC-style migrations. Using a single Google-native tool aligns with the requirement to use Google native tools while providing close monitoring during cutover.

Why the other options are wrong

  • B. Splitting migrations between Database Migration Service and third-party tools violates the requirement to use Google native tools and complicates monitoring strategy.
  • C. Relying solely on generic replication and CDC tools bypasses Google's purpose-built migration service and reduces enterprise support coverage.
  • D. Combining Database Migration Service with partner tools unnecessarily complicates the architecture when Database Migration Service alone handles all stated requirements.

Question 38

Your organization is running a low-latency reporting application on Microsoft SQL Server. In addition to the database engine, you are using SQL Server Analysis Services (SSAS), SQL Server Reporting Services (SSRS), and SQL Server Integration Services (SSIS) in your on-premises environment. You want to migrate your Microsoft SQL Server database instances to Google Cloud. You need to ensure minimal disruption to the existing architecture during migration. What should you do?

  1. Migrate to Cloud SQL for SQL Server.
  2. Migrate to Cloud SQL for PostgreSQL.
  3. Migrate to Compute Engine.
  4. Migrate to Google Kubernetes Engine (GKE).
Show answer and explanation

Correct answer: C. Migrate to Compute Engine.

The organization uses SQL Server Analysis Services (SSAS), Reporting Services (SSRS), and Integration Services (SSIS) alongside the database engine. These SQL Server ecosystem components are not available in Cloud SQL for SQL Server, which only supports the database engine. Migrating to Compute Engine allows you to run the complete SQL Server stack including all these services, ensuring minimal architectural disruption during migration.

Why the other options are wrong

  • A. Cloud SQL for SQL Server does not support SSAS, SSRS, or SSIS components.
  • B. Cloud SQL for PostgreSQL is incompatible with Microsoft SQL Server applications and ecosystem tools.
  • D. GKE adds unnecessary containerization complexity and doesn't align with the existing SQL Server architecture.

Question 39

Your organization has an existing app that just went viral. The app uses a Cloud SQL for MySQL backend database that is experiencing slow disk performance while using hard disk drives (HDDs). You need to improve performance and reduce disk I/O wait times. What should you do?

  1. Export the data from the existing instance, and import the data into a new instance with solid-state drives (SSDs).
  2. Edit the instance to change the storage type from HDD to SSD.
  3. Create a high availability (HA) failover instance with SSDs, and perform a failover to the new instance.
  4. Create a read replica of the instance with SSDs, and perform a failover to the new instance
Show answer and explanation

Correct answer: A. Export the data from the existing instance, and import the data into a new instance with solid-state drives (SSDs).

The storage type of a Cloud SQL instance cannot be changed after the instance is created. To move from HDD to SSD you create a new instance with SSD storage, export the data from the existing instance and import it into the new one.

Why the other options are wrong

  • B. Cloud SQL does not allow the storage type to be edited on an existing instance.
  • C. An HA standby always uses the same configuration as the primary, so you cannot create an SSD standby for an HDD instance.
  • D. A read replica cannot be given a different storage type to switch the primary from HDD to SSD.

Question 40

Your team is running a Cloud SQL for MySQL instance with a 5 TB database that must be available 24/7. You need to save database backups on object storage with minimal operational overhead or risk to your production workloads. What should you do?

  1. Use Cloud SQL serverless exports.
  2. Create a read replica, and then use the mysqldump utility to export each table.
  3. Clone the Cloud SQL instance, and then use the mysqldump utlity to export the data.
  4. Use the mysqldump utility on the primary database instance to export the backup.
Show answer and explanation

Correct answer: A. Use Cloud SQL serverless exports.

Cloud SQL serverless exports provide automated, minimal-overhead backup to Cloud Storage without impacting production workloads. This service is specifically designed for large databases requiring 24/7 availability, as exports run asynchronously on Google-managed infrastructure rather than consuming resources from the primary instance. Serverless exports eliminate operational overhead while maintaining production performance.

Why the other options are wrong

  • B. Creating a read replica and using mysqldump still consumes resources and creates operational complexity for a 5TB database.
  • C. Cloning the instance creates a full copy consuming significant resources and storage costs, introducing unnecessary overhead.
  • D. Running mysqldump directly on the production instance risks performance degradation and availability issues for a 5TB database.

Question 41

You are setting up a Bare Metal Solution environment. You need to update the operating system to the latest version. You need to connect the Bare Metal Solution environment to the internet so you can receive software updates. What should you do?

  1. Setup a static external IP address in your VPC network.
  2. Set up bring your own IP (BYOIP) in your VPC.
  3. Set up a Cloud NAT gateway on the Compute Engine VM.
  4. Set up Cloud NAT service.
Show answer and explanation

Correct answer: D. Set up Cloud NAT service.

Cloud NAT service provides outbound internet access for resources that need to download software updates without exposing them to inbound internet traffic. It operates at the VPC network level and is the standard solution for enabling internet connectivity from Bare Metal Solution environments for receiving operating system and software updates.

Why the other options are wrong

  • A. Static external IP addresses are for inbound access; they would expose the Bare Metal Solution unnecessarily to the internet.
  • B. BYOIP is for bringing existing IP ranges to Google Cloud; it doesn't solve the internet connectivity problem for outbound updates.
  • C. Cloud NAT must be configured on a Cloud Router, not on Compute Engine VMs; this option describes an incorrect implementation.

Question 42

You are choosing a database backend for a new application. The application will ingest data points from IoT sensors. You need to ensure that the application can scale up to millions of requests per second with sub-10ms latency and store up to 100 TB of history. What should you do?

  1. Use Cloud SQL with read replicas for throughput.
  2. Use Firestore, and rely on automatic serverless scaling.
  3. Use Memorystore for Memcached, and add nodes as necessary to achieve the required throughput.
  4. Use Bigtable, and add nodes as necessary to achieve the required throughput.
Show answer and explanation

Correct answer: D. Use Bigtable, and add nodes as necessary to achieve the required throughput.

Bigtable is purpose-built for handling millions of requests per second with sub-10ms latency and scales to store hundreds of terabytes of data. It is optimized for time-series and analytical workloads like IoT sensor data ingestion. Adding nodes allows horizontal scaling to meet the throughput requirements. Bigtable's columnar storage and distributed architecture make it ideal for this use case.

Why the other options are wrong

  • A. Cloud SQL cannot scale to millions of requests per second; read replicas have limitations on throughput scaling.
  • B. Firestore, while serverless and scalable, is optimized for document data rather than time-series data and has different performance characteristics.
  • C. Memorystore for Memcached is an in-memory cache, not a persistent database; it cannot store 100 TB of history and is not suitable as a primary data store.

Question 43

You are migrating an on-premises application to Google Cloud. The application requires a high availability (HA) PostgreSQL database to support business-critical functions. Your company's disaster recovery strategy requires a recovery time objective (RTO) and recovery point objective (RPO) within 30 minutes of failure. You plan to use a Google Cloud managed service. What should you do to maximize uptime for your application?

  1. Deploy Cloud SQL for PostgreSQL in a regional configuration. Create a read replica in a different zone in the same region and a read replica in another region for disaster recovery.
  2. Deploy Cloud SQL for PostgreSQL in a regional configuration with HA enabled. Take periodic backups, and use this backup to restore to a new Cloud SQL for PostgreSQL instance in another region during a disaster recovery event.
  3. Deploy Cloud SQL for PostgreSQL in a regional configuration with HA enabled. Create a cross-region read replica, and promote the read replica as the primary node for disaster recovery.
  4. Migrate the PostgreSQL database to multi-regional Cloud Spanner so that a single region outage will not affect your application. Update the schema to support Cloud Spanner data types, and refactor the application.
Show answer and explanation

Correct answer: C. Deploy Cloud SQL for PostgreSQL in a regional configuration with HA enabled. Create a cross-region read replica, and promote the read replica as the primary node for disaster recovery.

Deploying Cloud SQL for PostgreSQL with regional HA enabled provides automatic failover within the region, meeting the RTO requirement. Creating a cross-region read replica allows promotion to a primary instance in another region during disaster recovery, meeting the RPO requirement of 30 minutes. This configuration balances high availability for normal operations with disaster recovery capability for regional outages, without requiring schema changes or application refactoring.

Why the other options are wrong

  • A. A read replica in the same region does not protect against regional failure; only the cross-region replica provides disaster recovery capability.
  • B. Relying on backup restoration can exceed the 30-minute RTO requirement due to restore time; a pre-promoted read replica is faster.
  • D. Migrating to Cloud Spanner introduces unnecessary complexity, requires schema modifications and application refactoring, and is overkill for the stated requirements.

Question 44

Your organization has a critical business app that is running with a Cloud SQL for MySQL backend database. Your company wants to build the most fault-tolerant and highly available solution possible. You need to ensure that the application database can survive a zonal and regional failure with a primary region of us-central1 and the backup region of us-east1. What should you do?

  1. 1. Provision a Cloud SQL for MySQL instance in us-central1-a. 2. Create a multiple-zone instance in us-west1-b. 3. Create a read replica in us-east1-c.
  2. 1. Provision a Cloud SQL for MySQL instance in us-central1-a. 2. Create a multiple-zone instance in us-central1-b. 3. Create a read replica in us-east1-b.
  3. 1. Provision a Cloud SQL for MySQL instance in us-central1-a. 2. Create a multiple-zone instance in us-east-b. 3. Create a read replica in us-east1-c.
  4. 1. Provision a Cloud SQL for MySQL instance in us-central1-a. 2. Create a multiple-zone instance in us-east1-b. 3. Create a read replica in us-central1-b.
Show answer and explanation

Correct answer: B. 1. Provision a Cloud SQL for MySQL instance in us-central1-a. 2. Create a multiple-zone instance in us-central1-b. 3. Create a read replica in us-east1-b.

To survive both zonal and regional failures, the solution must include: a primary instance in us-central1-a (primary zone), a multiple-zone instance that fails over within the same region (us-central1-b), and a read replica in a different region (us-east1-b). The multiple-zone instance provides zonal failover, while the cross-region read replica enables recovery from regional failures. This configuration ensures the application can promote the read replica to primary if the entire us-central1 region fails.

Why the other options are wrong

  • A. Uses us-west1 instead of us-east1 as the backup region, violating the stated requirement.
  • C. Creates the multiple-zone instance in us-east (incomplete zone specification) and places both replicas outside the primary region.
  • D. Places the read replica back in the primary region (us-central1-b), providing no regional redundancy.

Question 45

You are using Compute Engine on Google Cloud and your data center to manage a set of MySQL databases in a hybrid configuration. You need to create replicas to scale reads and to offload part of the management operation. What should you do?

  1. Use external server replication.
  2. Use Data Migration Service.
  3. Use Cloud SQL for MySQL external replica.
  4. Use the mysqldump utility and binary logs.
Show answer and explanation

Correct answer: C. Use Cloud SQL for MySQL external replica.

Cloud SQL for MySQL external replica is the correct solution for creating replicas from an on-premises MySQL database in a hybrid configuration. This feature allows you to configure a Cloud SQL instance as a read replica of your on-premises MySQL database, enabling read scaling and offloading of management operations while maintaining the source as on-premises. External replication is the underlying technology, but option C describes the specific Cloud SQL feature. Data Migration Service is for one-time migrations, not ongoing replication. mysqldump with binary logs is manual and not scalable for replica management.

Why the other options are wrong

  • A. External server replication is a general concept but not the specific Cloud SQL feature for this use case.
  • B. Data Migration Service is designed for one-time data migration, not for creating ongoing read replicas.
  • D. Using mysqldump and binary logs is a manual approach that doesn't provide the automated replica management of Cloud SQL external replicas.

Question 46

Your organization stores marketing data such as customer preferences and purchase history on Bigtable. The consumers of this database are predominantly data analysts and operations users. You receive a service ticket from the database operations department citing poor database performance between 9 AM-10 AM every day. The application team has confirmed no latency from their logs. A new cohort of pilot users that is testing a dataset loaded from a third-party data provider is experiencing poor database performance. Other users are not affected. You need to troubleshoot the issue. What should you do?

  1. Isolate the data analysts and operations user groups to use different Bigtable instances.
  2. Check the Cloud Monitoring table/bytes_used metric from Bigtable.
  3. Use Key Visualizer for Bigtable.
  4. Add more nodes to the Bigtable cluster.
Show answer and explanation

Correct answer: C. Use Key Visualizer for Bigtable.

Key Visualizer for Bigtable is the primary diagnostic tool for identifying hot keys and uneven data distribution patterns that cause performance issues. Since only the new pilot users with third-party data are affected, Key Visualizer will reveal if the new dataset has poor key distribution or hotspots that are causing the 9-10 AM performance degradation.

Why the other options are wrong

  • A. Isolating user groups into separate instances is a solution, not a troubleshooting step, and does not identify the root cause of the performance issue.
  • B. The bytes_used metric shows capacity usage but does not identify hotspots or key distribution problems that cause latency.
  • D. Adding more nodes does not address the underlying issue if the problem is poor key distribution; it wastes resources without solving the root cause.

Question 47

You work in the logistics department. Your data analysis team needs daily extracts from Cloud SQL for MySQL to train a machine learning model. The model will be used to optimize next-day routes. You need to export the data in CSV format. You want to follow Google-recommended practices. What should you do?

  1. Use Cloud Scheduler to trigger a Cloud Function that will run a select * from table(s) query to call the cloudsql.instances.export API.
  2. Use Cloud Scheduler to trigger a Cloud Function through Pub/Sub to call the cloudsql.instances.export API.
  3. Use Cloud Composer to orchestrate an export by calling the cloudsql.instances.export API.
  4. Use Cloud Composer to execute a select * from table(s) query and export results.
Show answer and explanation

Correct answer: B. Use Cloud Scheduler to trigger a Cloud Function through Pub/Sub to call the cloudsql.instances.export API.

Google's documented pattern for scheduled Cloud SQL exports is Cloud Scheduler publishing to a Pub/Sub topic, which triggers a Cloud Function that calls the cloudsql.instances.export API. The export API writes the CSV straight to Cloud Storage, so the function does not need to run queries itself. This is lightweight, serverless and fully managed.

Why the other options are wrong

  • A. The function should call the export API rather than run a select query itself, and this skips the recommended Pub/Sub trigger.
  • C. Cloud Composer is a heavyweight orchestration service that is unnecessary and costly for a single daily export.
  • D. Running a select query from Cloud Composer bypasses the managed export API and adds needless orchestration overhead.

Question 48

Your company uses the Cloud SQL out-of-disk recommender to analyze the storage utilization trends of production databases over the last 30 days. Your database operations team uses these recommendations to proactively monitor storage utilization and implement corrective actions. You receive a recommendation that the instance is likely to run out of disk space. What should you do to address this storage alert?

  1. Normalize the database to the third normal form.
  2. Compress the data using a different compression algorithm.
  3. Manually or automatically increase the storage capacity.
  4. Create another schema to load older data.
Show answer and explanation

Correct answer: C. Manually or automatically increase the storage capacity.

When the Cloud SQL out-of-disk recommender alerts you that an instance is likely to run out of disk space, the immediate and correct action is to manually or automatically increase the storage capacity. Cloud SQL supports automatic storage increases, and this directly addresses the capacity issue. While database optimization techniques like normalization and compression might help long-term, they don't address the imminent storage shortage and can introduce complexity. Creating another schema for older data is a workaround that doesn't solve the underlying capacity problem and adds operational burden.

Why the other options are wrong

  • A. Normalizing to third normal form is a schema design exercise that doesn't directly address the storage capacity alert.
  • B. Compression might provide some relief but is not a reliable solution for an imminent out-of-disk condition.
  • D. Creating another schema does not increase capacity and adds complexity without solving the core issue.

Question 49

You are configuring a new application that has access to an existing Cloud Spanner database. The new application reads from this database to gather statistics for a dashboard. You want to follow Google-recommended practices when granting Identity and Access Management (IAM) permissions. What should you do?

  1. Reuse the existing service account that populates this database.
  2. Create a new service account, and grant it the Cloud Spanner Database Admin role.
  3. Create a new service account, and grant it the Cloud Spanner Database Reader role.
  4. Create a new service account, and grant it the spanner.databases.select permission.
Show answer and explanation

Correct answer: C. Create a new service account, and grant it the Cloud Spanner Database Reader role.

Google-recommended practices require granting the minimum necessary permissions. Since the new application only reads statistics from the database, it should receive the Cloud Spanner Database Reader role, which provides read-only access. This follows the principle of least privilege and reduces security risk compared to broader roles or reusing service accounts.

Why the other options are wrong

  • A. Reusing the existing service account violates least privilege and could grant unnecessary write permissions to the new application.
  • B. The Database Admin role grants excessive permissions for a read-only application, violating least privilege principles.
  • D. The spanner.databases.select permission is lower-level but less manageable than using the predefined Database Reader role.

That was 49 of 197.

The full Google Professional Cloud Database Engineer pack has all 197 questions, each with the answer, the explanation and why the other options are wrong, plus a questions-only copy for timed runs. US$39, paid once, with free monthly updates and a pass-or-your-money-back guarantee.

Get the full pack

Not ready yet? Get the first 74 free as one PDF by email. Get the Half Pack →