Google

Professional Cloud Database Engineer Free Practice Questions — Page 6

Question 51

You are designing a database strategy for a new web application in one region. You need to minimize write latency. What should you do?

A. Use Cloud SQL with cross-region replicas.
B. Use high availability (HA) Cloud SQL with multiple zones.
C. Use zonal Cloud SQL without high availability (HA).
D. Use Cloud Spanner in a regional configuration.
Show Answer
Correct Answer: C
Explanation:
The goal is to minimize write latency in a single region. Zonal Cloud SQL without HA has the lowest write latency because writes are committed only to a single instance in one zone, with no synchronous cross-zone or cross-region replication. Options A and B introduce additional network hops due to replicas or HA standby synchronization, increasing write latency. Cloud Spanner (D), even in a regional configuration, uses synchronous multi-zone replication with consensus, which inherently adds more write latency than a single-node Cloud SQL setup.

Question 52

Your organization is running a critical production database on a virtual machine (VM) on Compute Engine. The VM has an ext4-formatted persistent disk for data files. The database will soon run out of storage space. You need to implement a solution that avoids downtime. What should you do?

A. In the Google Cloud Console, increase the size of the persistent disk, and use the resize2fs command to extend the disk.
B. In the Google Cloud Console, increase the size of the persistent disk, and use the fdisk command to verify that the new space is ready to use
C. In the Google Cloud Console, create a snapshot of the persistent disk, restore the snapshot to a new larger disk, unmount the old disk, mount the new disk, and restart the database service.
D. In the Google Cloud Console, create a new persistent disk attached to the VM, and configure the database service to move the files to the new disk.
Show Answer
Correct Answer: A
Explanation:
Compute Engine persistent disks can be resized while attached and in use. For an ext4 filesystem, you can online-expand the filesystem after increasing the disk size by running resize2fs, without stopping the VM or database, thus avoiding downtime. The other options either do not actually extend usable space, introduce unnecessary downtime, or add complexity.

Question 53

Your organization needs to migrate a critical, on-premises MySQL database to Cloud SQL for MySQL. The on-premises database is on a version of MySQL that is supported by Cloud SQL and uses the InnoDB storage engine. You need to migrate the database while preserving transactions and minimizing downtime. What should you do?

A. 1. Use Database Migration Service to connect to your on-premises database, and choose continuous replication. 2. After the on-premises database is migrated, promote the Cloud SQL for MySQL instance, and connect applications to your Cloud SQL instance.
B. 1. Build a Cloud Data Fusion pipeline for each table to migrate data from the on-premises MySQL database to Cloud SQL for MySQL. 2. Schedule downtime to run each Cloud Data Fusion pipeline. 3. Verify that the migration was successful. 4. Re-point the applications to the Cloud SQL for MySQL instance.
C. 1. Pause the on-premises applications. 2. Use the mysqldump utility to dump the database content in compressed format. 3. Run gsutil –m to move the dump file to Cloud Storage. 4. Use the Cloud SQL for MySQL import option. 5. After the import operation is complete, re-point the applications to the Cloud SQL for MySQL instance.
D. 1 Pause the on-premises applications. 2. Use the mysqldump utility to dump the database content in CSV format. 3. Run gsutil –m to move the dump file to Cloud Storage. 4. Use the Cloud SQL for MySQL import option. 5. After the import operation is complete, re-point the applications to the Cloud SQL for MySQL instance.
Show Answer
Correct Answer: A
Explanation:
Database Migration Service (DMS) supports continuous replication from on‑premises MySQL (InnoDB, supported version) to Cloud SQL for MySQL. Continuous replication preserves transactions by streaming ongoing changes while the source remains online, which minimizes downtime. After synchronization, you promote the Cloud SQL instance and switch applications. The other options require application downtime and bulk exports/imports that do not preserve live transactions.

Question 54

You are working on a new centralized inventory management system to track items available in 200 stores, which each have 500 GB of data. You are planning a gradual rollout of the system to a few stores each week. You need to design an SQL database architecture that minimizes costs and user disruption during each regional rollout and can scale up or down on nights and holidays. What should you do?

A. Use Oracle Real Application Cluster (RAC) databases on Bare Metal Solution for Oracle.
B. Use sharded Cloud SQL instances with one or more stores per database instance.
C. Use a Biglable cluster with autoscaling.
D. Use Cloud Spanner with a custom autoscaling solution.
Show Answer
Correct Answer: D
Explanation:
The system must handle ~100 TB total data (200 × 500 GB), support gradual regional rollouts with minimal disruption, and scale capacity up and down for nights and holidays. Cloud SQL sharding can reduce blast radius during rollout, but Cloud SQL instances have storage limits (~64 TB) and resizing compute/storage requires restarts, causing disruption and lacking true autoscaling. Bigtable is not a relational SQL database, and Oracle RAC is costly and does not provide elastic scale-down. Cloud Spanner is a fully managed, horizontally scalable SQL database that can handle the total data size, supports online scaling with minimal disruption, and can be paired with an autoscaling solution to adjust capacity for off-hours, making it the best fit despite higher per-unit cost.

Question 55

Your organization has strict policies on tracking rollouts to production and periodically shares this information with external auditors to meet compliance requirements. You need to enable auditing on several Cloud Spanner databases. What should you do?

A. Use replication to roll out changes to higher environments.
B. Use backup and restore to roll out changes to higher environments.
C. Use Liquibase to roll out changes to higher environments.
D. Manually capture detailed DBA audit logs when changes are rolled out to higher environments.
Show Answer
Correct Answer: C
Explanation:
The requirement is to audit and track database changes over time and share this information with external auditors. This implies a need for controlled, versioned, and auditable schema/data change management. Liquibase provides database change management with version-controlled changelogs, clear records of what changed, when, and by whom, and integrates directly with Cloud Spanner. Replication and backup/restore are deployment or recovery mechanisms, not auditing solutions, and manual log capture is error‑prone and not aligned with managed cloud best practices.

Question 56

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?

A. 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.
B. 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.
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.
D. 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
Correct Answer: C
Explanation:
Cloud SQL for PostgreSQL with regional HA provides automatic failover within a region. Adding a cross-region read replica enables low RPO through near-real-time replication and a faster RTO by promoting the replica during a regional failure, meeting the 30-minute RTO/RPO requirement. Backups alone are too slow, and migrating to Cloud Spanner requires significant refactoring beyond the requirement.

Question 57

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?

A. 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.
B. 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.
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.
D. 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
Correct Answer: D
Explanation:
To restrict Cloud SQL access to only applications running in your VPC, you should use a private IP Cloud SQL instance. This requires a VPC with Private Service Access configured. Cloud Run then reaches the private IP through Serverless VPC Access (or direct VPC egress). In this private IP setup, Cloud Run connects directly over TCP and does not require the Cloud SQL Auth Proxy. Using a connection pool is recommended to efficiently manage Cloud Run’s highly concurrent, ephemeral connections. Options using public IPs are less secure, and using the Auth Proxy is unnecessary in this scenario.

Question 58

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?

A. Use Cloud SQL for PostgreSQL with both cross-region read replicas.
B. Use Cloud Spanner in a multi-region configuration.
C. Use Firestore in Datastore mode.
D. Use a Bigtable instance with clusters in multiple regions.
Show Answer
Correct Answer: B
Explanation:
The application requires ACID transactions with strong consistency, support for structured and semi-structured (JSON) data, and transparent global multi-region scalability. Cloud Spanner is the only Google Cloud database that natively provides strong consistency for all transactions across regions, horizontal scalability with a global architecture, and support for semi-structured data via JSON columns. Cloud SQL is regional and does not scale transparently across regions, Firestore in Datastore mode does not provide strong consistency for all query types, and Bigtable does not support relational transactions or JSON querying suitable for this workload.

Question 59

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?

A. roles/cloudsql.viewer and roles/spanner.databaseUser
B. roles/cloudsql.editor and roles/spanner.admin
C. roles/cloudsql.client and roles/spanner.databaseReader
D. roles/cloudsql.instanceUser and roles/spanner.databaseUser
Show Answer
Correct Answer: A
Explanation:
To read data from Cloud SQL for SQL Server, the service account needs permissions to view and export instance data; the predefined least-privilege role for that is roles/cloudsql.viewer. The roles/cloudsql.instanceUser role only allows instance login and does not grant visibility or data access. To update a table in Cloud Spanner, roles/spanner.databaseUser is the least-privilege predefined role that allows read and write access to database data. Therefore, roles/cloudsql.viewer and roles/spanner.databaseUser is the correct combination.

Question 60

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?

A. For each application code, set up a common shared user account.
B. For each application code, set up a dedicated user account.
C. For the application server, set up a service account.
D. For the application server, set up a common shared user account.
Show Answer
Correct Answer: C
Explanation:
When running application code on a Compute Engine VM and connecting to Cloud SQL via the Cloud SQL Auth Proxy, Google-recommended practice is to use a service account attached to the VM. The proxy natively supports service accounts, avoids long-lived user credentials, enables least-privilege IAM via the Cloud SQL Client role, and is the fastest and most secure setup. Shared or user accounts are discouraged for production workloads.

$19

Get all 167 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.