Courseiva

CCNA Manage a solution that can span multiple database technologies Questions

75 of 154 questions · Page 1/3 · Manage a solution that can span multiple database technologies · Answers revealed

1
MCQhard

A company has a Cloud Bigtable cluster using HDD storage. They are migrating to a workload that requires lower latency, so they need to switch to SSD storage. How should they accomplish this?

A.Add more nodes to the existing cluster to improve latency.
B.Export data to Avro files, create a new SSD cluster, and import the data.
C.Modify the existing cluster's storage type to SSD using the Cloud Console.
D.Create a new Bigtable cluster with SSD storage in the same instance, replicate data, then delete the old cluster.
AnswerD

Correct approach: create new cluster, replicate, switch traffic, delete old.

Why this answer

Cloud Bigtable does not support in-place conversion of storage type from HDD to SSD. The proper migration path is to create a new cluster with SSD storage within the same instance, enable replication to keep data synchronized, and then delete the old HDD cluster. This approach minimizes downtime and ensures data consistency.

Exam trap

Google Cloud often tests the misconception that you can change the storage type of an existing cluster via the console or that exporting/importing is the only option, when in fact replication-based migration within the same instance is the recommended and least disruptive method.

How to eliminate wrong answers

Option A is wrong because adding more nodes to an HDD cluster improves throughput and reduces hotspotting but does not change the underlying storage latency; HDDs still have higher read/write latency than SSDs. Option B is wrong because exporting to Avro files and importing into a new SSD cluster is possible but introduces significant downtime and operational complexity compared to using replication within the same instance. Option C is wrong because Cloud Bigtable does not allow modifying the storage type of an existing cluster; the storage type is fixed at cluster creation and cannot be changed via the Cloud Console or any API.

2
Multi-Selecthard

A company is using Bigtable for real-time analytics and notices that some queries are experiencing high latency. They suspect a hot spot due to a row key design that uses a monotonically increasing value. Which two actions should they take to diagnose and mitigate the hot spottedness? (Choose TWO.)

Select 2 answers
A.Increase the number of nodes to spread the load
B.Redesign the row key to include a hash prefix or a field that distributes writes evenly
C.Create a Bigtable table with a different column family
D.Use Key Visualiser in the Google Cloud console to analyse row key distribution
E.Switch from HDD to SSD storage type
AnswersB, D

A more distributed row key avoids hot spots.

Why this answer

Key Visualiser helps identify hot spots by showing row key distribution. Prefixing the row key with a field that distributes writes (like a hash prefix) is a common mitigation strategy.

3
MCQmedium

You have a Memorystore for Redis instance that serves as a session store for a web application. The instance is running low on memory and is approaching the maxmemory limit. You want to ensure that the least recently used keys are evicted first when memory is full. Which eviction policy should you configure?

A.allkeys-lru
B.noeviction
C.volatile-lru
D.volatile-ttl
AnswerC

Volatile-lru evicts least recently used keys among those with an expire set. Sessions usually have TTL, so this is the correct policy.

Why this answer

The volatile-lru policy evicts keys with an expire set (TTL) using the LRU algorithm. For a session store, sessions typically have a TTL, so volatile-lru is appropriate. allkeys-lru would evict any key regardless of TTL, which might remove important keys. noeviction would cause write errors when memory is full. volatile-ttl evicts based on TTL, not LRU.

4
MCQhard

A Cloud Bigtable instance is experiencing high read latency due to hot spots. The operations team uses the Key Visualizer tool and identifies that a small set of row keys are being read disproportionately. Which action should they take to mitigate the hot spotting?

A.Increase the number of nodes in the Bigtable cluster to handle the load.
B.Change the storage type from HDD to SSD to improve performance.
C.Redesign the row key scheme to distribute the workload across more tablets.
D.Enable replication across multiple zones.
AnswerC

Row key design is critical. Using a hash or adding a salt prefix spreads reads across nodes.

Why this answer

Hot spotting in Cloud Bigtable is typically caused by a suboptimal row key design that concentrates read/write traffic on a small number of tablets. Redesigning the row key scheme to distribute the workload—for example, by adding a hash prefix or using a more granular key—spreads requests across multiple tablets, alleviating the hotspot. Key Visualizer explicitly identifies the skewed row keys, guiding the redesign effort.

Exam trap

A common mistake in Google Cloud exams is to think that adding nodes or changing storage type can fix design-level hotspots, when in fact the correct action is always to address the data distribution pattern at the row key level using the Key Visualizer results.

How to eliminate wrong answers

Option A is wrong because increasing the number of nodes adds more compute and storage capacity but does not fix the underlying row key design flaw; the hotspot will persist on the same tablets, and additional nodes may even exacerbate the imbalance. Option B is wrong because changing storage from HDD to SSD improves I/O latency but does not address the root cause of uneven data distribution; the hotspot will still concentrate reads on a few tablets. Option D is wrong because enabling replication across zones provides high availability and disaster recovery, but it does not redistribute the row key load; the same hot row keys will still be read disproportionately in each replica.

5
MCQhard

Your Cloud Bigtable instance is experiencing hot spots, causing performance degradation. You want to identify the specific row keys causing the hot spots. Which tool should you use?

A.Cloud Monitoring dashboard
B.Key Visualiser
C.cbt command-line tool
D.Cloud Logging
AnswerB

Key Visualiser is specifically designed to detect hot spots by showing traffic distribution across row keys.

Why this answer

Key Visualiser is a Cloud Bigtable tool that visualises read/write traffic across the row key space, helping identify hot spots (rows with disproportionate traffic). Cloud Monitoring provides overall metrics but not row-level detail. Cloud Logging logs queries but not aggregated heat maps. cbt is the command-line tool for administrative tasks but does not provide visualisation.

6
MCQmedium

A company uses Cloud SQL for PostgreSQL and needs to enable point-in-time recovery (PITR) with a retention period of 14 days. Currently, automated backups are configured with a 7-day retention. What should the engineer do to meet this requirement?

A.Increase the backup retention period to 14 days; PITR is automatically extended.
B.Set the 'transaction log retention' to 14 days in the Cloud SQL instance settings.
C.Note that Cloud SQL for PostgreSQL only supports up to 7 days of PITR retention; consider exporting logs to Cloud Storage for longer recovery.
D.Enable binary logging and set the binary log retention to 14 days.
AnswerC

Correct. The maximum PITR retention is 7 days. For longer retention, export logs to Cloud Storage and use custom scripts for recovery.

Why this answer

Cloud SQL PITR is based on write-ahead log (WAL) archiving. The transaction log retention is set via the 'transaction log retention' setting, not the backup retention. PITR for PostgreSQL in Cloud SQL supports up to 7 days of log retention; 14 days is not supported.

The engineer must accept the limitation or use a different approach.

7
MCQmedium

A Cloud Bigtable instance is experiencing high latency on reads. The operations team suspects a hot spot. Which tool should they use to identify the hot spot?

A.Stackdriver Debugger
B.Bigtable cbt tool
C.Key Visualiser
D.Cloud Monitoring dashboard
AnswerC

Correct. Key Visualiser provides a heatmap of row key access patterns to detect hot spots.

Why this answer

Key Visualizer is the correct tool because it is specifically designed to visualize access patterns in Cloud Bigtable and identify hot spots—regions of a table that receive disproportionate read/write traffic. It generates heatmaps of row key access, allowing operators to pinpoint uneven load distribution that causes high latency.

Exam trap

The PCDOE exam often tests the distinction between general monitoring tools (Cloud Monitoring) and purpose-built diagnostic tools (Key Visualizer), trapping candidates who assume any monitoring dashboard can identify hot spots without row-key-level granularity.

How to eliminate wrong answers

Option A is wrong because Stackdriver Debugger is used for inspecting application code state in production, not for analyzing Bigtable access patterns or hot spots. Option B is wrong because the Bigtable cbt tool is a command-line interface for reading/writing data and managing tables, but it does not provide visualization or analysis of access patterns to identify hot spots. Option D is wrong because Cloud Monitoring dashboard provides metrics like latency and throughput but lacks the row-key-level heatmap visualization needed to pinpoint specific hot spot row ranges.

8
Multi-Selectmedium

A company is running a Cloud SQL for MySQL instance and needs to create a read replica in a different region for disaster recovery. They also want to be able to promote the replica to a standalone instance if needed. Which three steps should they take? (Choose THREE.)

Select 3 answers
A.Enable binary logging on the primary instance
B.Set the replica's database flags to enable read-only mode
C.Use gcloud sql instances create <replica-name> --master-instance-name <primary> --region <target-region>
D.Run gcloud sql instances promote-replica <replica-name> to promote it
E.Create the replica in the same region as the primary
AnswersA, C, D

Binary logging must be enabled for replication.

Why this answer

Cross-region replicas are created using the gcloud command with the --region flag and the --master-instance-name pointing to the primary. After creation, replication must be verified. If needed, the replica can be promoted using gcloud sql instances promote-replica.

9
MCQmedium

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

A.The replica's automatic storage increase is disabled.
B.The replica has point-in-time recovery enabled.
C.The primary instance has a heavy write workload.
D.The replica is using a different storage type than the primary.
AnswerC

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

Why this answer

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

Exam trap

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

How to eliminate wrong answers

Option A is wrong because disabling automatic storage increase on the replica does not directly cause replication lag; it only prevents the replica from automatically expanding its disk when storage runs low, which could lead to replica failure or read-only mode, not lag. Option B is wrong because enabling point-in-time recovery (PITR) on the replica does not cause replication lag; PITR uses transaction logs for backup purposes and does not interfere with the replication process. Option D is wrong because using a different storage type (e.g., SSD vs.

HDD) on the replica may affect read performance but does not inherently cause replication lag, as Cloud SQL replicas can use different storage types without impacting the replication stream.

10
Multi-Selectmedium

A company is using Cloud SQL for MySQL and wants to perform disaster recovery testing by promoting a read replica to a standalone instance. Which TWO actions are required? (Choose 2)

Select 2 answers
A.Stop replication on the replica using the Cloud Console or gcloud.
B.Delete the replica and recreate it as a primary instance.
C.Enable point-in-time recovery on the replica.
D.Disable binary logging on the replica.
E.Promote the replica using the 'promote' action in Cloud Console or gcloud.
AnswersA, E

Correct. Replication must be stopped before promotion.

Why this answer

To promote a read replica to a standalone instance, you must stop replication on the replica and then promote it. The promotion process converts the replica into an independent primary instance.

11
Multi-Selecthard

An organisation wants to back up their Cloud Spanner database and store the backup in a different region for disaster recovery. They require the backup to be in a format that can be restored into Spanner with minimal effort. Which THREE actions should they take? (Choose three.)

Select 3 answers
A.Export the database using gcloud spanner databases export to CSV format
B.Specify a different location for the backup at creation time for cross-region storage
C.Use Dataflow to import the backup into a new instance
D.Restore the backup to a new database using gcloud spanner databases restore
E.Create a database-level backup using gcloud spanner databases backup
AnswersB, D, E

Backups can be stored in a different region by specifying the --location flag.

Why this answer

Cloud Spanner allows you to specify a different location for the backup at creation time, enabling cross-region storage for disaster recovery without additional export or import steps. Option D is correct because restoring a backup to a new database using `gcloud spanner databases restore` directly utilizes the backup format, requiring minimal effort. Option E is correct because creating a database-level backup using `gcloud spanner databases backup` is the native method to back up Spanner databases, and such backups can be stored in different regions for geographic redundancy.

Exam trap

A common trap in Google Cloud exams is thinking that exporting to CSV or using Dataflow is required for cross-region backup, but Spanner's native backup and restore features handle location specification and restoration directly.

12
MCQmedium

You manage a Memorystore for Redis instance that is regularly hitting its maximum memory limit. The application can tolerate some data loss and prefers to keep the most recently used data. Which eviction policy should you configure?

A.noeviction
B.volatile-lru
C.volatile-ttl
D.allkeys-lru
AnswerB

volatile-lru evicts the least recently used keys among those with an expiry set, matching the requirement.

Why this answer

volatile-lru evicts keys with an expiry set (volatile keys) using an LRU (least recently used) algorithm. This fits the requirement: the application can tolerate loss of expired data, and it prefers to keep recently used data. allkeys-lru would evict any key, which might include important unexpired keys.

13
Multi-Selectmedium

Your organisation uses Cloud Spanner for a globally distributed application. You need to set up a backup strategy that allows restoring the database to a specific point in time within the last 7 days, with minimal impact on performance. Which THREE actions should you take? (Choose THREE.)

Select 3 answers
A.Export the database daily using Dataflow to Cloud Storage.
B.Use gcloud spanner databases import to restore from previous exports.
C.Create full database backups using gcloud spanner backups create and set retention to 7 days.
D.Enable point-in-time recovery (PITR) with a 7-day retention period.
E.Use Cloud Scheduler to trigger regular full backups via gcloud commands.
AnswersC, D, E

Creating full database backups with a 7-day retention provides a restore point and is part of a robust backup strategy.

Why this answer

For point-in-time recovery within 7 days, Cloud Spanner offers built-in PITR (Option D) which enables restoring to any point within the retention period with minimal performance impact. Additionally, creating full backups (Option C) with a 7-day retention ensures you have backup files for restore if needed. Automating these backups with Cloud Scheduler (Option E) ensures regular backups without manual intervention.

Options A and B are incorrect: A uses Dataflow export which is intended for long-term retention and can impact performance, and B restores from backups rather than enabling PITR. Option B is not needed when PITR is enabled.

14
MCQeasy

You need to create a read replica of a Cloud SQL for PostgreSQL instance in a different region for disaster recovery. What must be true about the primary instance to support cross-region replicas?

A.The primary instance must have point-in-time recovery disabled.
B.The primary instance must be using a regional (high-availability) configuration.
C.The primary instance must have the 'cloudsql.logical_decoding' flag set to 'off'.
D.The primary instance must have automated backups enabled.
AnswerD

Correct. Automated backups must be enabled on the primary instance because they provide the WAL archive needed for replication, including for cross-region replicas.

Why this answer

Cross-region read replicas for Cloud SQL for PostgreSQL require automated backups to be enabled on the primary instance. Automated backups are necessary to maintain the WAL (Write-Ahead Log) archive, which is used for replication. The primary does not need to be regional; a zonal (non-HA) instance can also support cross-region replicas.

Point-in-time recovery is automatically enabled when automated backups are on, and the flag 'cloudsql.logical_decoding' must be set to 'on' (not 'off') for PostgreSQL replication.

15
MCQeasy

A company is designing a mobile application backend that requires real-time synchronization across users and offline support. Which Google Cloud database service is most suitable?

A.Bigtable
B.Cloud SQL
C.Cloud Spanner
D.Firestore
AnswerD

Correct. Firestore offers real-time listeners and offline data persistence.

Why this answer

Firestore is designed for real-time sync, offline support, and mobile/web applications. It provides real-time listeners and offline data persistence.

16
MCQeasy

A Cloud SQL for MySQL instance is experiencing high CPU utilisation (>80%) and slow query performance. The instance has auto-storage increase enabled. Which step should the engineer take to immediately reduce CPU load?

A.Increase the instance tier to a larger machine type
B.Reduce the max_connections parameter
C.Create a cross-region read replica to offload reads
D.Enable auto-storage increase if not already enabled
AnswerA

Increasing the machine type provides more CPU and memory, directly reducing CPU utilisation.

Why this answer

High CPU utilisation is often due to insufficient compute capacity. Increasing the instance tier (vertical scaling) provides more CPU and memory, reducing load. Enabling auto-storage increase only adds disk space, not compute.

Creating a read replica distributes read traffic but does not help with CPU load on the primary for write-heavy workloads. Adjusting max_connections may help marginally but is not as effective as increasing compute capacity.

17
MCQhard

An organization is using Cloud SQL for MySQL with automated backups enabled. They need to restore a backup to a new instance in a different region for testing. The backup is stored in the same region as the source. How can they achieve this with minimal operational overhead?

A.Use gcloud sql backups restore with the --restore-instance flag pointing to a new instance in the target region.
B.Create a cross-region read replica from the source, then promote it in the target region.
C.Restore the backup directly to a new instance in the target region using the Cloud Console.
D.Restore the backup to a new instance in the same region, then use export/import to move data to the target region.
AnswerD

Export/import is a reliable cross-region data movement method.

Why this answer

Cloud SQL backups are region-specific and cannot be restored directly to a different region. The minimal-operational-overhead approach is to restore the backup to a new instance in the same region, then use the export/import feature (e.g., SQL dump or CSV) to move the data to the target region. This avoids the complexity and cost of maintaining a cross-region read replica, while still achieving the goal with built-in tools.

Exam trap

Google often tests the misconception that Cloud SQL backups are globally accessible and can be restored to any region, when in fact they are region-locked and require an export/import workflow for cross-region data transfer.

How to eliminate wrong answers

Option A is wrong because the `gcloud sql backups restore` command does not support a `--restore-instance` flag; backups can only be restored to an existing instance in the same region, not to a new instance in a different region. Option B is wrong because creating a cross-region read replica and promoting it incurs ongoing replication costs and operational overhead (e.g., managing replication lag, failover), which is not minimal for a one-time testing need. Option C is wrong because the Cloud Console does not allow restoring a backup directly to a new instance in a different region; the restore operation is constrained to the same region as the backup.

18
Multi-Selecthard

Your company runs a global e-commerce platform on Cloud Spanner. You need to capture real-time changes to a table (e.g., orders) and stream them to a downstream analytics pipeline in near real-time. Which TWO Google Cloud features or services should you combine to achieve this? (Choose two.)

Select 2 answers
A.Cloud Functions
B.Dataflow streaming pipeline
C.Cloud Pub/Sub
D.Cloud SQL for PostgreSQL
E.Cloud Spanner change streams
AnswersB, E

Dataflow is the recommended service to read and process Spanner change streams.

Why this answer

A Dataflow streaming pipeline can consume Cloud Spanner change streams in near real-time, process the data (e.g., transform, filter, aggregate), and write it to a downstream analytics system. Dataflow provides exactly-once processing semantics and auto-scaling, making it ideal for continuous change data capture (CDC) pipelines.

Exam trap

The trap here is that candidates often confuse Cloud Pub/Sub as a required component for streaming, but Cloud Spanner change streams can be read directly by Dataflow without Pub/Sub, making Pub/Sub an unnecessary intermediate step for this specific use case.

19
MCQmedium

A Cloud Firestore database in Native mode is used for a mobile app. The app queries a collection with a composite filter on two fields. Queries are slow and the app shows an error that an index is required. What should the developer do?

A.Use a database export and import to regenerate indexes.
B.Create a composite index in the Firebase Console or gcloud CLI.
C.Restructure the data to use a single field for the filter.
D.Enable the automatic index creation in the Firestore settings.
AnswerB

Composite indexes are manually created and are required for multi-field queries.

Why this answer

Cloud Firestore requires an index to support composite filters (queries filtering on multiple fields). When a query uses a composite filter and no matching index exists, Firestore returns an error indicating an index is required. The correct solution is to create the necessary composite index manually via the Firebase Console or the gcloud CLI, as Firestore does not automatically create composite indexes for queries with equality and range filters on different fields.

Exam trap

Google often tests the misconception that Firestore automatically creates all necessary indexes, but in reality, only single-field indexes are auto-created; composite indexes must be manually defined by the developer.

How to eliminate wrong answers

Option A is wrong because exporting and importing the database does not regenerate indexes; it only moves data and existing index definitions, not create new ones. Option C is wrong because restructuring data to use a single field would change the query logic and may not satisfy the app's requirements, and it avoids the proper solution of creating the needed composite index. Option D is wrong because Firestore automatically creates single-field indexes but does not automatically create composite indexes; enabling automatic index creation is not a setting available in Firestore.

20
Multi-Selectmedium

A Memorystore for Redis instance needs to be scaled to handle increased traffic. Which TWO methods can you use? (Choose 2)

Select 2 answers
A.Increase the maxmemory parameter.
B.Change the eviction policy to allkeys-lru.
C.Vertically scale by changing the tier to a larger machine type.
D.Horizontally scale by enabling Redis Cluster (clustering) for sharding.
E.Add read replicas in the same zone.
AnswersC, D

Memorystore supports vertical scaling by changing the tier.

21
MCQmedium

Your Firestore database in Native mode contains a collection with millions of documents. You need to query documents where the 'tags' field (an array) contains the string 'urgent'. What must you ensure in your index configuration?

A.No additional index configuration is required; Firestore automatically creates the necessary index for array fields.
B.Ensure the 'tags' field is not indexed, and then create a composite index with the array-contains filter.
C.Create an index exemption for the 'tags' field to enable array queries.
D.Create a composite index on 'tags' and '__name__' for the collection.
AnswerA

Firestore automatically indexes array fields for array-contains queries.

Why this answer

Firestore automatically creates a single-field index for array fields. However, to query array-contains, you need an index on the field with the array-contains filter. Firestore automatically creates a single-field index for the 'tags' field, so no additional index is needed.

If the query includes additional equality clauses, a composite index may be required, but for a simple array-contains, it's automatic.

22
MCQeasy

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

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

Correct. The metric for replication lag in Cloud SQL is 'replication_lag'.

Why this answer

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

23
MCQmedium

A Memorystore for Redis instance is running out of memory. The application uses a mix of cache and session data. Which eviction policy should be chosen to minimize cache misses while ensuring session data is not evicted?

A.noeviction
B.volatile-ttl
C.allkeys-lru
D.allkeys-random
AnswerB

Evicts only keys with TTL set (cache), leaving session data (no TTL) intact.

Why this answer

The volatile-ttl policy evicts keys with a TTL set, prioritizing those with the shortest remaining TTL. Since session data typically has a TTL and cache data may or may not, this policy allows you to protect session data by assigning it a longer TTL, while cache data with shorter TTLs is evicted first, minimizing cache misses.

Exam trap

The PCDOE exam often tests the misconception that allkeys-lru is always the best for cache performance, but here the requirement to protect session data makes volatile-ttl the correct choice because it only evicts keys with TTLs, allowing session data to be preserved by setting a longer TTL.

How to eliminate wrong answers

Option A is wrong because noeviction prevents any eviction, causing write operations to fail with OOM errors when memory is full, which does not resolve the memory pressure. Option C is wrong because allkeys-lru evicts the least recently used key from the entire keyspace, regardless of TTL, so session data with a TTL could be evicted if it is not recently used. Option D is wrong because allkeys-random evicts random keys from the entire keyspace, providing no control over which data is removed, risking eviction of session data and increasing cache misses.

24
MCQhard

A company has a Cloud SQL for MySQL instance with automated backups enabled. They need to restore the database to a specific timestamp from 2 days ago. The backup retention is set to 7 days. How should they perform this restore?

A.Export the database and import it into a new instance
B.Create an on-demand backup and restore from that backup
C.Use gcloud sql instances clone with the --point-in-time flag and the desired timestamp
D.Use gcloud sql instances restore-backup with the backup ID from 2 days ago
AnswerC

Cloning with --point-in-time allows restoration to any timestamp within the binary log retention period.

Why this answer

Cloud SQL for MySQL supports point-in-time recovery (PITR), which allows you to restore a database to a specific timestamp within the backup retention period (here, 7 days). The `gcloud sql instances clone` command with the `--point-in-time` flag creates a new instance that reflects the database state at the exact requested timestamp, leveraging the transaction logs retained by automated backups.

Exam trap

The trap here is that candidates confuse `gcloud sql instances restore-backup` (which restores from a full backup only) with point-in-time recovery, not realizing that the clone command with `--point-in-time` is the correct method for timestamp-based restores.

How to eliminate wrong answers

Option A is wrong because exporting and importing the database is a manual, full-database dump and restore process that does not support point-in-time recovery; it would only restore to the state at the time of the export, not to a specific timestamp from 2 days ago. Option B is wrong because creating an on-demand backup captures the database state only at the moment the backup is taken, and you cannot restore from that backup to a different timestamp; it does not provide the granularity needed for a point-in-time restore. Option D is wrong because `gcloud sql instances restore-backup` restores from a specific full backup (identified by backup ID), not to a precise timestamp; it would restore the database to the state at the time that backup was taken, which may not match the desired timestamp from 2 days ago.

25
Multi-Selectmedium

A financial services company uses Cloud Spanner for transaction processing. They need to capture real-time changes from the database to stream to a downstream analytics system. Which THREE services or features can achieve this?

Select 3 answers
A.Cloud SQL for PostgreSQL
B.Cloud Pub/Sub
C.Bigtable replication
D.Spanner change streams
E.Cloud Dataflow
AnswersB, D, E

Pub/Sub can deliver change stream events to subscribers.

Why this answer

Spanner change streams are correct because they capture row-level mutations in real time directly from Cloud Spanner. Cloud Pub/Sub is correct as it provides a fully managed messaging service that ingests and delivers change events from Spanner change streams to downstream systems with at-least-once delivery and low latency. Cloud Dataflow is correct because it can process and transform the change stream events in real time, enabling streaming analytics or integration with other services.

Together, these three services form a complete pipeline: Spanner change streams capture changes, Pub/Sub transports them, and Dataflow processes them for the analytics system.

Exam trap

Candidates often confuse services that capture changes (Spanner change streams) with services that transport or process those changes (Pub/Sub, Dataflow), leading to incorrect selections like Bigtable replication or Cloud SQL, which serve different purposes.

26
MCQhard

A gaming company uses Cloud Spanner to store player profiles and game state. They need to run a one-time analytic query on historical data that would take minutes and cannot impact production performance. What is the best approach?

A.Create a read-only replica and query it
B.Use the gcloud spanner databases execute-sql command with --query-mode=read-only
C.Export the required data to BigQuery using Dataflow and run the query there
D.Run the query using a read-only transaction with strong reads
AnswerC

Moving data to BigQuery separates analytic workloads from production.

Why this answer

Exporting the data to BigQuery via Dataflow isolates the analytic workload from Cloud Spanner, ensuring zero impact on production performance. Cloud Spanner is designed for transactional workloads, not heavy analytic queries that take minutes, and BigQuery is purpose-built for such analytics. This approach also avoids consuming Spanner's CPU or memory resources, which could degrade real-time game state operations.

Exam trap

The PCDOE exam often tests the misconception that read-only replicas or transactions are fully isolated from production performance, but in Cloud Spanner they still share instance resources and can cause degradation under sustained analytic queries.

How to eliminate wrong answers

Option A is wrong because a read-only replica in Cloud Spanner still shares the same underlying instance resources (CPU, memory) and can experience performance degradation under heavy analytic queries, impacting production. Option B is wrong because the gcloud spanner databases execute-sql command with --query-mode=read-only still executes the query on the primary Spanner instance, consuming resources and potentially affecting production performance. Option D is wrong because a read-only transaction with strong reads still runs on the primary Spanner instance and can cause contention or resource exhaustion, especially for long-running queries.

27
MCQmedium

A data analytics company uses Bigtable for high-throughput writes. They notice that some rows are receiving a disproportionate number of reads and writes, causing performance degradation. Which tool should they use to identify and resolve this hot spotting issue?

A.cbt tool
B.Cloud Logging
C.Key Visualiser
D.Cloud Monitoring
AnswerC

Key Visualiser is the correct tool to identify hot spotting by visualising row key access patterns.

Why this answer

Key Visualizer is the correct tool because it is specifically designed to analyze Bigtable access patterns and visualize hot spotting—where a small number of rows or row ranges receive a disproportionate share of reads and writes. It provides heatmaps and time-series graphs that pinpoint the exact keys causing performance degradation, enabling you to redesign your row keys or implement salting to distribute load evenly.

Exam trap

The trap here is that candidates confuse Cloud Monitoring (general metrics) with Key Visualizer (specialized Bigtable access pattern analysis), assuming any monitoring tool can diagnose hot spots, but only Key Visualizer provides the key-level heatmap required for this specific Bigtable issue.

How to eliminate wrong answers

Option A is wrong because the cbt tool is a command-line interface for interacting with Bigtable (e.g., creating tables, reading/writing data), but it does not provide any built-in analysis or visualization of access patterns to identify hot spots. Option B is wrong because Cloud Logging captures operational logs (e.g., errors, requests) but does not offer the specialized heatmap or key-level analysis needed to detect and resolve hot spotting in Bigtable. Option D is wrong because Cloud Monitoring provides metrics and alerts for overall system health (e.g., CPU, latency), but it lacks the granular, key-range-specific visualization that Key Visualizer offers for diagnosing hot spots.

28
MCQmedium

A company runs a Cloud SQL for PostgreSQL instance that is nearing its storage limit of 500 GB. The database administrator needs to increase storage capacity online without any downtime. What should they do?

A.Use the gcloud sql instances patch command with --storage-size flag
B.Enable automatic storage increase and wait for it to trigger
C.Delete and recreate the instance with a larger disk
D.Shut down the instance, increase the disk size, and restart
AnswerA

Correct. The gcloud sql instances patch command can resize storage online.

Why this answer

The `gcloud sql instances patch` command with the `--storage-size` flag allows you to increase the storage capacity of a Cloud SQL for PostgreSQL instance online without any downtime. Cloud SQL supports live storage increases by automatically resizing the underlying persistent disk while the instance remains available, so no restart or maintenance window is required.

Exam trap

Google often tests the misconception that storage increases require a restart or downtime, but Cloud SQL supports online storage scaling via the gcloud command, making options that involve shutdown or recreation incorrect.

How to eliminate wrong answers

Option B is wrong because enabling automatic storage increase only triggers when the instance reaches a predefined threshold (typically 90% of current capacity), and it increases storage in small increments (e.g., 10 GB), which may not be sufficient to immediately address a near-limit situation and could still risk downtime if the threshold is crossed unexpectedly. Option C is wrong because deleting and recreating the instance would cause complete downtime and data loss unless a backup is restored, which is not a zero-downtime solution. Option D is wrong because shutting down the instance to increase disk size introduces downtime, which violates the requirement of no downtime; Cloud SQL does not require a shutdown for storage increases.

29
MCQmedium

A company uses Cloud Spanner for a global inventory application. They need to add a new index to a large table without downtime. What is the recommended approach?

A.Create the index using ALTER TABLE with 'ONLINE' clause
B.Use gcloud spanner databases ddl update with --async flag
C.Take a backup, create index on a new instance, and switch traffic
D.Use CREATE INDEX; Spanner handles it as a non-blocking operation
AnswerD

Spanner perform index creation as a background operation that does not block writes.

Why this answer

Cloud Spanner's CREATE INDEX operation is inherently non-blocking; it performs the index backfill as a background process without locking the table or blocking reads and writes. This allows the index to be added to a large table with zero downtime, as Spanner manages the consistency and availability of the data throughout the operation.

Exam trap

The PCDOE exam often tests the misconception that Cloud Spanner requires special syntax or flags (like ONLINE or --async) to achieve non-blocking DDL, when in fact all DDL operations in Spanner are designed to be non-blocking by default.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner does not support an 'ONLINE' clause in ALTER TABLE; that syntax is specific to Oracle and other databases, not Spanner. Option B is wrong because the --async flag in gcloud spanner databases ddl update merely returns immediately without waiting for the DDL operation to complete, but the underlying CREATE INDEX operation is still the same non-blocking mechanism; the flag does not change the blocking behavior—it only affects the client-side wait. Option C is wrong because taking a backup and creating an index on a new instance is unnecessary overhead; Spanner's native non-blocking index creation eliminates the need for such a cumbersome migration, which would also introduce potential data inconsistency and extended downtime during traffic switch.

30
MCQhard

A team is using Firestore in Native mode. They have a collection 'users' with an array field 'roles'. They need to query all users where roles contains 'admin'. What index configuration is required?

A.Create a single-field index on roles with ascending order.
B.Create an index exemption on the 'roles' field.
C.Create a composite index on roles and the default field.
D.No index is needed; Firestore automatically supports array-contains queries.
AnswerB

Correct. An index exemption is required for array fields to support array-contains queries.

Why this answer

Firestore supports array membership queries using the 'array-contains' operator. An index exemption for the array field is required because Firestore does not automatically index array fields for array-contains queries. The exemption is created manually.

31
Multi-Selecthard

A Cloud Bigtable instance is configured with asynchronous replication across two regions for disaster recovery. The team needs to ensure that read-after-write consistency is maintained within a region. Which three strategies should they implement? (Choose THREE.)

Select 3 answers
A.After writing, have the application wait for a confirmation that the write is durable before performing a read.
B.Use single-cluster routing for read/write operations within the primary region.
C.Disable replication and use only the primary cluster.
D.Use multi-cluster routing to distribute reads across regions.
E.Monitor replication lag metrics to ensure replicas are up to date.
AnswersA, B, E

Application-level confirmation ensures consistency.

Why this answer

In Cloud Bigtable, writes are acknowledged only after they are committed to the tablet server's log and replicated to the underlying Colossus file system. By waiting for this confirmation before performing a read, the application ensures that the read will see the latest write, providing read-after-write consistency within the region.

Exam trap

The trap here is that candidates confuse asynchronous replication with eventual consistency and assume that monitoring replication lag alone can guarantee read-after-write consistency, when in fact only application-level write confirmation and single-cluster routing provide that guarantee within a region.

32
MCQmedium

A company uses Cloud SQL for PostgreSQL and wants to create a cross-region read replica for disaster recovery (DR) purposes. They also want the option to promote the replica to a standalone instance in the event of a regional outage. What should the engineer do?

A.Export the database as a SQL file and import it into a new instance in the target region during DR.
B.Create a cross-region read replica and use gcloud sql instances promote-replica to promote it during DR.
C.Create a same-region read replica and enable point-in-time recovery on it.
D.Configure cross-region backup replicas and restore from backup in the target region.
AnswerB

This is the correct approach. Cross-region replica provides DR, and promotion makes it a standalone instance.

Why this answer

Cloud SQL for PostgreSQL supports cross-region read replicas, which can be promoted to standalone instances using the `gcloud sql instances promote-replica` command. This provides a managed DR solution with minimal data loss (asynchronous replication) and faster failover compared to export/import or backup restore methods.

Exam trap

Google often tests the distinction between read replicas (which can be promoted for DR) and backups (which require manual restore), leading candidates to mistakenly choose backup-based options like D or export/import like A.

How to eliminate wrong answers

Option A is wrong because exporting and importing a SQL file is a manual, time-consuming process that does not provide near-real-time replication, leading to significant data loss and longer recovery time objectives (RTO). Option C is wrong because a same-region read replica does not protect against a regional outage; it only provides read scalability and high availability within the same region. Option D is wrong because Cloud SQL does not support 'cross-region backup replicas'; backups are regional and must be manually copied or restored to another region, which is slower and less automated than a cross-region read replica promotion.

33
MCQhard

A financial services company uses Cloud Spanner for a globally distributed application. They need to add a new column to an existing table that contains billions of rows. The change must not cause any downtime or performance degradation. How should the engineer implement this schema change?

A.Use ALTER TABLE ADD COLUMN; Spanner applies the change online without downtime.
B.Export the table, modify the schema in a temporary table, and import it back.
C.Use CREATE INDEX to add the column as an index.
D.Create a new table with the additional column, backfill data from the old table, then rename the tables.
AnswerA

Correct. Spanner's DDL is online and non-blocking.

Why this answer

Cloud Spanner supports online schema changes via the `ALTER TABLE ADD COLUMN` statement, which applies the change asynchronously without locking the table or causing downtime. Spanner uses a multi-phase approach to add columns, allowing reads and writes to continue uninterrupted while the schema change propagates across all nodes and regions.

Exam trap

The common misconception is that schema changes on large distributed databases require manual backfill or table recreation, but Cloud Spanner's online DDL handles this transparently without downtime.

How to eliminate wrong answers

Option B is wrong because exporting and re-importing a table with billions of rows would cause significant downtime and performance degradation, defeating the requirement for zero downtime. Option C is wrong because `CREATE INDEX` does not add a column; it creates an index on existing columns, and adding a column requires `ALTER TABLE`. Option D is wrong because creating a new table, backfilling data, and renaming tables would require complex coordination and likely cause downtime or data inconsistency, whereas Spanner's native `ALTER TABLE` handles the change online without such manual steps.

34
Multi-Selectmedium

A company wants to migrate from an on-premises MySQL database to Cloud SQL. They need to minimize downtime and ensure data consistency. Which two steps should they include in the migration plan? (Choose TWO.)

Select 2 answers
A.Create a read replica in the same region for validation before cutover
B.Use Cloud SQL's import functionality to load a mysqldump file
C.Set up continuous replication from the on-premises database to the Cloud SQL instance using Database Migration Service
D.Take a consistent snapshot of the on-premises database at the time of cutover
E.Disable binary logging on the on-premises database to reduce overhead
AnswersC, D

DMS supports continuous replication to minimize downtime.

Why this answer

Database Migration Service (DMS) supports continuous replication using MySQL binary logs, enabling a near-zero-downtime migration by keeping the Cloud SQL instance synchronized with the on-premises database until cutover. Option D is correct because taking a consistent snapshot (e.g., using mysqldump with --single-transaction or a storage-level snapshot) at cutover ensures data consistency and provides a fallback point if the migration fails.

Exam trap

Google Cloud exams often test the misconception that a simple import/export (like mysqldump) is sufficient for minimal downtime, but the key is that continuous replication (via DMS) is required to keep the target synchronized during the migration window.

35
MCQeasy

A Cloud Memorystore for Redis instance needs to ensure data is not lost during a maintenance event. The team decides to enable persistence. However, Memorystore does not support Redis persistence. What is the recommended alternative?

A.Use the Standard tier with replication and take regular snapshots to Cloud Storage using a scheduled script.
B.Migrate to Cloud SQL for MySQL and use its backup feature.
C.Enable AOF persistence in Memorystore.
D.Increase the maxmemory setting and rely on the allkeys-lru eviction policy.
AnswerA

Standard tier provides replication; snapshots to Cloud Storage provide persistency.

Why this answer

Cloud Memorystore for Redis does not support native Redis persistence (RDB or AOF). To prevent data loss during maintenance events, the recommended alternative is to use the Standard tier (which provides replication and automatic failover) and supplement it with scheduled snapshots exported to Cloud Storage. This approach ensures a durable backup outside the Redis instance that can be restored if needed.

Exam trap

The Google Cloud Professional Data Engineer exam often tests the misconception that Cloud Memorystore supports all native Redis features, including persistence commands like BGSAVE or CONFIG SET appendonly yes, when in fact these are explicitly disabled in the managed service.

How to eliminate wrong answers

Option B is wrong because Cloud SQL for MySQL is a relational database, not an in-memory cache, and migrating to it would fundamentally change the architecture and performance characteristics of the application. Option C is wrong because Cloud Memorystore for Redis does not support AOF persistence; enabling it is not possible in the managed service. Option D is wrong because increasing maxmemory and relying on the allkeys-lru eviction policy only manages memory usage under pressure, it does not provide any durability or persistence to prevent data loss during maintenance events.

36
MCQmedium

A Memorystore for Redis instance is experiencing out-of-memory errors, causing keys to be evicted. The application relies on all keys being present. The current maxmemory-policy is allkeys-lru. What should the engineer do to prevent evictions?

A.Change the eviction policy to noeviction.
B.Change the eviction policy to volatile-lru.
C.Enable persistence to Cloud Storage to offload memory.
D.Scale up the instance to a higher tier with more memory.
AnswerA

noeviction prevents eviction; writes will fail instead of losing keys.

Why this answer

Changing the eviction policy to noeviction causes Redis to return errors instead of evicting keys when memory is full. This ensures that all existing keys remain present, which is critical for the application. While scaling up (option D) could increase memory capacity, it does not guarantee that evictions will be prevented if memory usage grows to exceed the new limit.

The noeviction policy directly prevents evictions, at the cost of write failures when memory is exhausted.

37
Multi-Selectmedium

A company is running a production Cloud SQL for PostgreSQL instance and wants to implement point-in-time recovery (PITR) with a 7-day retention window. They also need to ensure that automated backups are taken daily. Which two configurations must be enabled? (Choose TWO.)

Select 2 answers
A.Set the database flag 'archive_mode' to 'on' for WAL archiving
B.Enable binary logging by setting 'log_bin' flag
C.Configure automated backups via Cloud SQL backup settings
D.Create a cross-region backup replica
E.Set the backup retention to 7 days using gcloud sql instances patch --backup-start-time
AnswersA, C

WAL archiving is required for PITR in PostgreSQL.

Why this answer

PITR requires WAL archiving, which is enabled by setting the 'archive_mode' to 'on' (or 'always') in the database flags. Automated backups are scheduled via the backup configuration in Cloud SQL. The retention period for PITR is set separately under backup settings.

38
MCQeasy

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

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

This metric directly shows the replication lag in seconds.

Why this answer

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

39
MCQhard

A company uses Firestore in Native mode. They have a collection with 1 million documents and frequently run queries that filter on two fields: status and createdAt. The queries are slow. What should the team do?

A.Create a composite index on (status, createdAt)
B.Create an index exemption for the status field
C.Use the Datastore mode instead
D.Add an index exemption for the createdAt field
AnswerA

Composite indexes are required for queries on multiple fields to be efficient.

Why this answer

Firestore creates single-field indexes automatically but for multi-field queries, a composite index must be created manually. Without it, queries may be slow or fail.

40
Multi-Selectmedium

A company is using Cloud SQL for PostgreSQL and needs to perform a disaster recovery drill by promoting a read replica to a standalone instance. They also need to ensure the replica is as current as possible before promotion. Which TWO steps should they take? (Choose two.)

Select 2 answers
A.Promote the replica using gcloud sql instances promote-replica
B.Enable binary logging on the replica
C.Check the replication_lag metric on the replica to confirm it is within acceptable range
D.Create an on-demand backup of the primary before promotion
E.Force a failover to the replica
AnswersA, C

Promotion converts the read replica into a standalone instance.

Why this answer

`gcloud sql instances promote-replica` is the standard command to promote a Cloud SQL read replica to a standalone instance, making it a primary that can accept writes. Option C is correct because checking the `replication_lag` metric ensures the replica has applied all pending changes from the primary before promotion, minimizing data loss. This step is critical because promoting a replica that is behind can result in lost transactions.

Exam trap

The trap here is that candidates confuse promoting a read replica with performing a failover in a Cloud SQL high-availability cluster, leading them to select 'Force a failover to the replica' instead of the correct promotion command using 'gcloud sql instances promote-replica'.

41
MCQmedium

A company has a Cloud SQL for PostgreSQL instance with a read replica in another region. They want to perform disaster recovery testing without affecting the primary. What should they do?

A.Promote the read replica to a standalone instance and use it for testing.
B.Use the replica as a failover target; testing is not allowed.
C.Enable point-in-time recovery on the replica and restore to a new instance.
D.Create a clone of the primary instance and test on that.
AnswerA

Promoting the replica makes it an independent instance, suitable for DR testing.

Why this answer

Promoting the read replica to a standalone instance detaches it from the primary, creating an independent writable Cloud SQL instance. This allows you to perform disaster recovery testing (e.g., failover validation, data integrity checks) without any impact on the primary instance, as the replica no longer replicates changes from the primary.

Exam trap

The trap here is that candidates assume read replicas are permanently read-only and cannot be used for testing, or they confuse promoting a replica with cloning the primary, which would impact the primary's performance.

How to eliminate wrong answers

Option B is wrong because Cloud SQL read replicas can be promoted to standalone instances for testing; there is no restriction that 'testing is not allowed' — the misconception is that replicas are read-only and cannot be used for write operations, but promotion makes them writable. Option C is wrong because point-in-time recovery (PITR) is a feature of the primary instance, not directly on a read replica; you cannot enable PITR on a replica and restore to a new instance — you would need to restore from the primary's backups or use the replica's data after promotion. Option D is wrong because creating a clone of the primary instance would require the primary to be online and could cause additional load or replication lag; the correct approach is to use the already-existing read replica to avoid any impact on the primary.

42
MCQmedium

An organization runs a Cloud SQL for MySQL instance for its e-commerce platform. During a load test, they notice the CPU utilization consistently exceeds 80% and queries are slowing down. The instance is using 2 vCPUs. The team needs to improve performance with minimal downtime. What should they do?

A.Increase the number of vCPUs and memory via vertical scaling
B.Create a cross-region read replica
C.Enable automatic storage increase
D.Shard the database using application-level sharding
AnswerA

Vertical scaling adds more CPU and memory, directly addressing high CPU utilization. Cloud SQL supports this online.

Why this answer

Increasing vCPUs and memory vertically (scaling up) is the quickest way to improve CPU-bound performance with minimal downtime. Cloud SQL supports online vertical scaling. Read replicas are for read offloading, not CPU-bound write performance.

Auto-storage increase addresses storage, not CPU.

43
MCQhard

A Cloud Spanner database is experiencing high CPU utilization (above 80%). The team wants to add an index to optimize a frequently used query. The schema change must not cause downtime. How should they proceed?

A.Export the database, create the index in a new instance, then import.
B.Use gcloud spanner databases ddl update with --async flag.
C.Stop the application, run the DDL statement, then restart.
D.Create the index using the Google Cloud Console; it will be applied online.
AnswerD

Spanner supports online schema changes, including index creation, without downtime.

Why this answer

Spanner supports online schema changes; CREATE INDEX is non-blocking and can be executed via DDL without downtime.

44
Multi-Selecthard

A company runs Memorystore for Redis with a Standard tier instance. They want to scale to higher throughput and memory capacity beyond the current tier limits. Which TWO actions should they take?

Select 2 answers
A.Switch from HDD to SSD storage.
B.Enable Redis Cluster to shard data across multiple nodes.
C.Add a cross-region replica to increase read capacity.
D.Increase the maxmemory setting beyond the tier limit.
E.Upgrade to a larger tier (e.g., from M5 to M10).
AnswersB, E

Redis Cluster allows horizontal scaling.

Why this answer

Redis Cluster shards data across multiple nodes, allowing horizontal scaling beyond the limits of a single Standard tier instance. This enables higher throughput and memory capacity by distributing the dataset across multiple primary nodes, each handling a subset of the keyspace.

Exam trap

The PCDOE exam often tests the distinction between vertical scaling (upgrading tier) and horizontal scaling (sharding), and candidates may mistakenly think that increasing maxmemory or adding replicas can overcome tier limits, when in fact replicas do not increase total memory capacity and maxmemory is bounded by the instance's physical RAM.

45
MCQhard

You are responsible for a Cloud Spanner instance that serves a global user base. A new feature requires adding an index on a column of an existing table that contains millions of rows. The table is actively used by production traffic. What is the recommended approach to add the index with minimal impact?

A.Create a second table with the index already defined, then copy the data using batch writes and switch traffic. This avoids any impact to the original table.
B.Take a full database backup to Cloud Storage, restore it to a new instance, create the index on the restored instance, and then fail over to the new instance.
C.Use the gcloud command 'gcloud spanner databases ddl update' with an ALTER TABLE statement to add the index. This will lock the table briefly but is acceptable.
D.Use the gcloud command 'gcloud spanner databases ddl update' with a CREATE INDEX statement. The operation will be non-blocking and will not impact production traffic.
AnswerD

Correct. CREATE INDEX in Spanner is an online, non-blocking operation.

Why this answer

Cloud Spanner supports online, non-blocking index creation. The CREATE INDEX statement processes the index in the background and does not block reads or writes on the table. This is the most efficient and least impactful method.

Using a backup/restore or export/import is unnecessarily complex and disruptive.

46
MCQmedium

A company uses Cloud SQL for MySQL to run an e-commerce application. They need to ensure that they can recover the database to any point within the last 4 days. They also want to minimize storage costs. Which configuration should they use?

A.Enable automated backups with a 4-day retention schedule.
B.Enable binary logging with the 'log_bin' flag and set the transaction log retention to 4 days in the backup configuration.
C.Enable binary logging and set the transaction log retention to 4 days. Disable automated backups.
D.Enable point-in-time recovery by setting the 'point_in_time_recovery' flag to true with a 4-day window.
AnswerB

Correct! Binary logging enables PITR, and setting transaction log retention to 4 days allows recovery to any point within the last 4 days.

Why this answer

Point-in-time recovery (PITR) in Cloud SQL for MySQL requires binary logging, which can be enabled with the 'log_bin' flag. The transaction log retention period can be set from 1 to 7 days. For 4-day recovery, set the retention to 4 days.

Option B is correct: enable binary logging and set the transaction log retention to 4 days. Option A is wrong because automated backups alone only restore to backup time, not any point. Option C is wrong because disabling automated backups is not necessary—automated backups are still needed for initial restore points, but PITR uses transaction logs.

Option D is wrong because point-in-time recovery is enabled by setting binary logging and retention; there is no separate 'point_in_time_recovery' flag.

47
MCQmedium

A startup uses Memorystore for Redis as a session store. They are concerned about losing session data if the instance fails. Which option provides the best durability for session data without significant application changes?

A.Increase the maxmemory setting to store more data
B.Take regular snapshots of the instance using gcloud commands
C.Enable Redis persistence (RDB/AOF) on the Memorystore instance
D.Configure a cross-region replica to provide high availability
AnswerD

Cross-region replicas provide failover capability, protecting against zone/regional failures with minimal application changes.

Why this answer

Configuring a cross-region replica in Memorystore for Redis provides high availability and durability by replicating data asynchronously to a replica instance in a different region. If the primary instance fails, the replica can be promoted, minimizing session data loss without requiring significant application changes, as the application continues to connect to the same endpoint or a new primary endpoint.

Exam trap

A common misconception in this exam is that enabling persistence (RDB/AOF) provides high availability and durability against instance failures, when in reality persistence only protects against data loss on restart and does not provide automatic failover or cross-region resilience.

How to eliminate wrong answers

Option A is wrong because increasing the maxmemory setting only allows more data to be stored in memory but does not provide any durability or protection against data loss if the instance fails; it simply expands the available memory capacity. Option B is wrong because taking regular snapshots using gcloud commands is a manual, external backup process that does not provide automatic failover or real-time durability; it introduces operational overhead and potential data loss between snapshots, and it requires application changes to handle failover. Option C is wrong because enabling Redis persistence (RDB/AOF) on a Memorystore instance provides local disk-based persistence but does not protect against instance-level failures (e.g., zone or regional outages) and can introduce performance overhead; it also does not offer automatic failover, and the application would still experience downtime during recovery.

48
MCQmedium

A company uses Memorystore for Redis with the 'volatile-lru' eviction policy. They notice that recently added keys with TTL are being evicted even though there is still memory available. What is the most likely cause?

A.The volatile-lru policy evicts only keys with an expiry set, and there are many keys without expiry occupying memory
B.The allkeys-lru policy would be more appropriate
C.The maxmemory setting is not configured
D.The maxmemory-policy is misconfigured
AnswerA

volatile-lru evicts only keys with TTL. If many non-volatile keys consume memory, volatile keys may be evicted even if overall memory appears free.

Why this answer

The 'volatile-lru' eviction policy in Memorystore for Redis evicts only keys that have a TTL (expiry) set, using an LRU (Least Recently Used) algorithm among those keys. If many keys without expiry are consuming memory, the eviction process will still target only the volatile keys, even if overall memory is not fully exhausted, because the policy is constrained to evict only from the subset of keys with TTLs. This explains why recently added keys with TTL are being evicted prematurely — the non-volatile keys are 'protected' from eviction, forcing the eviction of volatile keys to free memory.

Exam trap

A common misconception is that 'volatile-lru' evicts all keys when memory is low, but in fact it only evicts keys with TTLs, leaving non-volatile keys untouched even if they consume the majority of memory.

How to eliminate wrong answers

Option B is wrong because 'allkeys-lru' would evict any key (including those without expiry) based on LRU, which would not specifically cause the eviction of recently added TTL keys if memory is still available; the issue here is that non-volatile keys are occupying memory and not being evicted, not that the policy is too aggressive. Option C is wrong because if 'maxmemory' were not configured, Redis would use unlimited memory and no eviction would occur at all, contradicting the observation that eviction is happening. Option D is wrong because the 'maxmemory-policy' is correctly set to 'volatile-lru' as stated; the misconfiguration is not in the policy itself but in the understanding that this policy only evicts volatile keys, which is the intended behavior.

49
MCQmedium

A company uses Firestore in Native mode for their application. They need to query a collection where documents must match a specific field value and be sorted by a different field. The query filters on 'status' and orders by 'timestamp'. What should the engineer do to ensure the query performs optimally?

A.Create an index exemption to improve query performance.
B.Use a collection group query to bypass index requirements.
C.Rely on automatic single-field indexes; they will cover the query.
D.Create a composite index on the 'status' and 'timestamp' fields.
AnswerD

A composite index is required for queries with both an equality filter and an order by on different fields.

Why this answer

Firestore requires a composite index when a query includes both an equality filter on one field (status) and an order by clause on a different field (timestamp). Without this composite index, Firestore cannot efficiently satisfy both the filter and the sort order in a single index scan, leading to suboptimal performance or query failure. Creating a composite index on (status, timestamp) allows Firestore to use a single index to match the filter and return results in the requested order.

Exam trap

Google exams often test the misconception that automatic single-field indexes are sufficient for all queries, but the trap here is that queries combining an equality filter and an order by on different fields always require a composite index.

How to eliminate wrong answers

Option A is wrong because index exemptions do not exist in Firestore; the concept of index exemptions applies to other Google Cloud services like BigQuery, not Firestore. Option B is wrong because collection group queries are used to query across all collections with the same name, not to bypass index requirements; they still require appropriate indexes. Option C is wrong because automatic single-field indexes only cover queries that filter or order by a single field; a query with both a filter on one field and an order by on a different field requires a composite index.

50
MCQeasy

You need to monitor the disk usage of your Cloud SQL instances and receive an alert when disk usage exceeds 80%. Which GCP service should you use to set up this alert?

A.Cloud Monitoring
B.Cloud Audit Logs
C.Cloud Logging
D.Cloud Billing reports
AnswerA

Cloud Monitoring provides metrics and alerting for Cloud SQL disk usage.

Why this answer

Cloud Monitoring (formerly Stackdriver) is the GCP service for monitoring metrics and setting up alerting policies. Cloud Logging is for logs, Cloud Audit Logs for audit trails, and Cloud Billing reports for cost tracking.

51
MCQmedium

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

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

Correct. Replication lag is measured in seconds and available in Cloud Monitoring.

Why this answer

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

Exam trap

Google Cloud often tests the distinction between metrics that measure performance (like CPU load) versus metrics that measure data freshness (like replication lag), and candidates may confuse Key Visualizer's diagnostic capabilities with real-time monitoring metrics.

How to eliminate wrong answers

Option B is wrong because 'cpu_load' is a cluster-level metric that measures CPU utilization, not replication lag; it does not indicate how current a replica is. Option C is wrong because Key Visualizer is a tool for analyzing access patterns and hotspotting, not for monitoring real-time replication lag; it provides historical heatmaps, not a continuous lag metric. Option D is wrong because 'rows_returned' is a table-level metric that counts rows returned by read requests, which has no relation to replication delay between clusters.

52
Multi-Selectmedium

A company uses Cloud Spanner for a global application. They need to capture real-time changes to certain tables for downstream processing. Which two services or features can be used together to achieve this? (Choose TWO.)

Select 2 answers
A.Spanner change streams
B.Cloud Pub/Sub Lite
C.Cloud SQL for PostgreSQL
D.Cloud Functions
E.Cloud Dataflow
AnswersA, E

Change streams provide a log of row-level changes.

Why this answer

Spanner change streams capture transactional changes in near real-time. Dataflow can read from change streams and stream the changes to downstream systems like Pub/Sub, BigQuery, or Cloud Storage.

53
Multi-Selecteasy

A development team is using Firestore in Native mode. They want to ensure that queries on array fields return correct results. Which two actions should they take? (Choose TWO.)

Select 2 answers
A.Create a composite index for every query involving array fields.
B.Set index exemptions for arrays and maps to disable automatic indexing.
C.Use the 'array-contains' operator only on indexed arrays.
D.Manually create indexes for each array field in the Firestore console.
E.Understand that array fields are automatically indexed as single-field indexes.
AnswersC, E

Correct. The array-contains operator can only be used on fields that are indexed. Since Firestore auto-indexes array fields, this is typically satisfied unless exemptions are set.

Why this answer

Firestore automatically creates single-field indexes for all fields, including array fields. This means the array-contains operator works without manual indexing, provided the field has not been excluded via index exemptions. However, to ensure queries return correct results, developers must understand that array fields are indexed by default (E) and that array-contains only works on indexed arrays (C).

Option B is incorrect because disabling indexing via exemptions would prevent array-contains queries from working.

Exam trap

A common trap is thinking that array fields require special manual indexing or that index exemptions are needed for queries to work. In reality, automatic indexing covers array fields, and exemptions only serve to exclude fields to reduce costs or meet specific requirements.

54
Multi-Selectmedium

A company uses Memorystore for Redis and wants to achieve high availability with automatic failover. They also need to periodically back up the data to Cloud Storage for disaster recovery. Which TWO features should they use? (Choose two.)

Select 2 answers
A.Standard Tier (replication)
B.Export functionality to Cloud Storage
C.Redis Cluster
D.AOF persistence
E.Basic Tier
AnswersA, B

Standard Tier provides a replica in a different zone for automatic failover.

Why this answer

Standard Tier (replication) provides a primary-replica architecture with automatic failover, ensuring high availability. The Export functionality allows you to manually or scheduled export Redis data to Cloud Storage, enabling point-in-time recovery for disaster recovery purposes.

Exam trap

The Google Cloud exam often tests the distinction between high-availability features (replication/failover) and durability/backup features (export to Cloud Storage), tricking candidates into selecting AOF persistence or Redis Cluster as solutions for disaster recovery.

55
MCQmedium

An engineer needs to create a cross-region read replica for a Cloud SQL for MySQL instance to improve read scalability and provide disaster recovery. What must be configured on the primary instance to support cross-region replication?

A.Enable binary logging on the primary instance.
B.Enable automated backups and point-in-time recovery.
C.Configure a Cloud VPN between the regions.
D.Set the primary instance to use MySQL 8.0.
AnswerA

Correct. Binary logging is required for any replication, especially cross-region.

Why this answer

Cross-region replication for Cloud SQL for MySQL relies on MySQL's native binary log (binlog) based replication. Enabling binary logging on the primary instance records all data changes in binary log files, which the read replica in another region uses as the source for applying changes. Without binary logging enabled, the primary instance cannot provide the change stream necessary for cross-region replication to function.

Exam trap

Google often tests the misconception that network connectivity (like VPN) or backup features are required for replication, when in fact the core requirement is enabling the binary log on the primary instance to provide the change stream.

How to eliminate wrong answers

Option B is wrong because automated backups and point-in-time recovery are not prerequisites for replication; they are separate features for data recovery and do not provide the ongoing change stream needed for replication. Option C is wrong because Cloud SQL cross-region replication uses Google's internal network and does not require a Cloud VPN; the replication traffic traverses Google's backbone, not a customer-managed VPN tunnel. Option D is wrong because MySQL 8.0 is not a requirement for cross-region replication; Cloud SQL supports replication for MySQL 5.7 and 8.0, and the version must be compatible between primary and replica, but the key enabler is binary logging, not the specific major version.

56
MCQmedium

A Cloud SQL for MySQL instance is running out of storage. The team wants to increase storage automatically without manual intervention. However, they also want to control costs and avoid a sudden increase in storage beyond 1 TB. What should they do?

A.Set up a Cloud Function to monitor disk usage and resize the disk when needed.
B.Enable auto-storage increase and set the maximum storage size to 1 TB.
C.Manually increase disk size by 10% each time usage reaches 80%.
D.Enable auto-storage increase; it automatically stops at 1 TB.
AnswerB

Auto-increase with a cap meets both requirements.

Why this answer

Cloud SQL for MySQL provides an 'auto-storage increase' feature that automatically adds storage when usage is high. To control costs and prevent storage from exceeding 1 TB, you can enable this feature and set the maximum storage size to 1 TB. Option B is correct because it combines automation with a cost cap.

Option A (using a Cloud Function) is more complex and not necessary since Cloud SQL has a built-in feature; it also doesn't guarantee a cap. Option C (manual resize) is not automated. Option D (enable auto-storage increase without setting a maximum) would allow storage to grow beyond 1 TB, failing the cost control requirement.

57
MCQmedium

A Cloud Bigtable instance is experiencing high read latency. The team suspects hot spotting on a single node. Which tool should they use to identify the hotspot?

A.Cloud Logging to review request logs
B.Key Visualizer
C.Bigtable Admin API to list tables
D.Cloud Monitoring (Stackdriver) to check CPU utilization
AnswerB

Key Visualizer provides heatmaps of reads/writes to detect hot spots.

Why this answer

Key Visualizer is the correct tool because it is specifically designed to analyze access patterns in Cloud Bigtable and identify hot spotting—where a small range of row keys receives a disproportionate amount of traffic. It visualizes read and write heatmaps across row key space and time, allowing teams to pinpoint the exact keys causing the hotspot. Unlike general-purpose monitoring tools, Key Visualizer provides row-key-level granularity essential for diagnosing hot spotting.

Exam trap

The exam often tests the distinction between general-purpose monitoring tools (Cloud Monitoring, Cloud Logging) and purpose-built diagnostic tools (Key Visualizer), trapping candidates who assume any monitoring tool can identify row-key-level hotspots.

How to eliminate wrong answers

Option A is wrong because Cloud Logging captures request logs at the instance level, but it does not provide row-key-level heatmaps or access pattern analysis needed to identify hot spotting; it is useful for debugging errors, not visualizing key distribution. Option C is wrong because the Bigtable Admin API is used for administrative operations like creating, listing, or deleting tables and clusters, not for monitoring real-time access patterns or detecting hotspots. Option D is wrong because Cloud Monitoring (Stackdriver) can show CPU utilization metrics, which may indicate overall load but cannot reveal which specific row keys are causing the hotspot; high CPU could be due to many factors unrelated to key distribution.

58
MCQmedium

An application uses Cloud Firestore. The team notices that queries on a collection with an array field are slow. They want to create an index on the array field. What should they do?

A.Create a collection group index on the field.
B.Create a composite index on the array field and another field.
C.Create an index exemption for the array field.
D.Rely on the automatically created single-field index.
AnswerB

Correct. A composite index that includes the array field is required to support array queries efficiently. This index enables the use of array-contains and other array-related operations.

Why this answer

Cloud Firestore does not support single-field indexes on array fields. To enable efficient queries involving array fields, you must create a composite index that includes the array field along with another field. This allows Firestore to use the composite index for array-contains queries and other array operations, improving query performance.

Exam trap

Google Cloud often tests the misconception that array fields cannot be included in composite indexes without special handling, but Firestore supports composite indexes containing array fields by default.

How to eliminate wrong answers

Option A is wrong because a collection group index is used for queries that span multiple collections with the same name, not for indexing array fields. Option B is wrong because composite indexes in Firestore cannot include an array field as part of the index; array fields are only indexed for equality queries using the automatic array index. Option D is wrong because Firestore does not automatically create single-field indexes for array fields; it only creates an automatic array index for equality queries, which may not be sufficient for performance optimization.

59
MCQmedium

A company runs a Cloud Bigtable instance with SSD storage and wants to switch to HDD storage to reduce costs. The instance cannot tolerate downtime for data migration. What is the correct approach?

A.Create a new Cloud Bigtable cluster with HDD storage and migrate data
B.Increase the number of nodes to reduce per-node cost
C.Add a cross-region replica and then promote it with HDD storage
D.Use the gcloud bigtable clusters update command to change storage type
AnswerA

To change storage type, you must create a new cluster with the desired type and migrate the data.

Why this answer

Cloud Bigtable does not support in-place conversion of storage type from SSD to HDD. The only way to switch storage without downtime is to create a new cluster with HDD storage, then use a replicated setup (e.g., via a replication cluster or application-level dual-write) to migrate data while the original cluster remains operational. This ensures zero downtime during the migration.

Exam trap

The trap here is that candidates assume a simple update command or replica promotion can change storage type, but Cloud Bigtable does not allow in-place storage type changes or replication across different storage types, forcing a new cluster creation with data migration.

How to eliminate wrong answers

Option B is wrong because increasing the number of nodes does not change the storage type from SSD to HDD; it only scales throughput and capacity, not the underlying storage medium, so it does not reduce per-node cost in the context of switching to HDD. Option C is wrong because cross-region replication in Cloud Bigtable requires both clusters to use the same storage type (SSD or HDD); you cannot add a replica with a different storage type and then promote it, as replication is not supported across different storage types. Option D is wrong because the gcloud bigtable clusters update command does not support changing the storage type; it can only modify node count or other cluster settings, not the underlying storage medium.

60
MCQmedium

A Cloud Spanner database is experiencing increased read traffic. You need to add an index to improve query performance without downtime. What is the correct approach?

A.Export the database, create the index in a new instance, then import.
B.Use the ALTER TABLE statement to add the index as a constraint.
C.Create a secondary index using the 'CREATE INDEX WITH OFFLINE' option to avoid blocking.
D.Use the CREATE INDEX statement. Spanner creates indexes online without blocking writes or reads.
AnswerD

Spanner supports online index creation; the index is built in the background without downtime.

61
MCQhard

You are running a Memorystore for Redis instance with persistence disabled. The application requires high availability and data durability after a zone failure. What is the most cost-effective approach?

A.Use a Basic tier instance and schedule periodic exports to Cloud Storage.
B.Enable persistence using the AOF or RDB configuration in Memorystore.
C.Use a Standard tier instance with cross-zone replication.
D.Deploy a Redis Cluster across multiple regions using Memorystore.
AnswerC

Standard tier provides Multi-Zone replication for HA; data is replicated across zones.

Why this answer

Standard tier Memorystore for Redis instances provide cross-zone replication by default, ensuring automatic failover and data durability in the event of a zone failure. This meets the high availability and data durability requirements without the need for manual exports or complex multi-region setups, making it the most cost-effective solution.

Exam trap

The trap here is that candidates often confuse data persistence (AOF/RDB) with high availability (cross-zone replication), leading them to choose Option B, which only addresses durability after a crash, not zone failure recovery.

How to eliminate wrong answers

Option A is wrong because Basic tier instances are single-zone and lack replication, so they cannot provide high availability or data durability after a zone failure; periodic exports to Cloud Storage only provide point-in-time recovery, not automatic failover. Option B is wrong because enabling AOF or RDB persistence in Memorystore only protects against data loss from restarts or crashes, not against zone failures, and it does not provide cross-zone high availability. Option D is wrong because deploying a Redis Cluster across multiple regions introduces significant complexity, higher latency, and increased cost due to inter-region traffic and multi-region replication, which is overkill for a single zone failure scenario.

62
MCQeasy

A game development company wants to use Memorystore for Redis as a session store. They need to ensure that when memory is full, the least recently used keys are evicted first. Which eviction policy should they configure?

A.volatile-lru
B.allkeys-lru
C.volatile-ttl
D.noeviction
AnswerB

This evicts the least recently used keys from the entire keyspace, which matches the requirement.

Why this answer

(allkeys-lru) is correct because the requirement is to evict the least recently used keys from the entire keyspace when memory is full. The 'allkeys-lru' policy applies the LRU algorithm to all keys, regardless of whether they have an expiry set, which matches the need to evict the least recently used keys first across the entire dataset.

Exam trap

A common pitfall in Redis eviction policies is confusing 'volatile-lru' (only keys with TTL) with 'allkeys-lru' (all keys). Since the company needs to evict the least recently used keys regardless of expiry, 'allkeys-lru' is correct.

How to eliminate wrong answers

Option A (volatile-lru) is wrong because it only evicts keys with an expiry set (volatile keys), but the requirement is to evict from all keys, not just those with TTL. Option C (volatile-ttl) is wrong because it evicts keys with the shortest remaining TTL, not the least recently used keys, which does not satisfy the LRU requirement. Option D (noeviction) is wrong because it returns errors on write operations when memory is full, rather than evicting any keys, which would break the session store functionality.

63
MCQmedium

A company runs an e-commerce application on Cloud SQL for MySQL. They need to recover the database to a specific point in time 15 minutes ago after an accidental data deletion. What must be configured beforehand?

A.Create a cross-region replica for failover
B.Enable automated backups only
C.Configure binary logging and set a PITR retention period
D.Set up an on-demand backup every hour
AnswerC

Binary logging is required for PITR, and the retention period determines how far back you can recover.

Why this answer

Point-in-time recovery (PITR) in Cloud SQL for MySQL relies on binary logging (binlog) to capture all write operations. To recover to a specific moment (e.g., 15 minutes ago), you must enable automated backups (which provide the base restore point) and configure binary logging with a retention period that covers the desired recovery window. Option C correctly specifies both requirements: binary logging must be enabled, and a PITR retention period (e.g., 1–7 days) must be set to retain the necessary binlog files for replay.

Exam trap

The PCDOE exam often tests the misconception that automated backups alone are sufficient for point-in-time recovery, but candidates must recognize that binary logging and a PITR retention period are required to replay transactions beyond the last snapshot.

How to eliminate wrong answers

Option A is wrong because a cross-region replica provides disaster recovery and failover capability, not the granular transaction logs needed for point-in-time recovery; it does not enable binlog-based PITR. Option B is wrong because enabling automated backups alone only creates daily backup snapshots; without binary logging, you can only restore to the time of the last backup, not to a specific minute. Option D is wrong because on-demand backups are manual snapshots taken at a specific moment; they do not provide continuous transaction log replay, so you cannot recover to an arbitrary point between backups.

64
MCQmedium

You have a Cloud Bigtable instance with a single cluster. To improve availability and durability, you want to enable replication across two regions. After configuring replication, you notice that reads from the replica cluster show data that is not yet consistent with the primary. What is the expected consistency model for Bigtable replication?

A.Read-your-writes consistency from the primary
B.Eventually consistent reads from replicas
C.Strongly consistent reads from any cluster
D.Strict serializability across clusters
AnswerB

Bigtable uses async replication, so replicas are eventually consistent. This is the expected behavior.

Why this answer

Cloud Bigtable replication uses an eventually consistent model for reads from replica clusters. When you write to the primary cluster, the data is asynchronously replicated to the replica cluster using a distributed replication pipeline. This means that reads from the replica cluster may return stale data until the replication process completes, and there is no guarantee of immediate consistency with the primary.

Exam trap

A common misconception is that Bigtable replication provides strongly consistent reads across all clusters, similar to synchronous replication, but it is eventually consistent. Only the primary cluster guarantees strong consistency.

How to eliminate wrong answers

Option A is wrong because read-your-writes consistency is a property of the primary cluster, not of replicas; Bigtable does not guarantee that a write to the primary is immediately visible from the replica. Option C is wrong because strongly consistent reads are only guaranteed from the primary cluster, not from any cluster; replicas provide only eventual consistency. Option D is wrong because strict serializability is not supported across clusters in Bigtable replication; replication is asynchronous and does not provide global ordering or serializability.

65
MCQhard

You are managing a Cloud SQL for PostgreSQL instance with point-in-time recovery (PITR) enabled. The retention period is set to 7 days. A developer accidentally dropped a critical table 3 days ago. You need to restore the database to the state just before the table was dropped, without affecting the current production instance. What should you do?

A.Enable binary logging and reconfigure PITR retention to 10 days, then wait for the logs to catch up.
B.Use the gcloud sql backups create command to create an on-demand backup, then restore the original instance to that backup.
C.Use the gcloud sql instances clone command with the --point-in-time flag to clone the instance to a new instance at the timestamp just before the table was dropped.
D.Use the gcloud sql instances restore-backup command to restore the original instance to the backup from 3 days ago.
AnswerC

Cloning with --point-in-time creates a new instance restored to that exact timestamp, preserving the original instance. This is the correct procedure.

Why this answer

The gcloud sql instances clone command with the --point-in-time flag allows you to create a new Cloud SQL instance that is a clone of the original at a specific timestamp. Since PITR is enabled and the retention period is 7 days, you can specify a timestamp just before the table was dropped (3 days ago) to restore the database to that exact state without affecting the current production instance. This approach meets the requirement of restoring to a point in time without overwriting the original instance.

Exam trap

The trap here is that candidates may confuse the clone command with the restore-backup command, thinking they must restore the original instance to a previous backup, but the question explicitly requires not affecting the current production instance, making clone the correct choice.

How to eliminate wrong answers

Option A is wrong because binary logging is not a configurable setting in Cloud SQL for PostgreSQL (it uses PostgreSQL's WAL archiving for PITR, not MySQL-style binary logs), and increasing retention to 10 days does not help recover a table dropped 3 days ago without restoring from a backup or clone. Option B is wrong because creating an on-demand backup captures the current state, not the state from 3 days ago, so restoring to that backup would not recover the dropped table. Option D is wrong because restoring the original instance to a backup from 3 days ago would overwrite the current production instance, which violates the requirement to not affect the current production instance.

66
MCQhard

A Cloud SQL for MySQL instance's storage utilization has reached 95%. The database is 5 TB and needs to grow. The operations team tries to increase storage via gcloud but receives an error. What is the likely cause?

A.The instance is at the maximum storage limit for its machine tier
B.The storage resize operation is only allowed during maintenance windows
C.The instance has binary logging enabled, which prevents storage increase
D.The instance has automatic storage increase disabled
AnswerA

Each Cloud SQL tier has a max storage limit (e.g., 10 TB for db-n1-standard-8). If the instance is already at that limit, resize is blocked.

Why this answer

Cloud SQL allows online storage increases but with limits: the maximum storage cannot exceed 30 TB, and the increase must be done in increments. However, the error is likely because the instance is using the maximum allowed storage for its tier, or the storage cannot be shrunk. But the most common issue is that the instance has an on-demand backup or restore operation in progress, which blocks resize.

Another possibility is that the storage is already at the maximum for that machine type. However, the question implies a common misconfiguration: the instance may have a read replica that is replicating from it, and storage resize is not allowed if the replica is in a different region? Actually, storage resize is allowed regardless. More likely: the user has reached the maximum storage size for the current tier (e.g., db-n1-standard-8 supports up to 10 TB).

The correct answer is tier storage limit.

67
MCQhard

A large enterprise uses Cloud Bigtable for analytics. They notice that some nodes are handling significantly more traffic than others, causing hot spots and performance degradation. Which tool should they use to identify the specific row keys causing the issue?

A.Bigtable Key Visualiser
B.Stackdriver Error Reporting
C.Bigtable cbt tool with read rows command
D.Cloud Monitoring dashboard for Bigtable
AnswerA

Correct. Key Visualiser visualizes access patterns to identify hot spots.

Why this answer

Key Visualiser is a Bigtable tool that provides a heatmap of row key access patterns, helping to identify hot spots by showing which row key ranges are heavily accessed.

68
Multi-Selectmedium

A developer is building an application that uses Firestore (in Datastore mode). The application needs to query data across two properties: 'status' and 'timestamp', with an equality filter on 'status' and a range filter on 'timestamp'. Which three steps are required to support this query efficiently? (Choose THREE.)

Select 3 answers
A.Ensure that single-field indexes exist for both 'status' and 'timestamp'
B.Enable automatic composite index creation in Firestore settings
C.Create an index exemption for the 'timestamp' field
D.Create a composite index on the 'status' and 'timestamp' fields
E.Use gcloud alpha firestore indexes composite create to define the index
AnswersA, D, E

Firestore in Datastore mode requires single-field indexes on both 'status' and 'timestamp' to support equality and range filters. These indexes are not automatically created; they must be manually defined. Ensuring they exist is necessary even when a composite index is present.

Why this answer

Firestore (in Datastore mode) requires single-field indexes to be defined for each property used in a query, even when a composite index is also present. Without a single-field index on 'status' and 'timestamp', the query engine cannot efficiently evaluate the equality and range filters, leading to full table scans or query failures.

Exam trap

A common misconception is that Firestore in Datastore mode automatically creates composite indexes like Firestore Native mode does, but Datastore mode requires manual composite index creation. Also, index exemptions cannot replace proper composite index design.

69
MCQeasy

A Cloud SQL for PostgreSQL instance is running out of storage. The engineer wants to configure automatic storage increase to avoid manual intervention. What should they do?

A.Use gcloud sql instances patch with the --disk-size flag to set a larger size.
B.Use gcloud sql instances patch with the --storage-auto-increase flag.
C.Create a cron job to monitor disk usage and increase storage via API.
D.Use gcloud sql instances create to create a new instance with larger storage.
AnswerB

This enables automatic storage increase for the Cloud SQL instance.

Why this answer

Cloud SQL for PostgreSQL supports automatic storage increase, which can be enabled via the `--storage-auto-increase` flag in the `gcloud sql instances patch` command. This feature automatically increases the instance's storage capacity when it approaches the configured limit, eliminating the need for manual intervention.

Exam trap

The trap here is that candidates may confuse manual resizing (using `--disk-size`) with automatic storage increase, or think that a custom monitoring solution is required, when Cloud SQL's built-in `--storage-auto-increase` flag is the correct and simplest solution.

How to eliminate wrong answers

Option A is wrong because the `--disk-size` flag only sets a static disk size; it does not enable automatic storage increase, so manual resizing would still be required when storage runs out. Option C is wrong because creating a custom cron job to monitor and increase storage via the API is unnecessary and error-prone; Cloud SQL provides a built-in automatic storage increase feature that should be used instead. Option D is wrong because creating a new instance with larger storage is a disruptive, manual migration process that does not solve the need for automatic scaling; it also requires downtime and data migration, whereas the existing instance can be patched to enable auto-increase.

70
MCQeasy

A company is using Memorystore for Redis and wants to ensure data persistence in case of a failure. What is the recommended approach?

A.Configure a standard tier instance, which provides automatic persistence.
B.Enable RDB persistence and configure the backup interval.
C.Use Cloud Storage snapshots (export) or configure cross-region replication.
D.Enable AOF persistence in Memorystore settings.
AnswerC

Correct. Use scheduled exports to Cloud Storage or cross-region replication for disaster recovery.

Why this answer

Memorystore for Redis does not support native persistence (AOF/RDB). For data durability, the recommendation is to use scheduled Cloud Storage snapshots or cross-region replication.

71
MCQmedium

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

A.bytes_received
B.disk_read_ops
C.replication_lag
D.cpu_utilization
AnswerC

This metric directly measures replica lag in seconds.

Why this answer

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

Exam trap

The trap here is that candidates might confuse performance metrics like CPU or disk I/O with direct replication delay, assuming high resource usage always indicates lag, when in fact `replication_lag` is the only metric that measures the exact time difference between primary and replica.

How to eliminate wrong answers

Option A is wrong because `bytes_received` measures the amount of data received by the instance, not the time delay in replication; it could be high even when lag is low. Option B is wrong because `disk_read_ops` tracks input/output operations on disk, which is unrelated to replication lag and instead indicates storage performance. Option D is wrong because `cpu_utilization` measures processor usage, which does not directly represent the replication delay; high CPU could cause lag but is not a direct measure of it.

72
MCQmedium

An e-commerce platform uses Cloud Bigtable for session data. They need to ensure that if one zone fails, the data is still available with eventual consistency. What should they configure?

A.Enable Bigtable replication across zones within the same region
B.Create a Cloud Bigtable cluster with multiple nodes
C.Export Bigtable tables to Cloud Storage periodically
D.Use Cloud Bigtable HDD storage for durability
AnswerA

Replication provides async eventual consistency and failover if a zone goes down.

Why this answer

Bigtable replication across zones provides high availability with eventual consistency (async replication). This meets the requirement of surviving a zone failure.

73
MCQeasy

Your Memorystore for Redis instance needs to survive a zonal failure with minimal data loss. Which feature should you use?

A.Use a Basic tier instance and schedule periodic exports to Cloud Storage.
B.Use a Standard tier instance with replication across zones within the same region.
C.Enable persistence with RDB snapshots stored in Cloud Storage.
D.Create a cross-region replica (read replica in another region).
AnswerB

Standard tier provides multi-AZ replication for high availability.

Why this answer

A Standard tier Memorystore for Redis instance with replication across zones provides automatic failover to a replica in a different zone, ensuring high availability and minimal data loss during a zonal failure. The Standard tier uses synchronous replication within the region, so data written to the primary is replicated to the cross-zone replica before acknowledging the write, which minimizes data loss to only in-flight transactions that were not yet committed.

Exam trap

Google Cloud often tests the misconception that persistence (RDB/AOF) alone provides high availability, but persistence only protects against data loss from restarts, not against zonal failures; you need cross-zone replication (Standard tier) for automatic failover and minimal data loss during a zone outage.

How to eliminate wrong answers

Option A is wrong because Basic tier instances are single-zone and lack replication, so a zonal failure causes complete data loss; periodic exports to Cloud Storage only provide point-in-time recovery with potential data loss between exports, not real-time failover. Option C is wrong because enabling persistence with RDB snapshots stored in Cloud Storage is a backup mechanism, not a high-availability feature; it does not provide automatic failover or replication, so a zonal failure still results in downtime and data loss from the last snapshot. Option D is wrong because cross-region replicas (read replicas) are read-only and do not support automatic failover in Memorystore for Redis; they are designed for read scaling and disaster recovery across regions, not for surviving a zonal failure within the same region with minimal data loss.

74
MCQhard

A Cloud Spanner database has a table 'Orders' with a column 'status'. The development team needs to add a new column 'priority INT64' to the table without downtime. Which statement should the database administrator execute?

A.CREATE INDEX idx_priority ON Orders (priority);
B.UPDATE Orders SET priority = 0; (no prior column)
C.ALTER TABLE Orders ADD priority INT64 NOT NULL DEFAULT 0;
D.ALTER TABLE Orders ADD COLUMN priority INT64;
AnswerD

Correct. This DDL statement adds the column online, non-blocking.

Why this answer

Spanner supports online schema changes that are non-blocking. ALTER TABLE ... ADD COLUMN is the correct DDL statement and executes without locking the table.

75
Multi-Selectmedium

Which TWO statements about Cloud Spanner schema changes are correct? (Choose 2)

Select 2 answers
A.Schema changes are applied asynchronously and may take minutes to hours to complete.
B.Schema changes require the instance to be restarted.
C.ALTER TABLE statements are non-blocking and can be executed while the database is in use.
D.You can only add columns, not drop them.
E.Creating a secondary index requires taking the table offline.
AnswersA, C

Schema changes are applied in the background and can take time depending on data size.

Page 1 of 3 · 154 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Manage a solution that can span multiple database technologies questions.