CCNA Plan and manage database infrastructure Questions

75 of 144 questions · Page 1/2 · Plan and manage database infrastructure · Answers revealed

1
Multi-Selecthard

Refer to the exhibit. A company has a Cloud Spanner instance with the backup configuration shown. They need to improve disaster recovery. Which THREE strategies should they implement?

Select 3 answers
A.Schedule regular exports to Cloud Storage
B.Enable point-in-time recovery (PITR)
C.Use multi-region instance configuration
D.Configure cross-region backups
E.Use read replicas in another region
AnswersB, C, D

PITR allows restoring to any point in time within the retention period, improving recovery granularity.

Why this answer

Option B is correct because enabling point-in-time recovery (PITR) in Cloud Spanner allows you to recover data to any point within the retention period (default 7 days), which is essential for granular disaster recovery against logical errors or accidental data changes. This complements backup strategies by providing fine-grained restore capabilities beyond full backups.

Exam trap

Google Cloud often tests the misconception that read replicas or exports are viable disaster recovery mechanisms, when in fact they lack the write availability or point-in-time restore capabilities required for true DR in Cloud Spanner.

2
Drag & Dropmedium

Arrange the steps to set up database encryption with Cloud KMS for Cloud SQL.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order

Why this order

First create KMS key, grant access, then create instance with CMEK, verify, test.

3
MCQeasy

Refer to the exhibit. A developer deployed these Firestore security rules. What is a security concern with this configuration?

A.Only the owner can write to documents
B.The rules do not explicitly allow delete operations
C.All authenticated users can read all documents
D.The wildcard path matches all databases
AnswerC

The read rule allows any authenticated user to read any document, which may leak private data.

Why this answer

Option C is correct because the Firestore security rules shown grant read access to all authenticated users without any document-level or collection-level restrictions. The rule `match /databases/{database}/documents { allow read: if request.auth != null; }` applies to all documents in the database, meaning any authenticated user can read every document, including those they should not have access to. This violates the principle of least privilege and can lead to unauthorized data exposure.

Exam trap

Google Cloud often tests the misconception that 'authenticated users' implies safe access, but the trap here is that without document-level conditions, all authenticated users can read every document, which is a common misconfiguration in Firestore security rules.

How to eliminate wrong answers

Option A is wrong because the rules do not restrict write access to only the owner; they allow any authenticated user to write to any document (allow write: if request.auth != null;), which is a broader security concern. Option B is wrong because Firestore security rules implicitly allow delete operations when write access is granted, as 'write' encompasses create, update, and delete unless explicitly separated. Option D is wrong because the wildcard path `{database}` matches any database name within the project, which is standard for multi-database setups and does not introduce a security concern by itself.

4
MCQmedium

A company uses Memorystore for Redis as a cache. They need to survive a zone failure. Which configuration should they choose?

A.Cluster tier with multiple shards
B.Basic tier with a single node
C.Standard tier cross-region
D.Standard tier with replication
AnswerD

Standard tier provisions a primary and replica in different zones, providing zone failover.

Why this answer

Standard tier with replication (Option D) provides a primary-replica pair in the same region but across two zones, ensuring automatic failover if one zone fails. This meets the requirement to survive a zone failure while maintaining low-latency access within a single region.

Exam trap

The trap here is that candidates may confuse 'cross-region' with 'cross-zone' replication, or assume that sharding alone (Cluster tier) provides zone redundancy, when in fact Memorystore for Redis does not support cross-region replication and requires explicit replication (Standard tier) for zone-level failover.

How to eliminate wrong answers

Option A is wrong because Cluster tier with multiple shards distributes data across shards for horizontal scaling, but does not inherently provide zone-level redundancy unless each shard has replicas in different zones, which is not guaranteed by this option alone. Option B is wrong because Basic tier with a single node has no replication or failover, so a zone failure would cause complete data loss and downtime. Option C is wrong because Standard tier cross-region is not a valid Memorystore tier; cross-region replication is not supported by Memorystore for Redis, and this option incorrectly implies multi-region failover.

5
Multi-Selecthard

A company is designing a global application using Cloud Spanner. They need to ensure low latency reads and writes across three continents. Which TWO configurations should they consider?

Select 2 answers
A.Use a multi-region configuration with leader regions in each continent.
B.Use a single-region instance and rely on application caching.
C.Use strongly consistent reads from a single region.
D.Use read replicas in each continent for stale read use cases.
E.Use interleaved tables to optimize query performance.
AnswersA, D

Multi-region with leader regions reduces write latency.

Why this answer

Option A is correct because Cloud Spanner multi-region configurations allow you to place leader regions in multiple continents, which enables low-latency strongly consistent reads and writes by directing traffic to the nearest leader. This is achieved through Spanner's TrueTime and Paxos-based replication, ensuring global consistency without sacrificing performance.

Exam trap

Google Cloud often tests the misconception that read replicas or caching alone can solve global write latency, but Cloud Spanner requires leader regions in each continent for low-latency strongly consistent writes.

6
MCQhard

A company uses Cloud SQL for MySQL with a failover replica. The primary instance is in us-central1 and the replica is in us-east1. During a regional outage in us-central1, the database engineer executes an emergency failover to the replica. After the failover, applications experience high latency when writing to the new primary. What is the most likely cause?

A.The new primary is in a different region, causing higher network round-trip times for applications that are still in us-central1.
B.Cross-region replication triggers a mandatory 1-hour delay before writes are allowed.
C.The failover did not complete successfully; the replica is still in read-only mode.
D.The replica had a replication lag of 5 minutes, causing data inconsistency.
AnswerA

After failover, the primary is in us-east1, while application instances in us-central1 incur cross-region latency for each write.

Why this answer

Option A is correct because after a cross-region failover, the new primary resides in us-east1 while the applications remain in us-central1. This geographic distance increases network round-trip time (RTT) for write operations, as each write must traverse the WAN between regions. Cloud SQL for MySQL does not automatically relocate compute resources, so latency-sensitive applications will experience higher write latency until they are migrated or configured to connect to the new region.

Exam trap

Google Cloud often tests the misconception that failover automatically fixes all performance issues, but the trap here is that candidates overlook the impact of geographic latency on write operations after a cross-region failover, focusing instead on replication lag or read-only mode.

How to eliminate wrong answers

Option B is wrong because Cloud SQL for MySQL does not impose any mandatory delay after a failover; writes are allowed immediately once the replica is promoted to primary. Option C is wrong because a successful failover automatically promotes the replica to read-write mode; if it remained read-only, applications would receive errors, not high latency. Option D is wrong because replication lag does not cause high write latency; it affects read consistency but the promoted replica becomes the new primary with full write capability, and any lag is resolved asynchronously.

7
MCQhard

A production Cloud SQL for PostgreSQL instance needs to handle increased read traffic and provide automatic failover in case of a zone outage. Which architecture satisfies both requirements?

A.Enable high availability (regional) and create a read replica in the same region.
B.Enable high availability only.
C.Use a CMEK key and enable binary logging.
D.Create multiple read replicas without HA.
AnswerA

HA provides automatic zone failover; read replicas offload read traffic, meeting both needs.

Why this answer

Option A is correct because enabling high availability (regional) for Cloud SQL for PostgreSQL creates a primary and standby instance in different zones within the same region, providing automatic failover during a zone outage. Adding a read replica in the same region offloads read traffic from the primary instance, satisfying the increased read traffic requirement while the HA configuration ensures high availability.

Exam trap

Google Cloud often tests the distinction between high availability (automatic failover) and read replicas (read scaling), leading candidates to assume that read replicas alone can provide failover or that HA alone can handle increased read traffic.

How to eliminate wrong answers

Option B is wrong because enabling high availability only provides automatic failover but does not address the need to handle increased read traffic; read replicas are required for read scaling. Option C is wrong because using a CMEK key (Customer-Managed Encryption Key) and enabling binary logging are related to encryption and point-in-time recovery, not to read scaling or automatic failover. Option D is wrong because creating multiple read replicas without HA handles increased read traffic but does not provide automatic failover in case of a zone outage; HA is necessary for failover.

8
MCQmedium

A company is migrating an on-premises PostgreSQL database to Cloud SQL. The database is 2 TB and has a high write workload. They need minimal downtime. Which migration approach is best?

A.Use Cloud Spanner
B.Use Cloud SQL for MySQL instead
C.Export using pg_dump and import via psql
D.Use Database Migration Service with continuous replication
AnswerD

DMS with continuous replication minimizes downtime by keeping the target in sync.

Why this answer

Database Migration Service (DMS) with continuous replication is the best approach because it supports minimal-downtime migrations from on-premises PostgreSQL to Cloud SQL. DMS uses change data capture (CDC) to replicate ongoing writes while the initial data load completes, then performs a cutover with only seconds of downtime. This handles the 2 TB size and high write workload without requiring manual export/import or schema changes.

Exam trap

Google Cloud often tests the misconception that pg_dump/psql is suitable for large databases with high write workloads, but the trap here is that candidates overlook the need for minimal downtime and the fact that logical dumps require a consistent snapshot, which forces a read-only period or long-running transaction that blocks writes.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner is a globally distributed, horizontally scalable database that requires schema redesign and does not support PostgreSQL wire protocol natively, making it unsuitable for a direct PostgreSQL migration. Option B is wrong because Cloud SQL for MySQL is a different database engine; migrating from PostgreSQL to MySQL would require schema and query conversion, increasing complexity and downtime, and does not leverage the existing PostgreSQL setup. Option C is wrong because pg_dump and psql export/import is a logical backup method that requires the source database to be read-only or quiesced during the dump to ensure consistency, causing significant downtime; for a 2 TB database with high write workload, this would result in hours of downtime and risk of data loss.

9
MCQmedium

A company has a Cloud SQL for MySQL instance with automated backups enabled. They want to ensure they can recover to any point within the last 7 days with minimum storage cost. What should they do?

A.Enable binary logging manually and store transaction logs in Cloud Storage.
B.Increase automated backup retention to 30 days and disable point-in-time recovery.
C.Keep the default automated backup configuration with 7-day retention and enable point-in-time recovery.
D.Disable automated backups and create manual backups daily.
AnswerC

Default retention is 7 days, and PITR is enabled by default for MySQL.

Why this answer

Option C is correct because Cloud SQL for MySQL with automated backups enabled by default retains backups for 7 days. Enabling point-in-time recovery (PITR) uses the existing binary logs to allow recovery to any point within that retention period, without additional storage cost for the logs beyond the backup storage. This meets the requirement of 7-day recoverability with minimum storage cost.

Exam trap

The trap here is that candidates may think enabling point-in-time recovery requires additional storage or manual configuration of binary logs, but in Cloud SQL, PITR is a built-in feature that uses the existing automated backup retention and does not increase storage cost beyond the backup storage itself.

How to eliminate wrong answers

Option A is wrong because binary logging is automatically enabled when you enable point-in-time recovery in Cloud SQL; manually enabling it and storing logs in Cloud Storage would incur additional storage costs and management overhead, not minimum cost. Option B is wrong because increasing backup retention to 30 days exceeds the 7-day requirement and incurs more storage cost, and disabling point-in-time recovery prevents recovery to any point within the retention period, only to backup times. Option D is wrong because disabling automated backups and creating manual backups daily would not allow point-in-time recovery (only to backup snapshots) and manual backups can be more expensive and less reliable than automated backups.

10
MCQeasy

A company needs to store time-series sensor data with high write throughput (millions of writes per second) and low latency reads. Which database service should they choose?

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

Bigtable is optimized for high write throughput and low-latency reads, ideal for time-series data.

Why this answer

Cloud Bigtable is a fully managed, scalable NoSQL database designed for large analytical and operational workloads, handling millions of writes per second with consistent low-latency reads. It uses a distributed, replicated SSTable storage engine and is optimized for time-series data, making it ideal for high-throughput sensor ingestion.

Exam trap

Google Cloud often tests the misconception that Cloud Spanner's global scalability makes it suitable for all high-throughput workloads, but candidates overlook its transactional overhead and cost, which make it inappropriate for simple time-series writes at millions per second.

How to eliminate wrong answers

Option B is wrong because Cloud SQL is a relational database (MySQL, PostgreSQL, SQL Server) with limited write throughput (typically thousands of writes per second) and is not designed for high-velocity time-series data. Option C is wrong because Firestore is a document-oriented NoSQL database optimized for mobile and web apps with moderate throughput (up to 10,000 writes per second per database) and does not support the millions of writes per second required. Option D is wrong because Cloud Spanner is a globally distributed relational database with strong consistency and horizontal scaling, but its write throughput is limited by node count and transaction overhead, making it unsuitable for the extreme write volume of millions per second.

11
MCQmedium

Refer to the exhibit. After creating this Bigtable instance, the administrator noticed high read latency during peak hours. Which configuration change would most likely help?

A.Change cluster-storage-type to HDD
B.Increase cluster-num-nodes to at least 5
C.Add more clusters in different zones
D.Increase cluster-autoscaling-max-nodes to 20
AnswerB

More nodes increase the read throughput capacity, reducing latency during peak times.

Why this answer

Option D is correct because increasing the initial number of nodes (from 3 to a higher value) provides more serving capacity to handle read load. Option A (increasing max nodes) only allows scaling up but does not increase baseline capacity. Option B (HDD) would worsen latency.

Option C (adding clusters) adds replication overhead but does not directly improve read latency for the existing cluster.

12
Multi-Selecthard

Your organization uses Cloud Spanner for a global financial application. You are designing a backup and disaster recovery strategy. Which THREE considerations are important for meeting RPO of 1 hour and RTO of 2 hours?

Select 3 answers
A.Enable point-in-time recovery (PITR) with a 7-day retention.
B.Schedule incremental backups every hour using Cloud Scheduler.
C.Configure a multi-region Spanner instance to survive a regional outage.
D.Store backups in a multi-regional Cloud Storage bucket.
E.Set up read replicas in a different region for failover.
AnswersA, B, C

PITR allows recovery to any point within the retention period, meeting RPO.

Why this answer

Option A is correct because Cloud Spanner's point-in-time recovery (PITR) allows you to restore the database to any point within the retention window (up to 7 days). With a 1-hour RPO, PITR can recover data to within the last hour, meeting the requirement without needing separate backup jobs. PITR is built into Spanner and does not require external scheduling or storage.

Exam trap

Google Cloud often tests the misconception that incremental backups or read replicas are viable for Spanner's disaster recovery, but Spanner relies on PITR and multi-region synchronous replication instead.

13
MCQmedium

A team is migrating an Oracle database to Cloud Spanner. They have a large table with an auto-increment primary key. Which key design strategy should they use to avoid hot spots?

A.Use a composite primary key with a hash prefix of the auto-increment value
B.Use the auto-increment value as the primary key
C.Use interleaved tables to colocate related data
D.Use UUID as the primary key
AnswerA

Hash prefix distributes writes uniformly across splits.

Why this answer

Option A is correct because using a composite primary key with a hash prefix of the auto-increment value distributes writes across multiple splits in Cloud Spanner. Cloud Spanner uses range-based sharding; a monotonically increasing primary key (like an auto-increment value) would cause all new writes to land on the same split, creating a hot spot. By hashing the auto-increment value and prepending it to the primary key, you randomize the key distribution, ensuring writes are spread evenly across the table's splits.

Exam trap

The trap here is that candidates often think UUIDs are always the best solution for avoiding hot spots in distributed databases, but in Cloud Spanner, a hash prefix of the auto-increment value is more storage-efficient and avoids the performance overhead of large primary keys, while still achieving even write distribution.

How to eliminate wrong answers

Option B is wrong because using the auto-increment value directly as the primary key creates a monotonically increasing sequence, which Cloud Spanner will route to a single split, causing a hot spot and severely limiting write throughput. Option C is wrong because interleaved tables colocate parent and child rows for efficient joins, but they do not address the distribution of writes for a table with a monotonically increasing primary key; the hot spot would still occur in the parent table. Option D is wrong because while a UUID primary key avoids monotonicity and can distribute writes, it is not the best design for Cloud Spanner; UUIDs are large (128-bit), increase storage and index size, and can still cause hot spots if not carefully designed (e.g., time-based UUIDs), whereas a hash prefix of the auto-increment value is more efficient and purpose-built for this scenario.

14
MCQhard

A financial firm uses Cloud Spanner with a single-region configuration. They must meet regulatory requirements for disaster recovery across continents. They need to recover within 1 hour RTO and RPO of 5 minutes. Current workload: 50k writes/sec. What should they do?

A.Use cross-region backups with 5-minute retention.
B.Use Cloud SQL for MySQL with cross-region replicas.
C.Use multi-region configuration with synchronous replication across two continents.
D.Use export to Cloud Storage every 5 minutes.
AnswerC

Synchronous replication ensures near-zero RPO and automatic failover meets RTO.

Why this answer

Option C is correct because Cloud Spanner's multi-region configuration uses synchronous replication across continents, providing strong consistency and automatic failover. This meets the 1-hour RTO and 5-minute RPO requirements for disaster recovery, as synchronous replication ensures data is durable across regions with minimal lag, and Spanner handles failover transparently without manual intervention.

Exam trap

The trap here is that candidates often confuse backup-based recovery (like exports or snapshots) with synchronous replication, failing to realize that only synchronous replication can meet strict RPOs like 5 minutes across continents without data loss.

How to eliminate wrong answers

Option A is wrong because cross-region backups with 5-minute retention cannot achieve a 5-minute RPO; backups are point-in-time snapshots and restoring them takes longer than 1 hour, failing the RTO. Option B is wrong because Cloud SQL for MySQL does not support cross-region replicas with synchronous replication; it uses asynchronous replication, which cannot guarantee a 5-minute RPO across continents due to replication lag. Option D is wrong because exporting to Cloud Storage every 5 minutes introduces significant latency and data loss risk; exports are not incremental and cannot meet the 5-minute RPO or 1-hour RTO, as restoring from exports requires manual import and is not designed for disaster recovery.

15
MCQmedium

An e-commerce site uses Cloud SQL for MySQL. They need read scalability for product catalog queries. What should they do?

A.Add read replicas
B.Partition tables
C.Use Cloud Spanner
D.Enable automatic storage increase
AnswerA

Read replicas serve read queries, reducing load on the primary.

Why this answer

Adding read replicas in Cloud SQL for MySQL offloads read traffic from the primary instance, providing horizontal read scalability for product catalog queries. Replicas asynchronously replicate data using MySQL's native binary log replication, allowing the primary to focus on writes while replicas handle read-heavy workloads.

Exam trap

The trap here is that candidates confuse vertical scaling (storage increase) or schema-level optimizations (partitioning) with horizontal read scaling, or incorrectly assume a fully distributed database like Spanner is required for simple read offloading.

How to eliminate wrong answers

Option B is wrong because partitioning tables (e.g., range or hash partitioning) improves query performance on large tables by reducing scan scope, but it does not add read capacity or offload traffic from the primary instance. Option C is wrong because Cloud Spanner is a globally distributed, strongly consistent relational database designed for horizontal write scalability and global transactions, which is overkill and cost-prohibitive for a simple read-scaling need on an existing MySQL workload. Option D is wrong because enabling automatic storage increase only prevents out-of-disk errors by expanding storage capacity; it does not improve read throughput or distribute query load.

16
MCQhard

A retail company uses Cloud Spanner to handle global transaction processing. The database has a single regional instance in us-central1. The company expects a 10x increase in write traffic from a new mobile app. The database engineer needs to design for low latency writes globally and high availability. What should the Database Engineer do?

A.Shard the database across multiple regional instances based on user geography.
B.Create read replicas in other regions to offload read traffic and keep writes in the primary region.
C.Change the instance configuration to a multi-region configuration like nam3 (us-central1, us-east1, us-west1) and configure a dedicated write region.
D.Increase the number of nodes in the existing regional instance to handle the increased write capacity.
AnswerC

Multi-region configurations provide low-latency writes by placing processing close to users and ensure high availability.

Why this answer

Option C is correct because a multi-region configuration like nam3 (us-central1, us-east1, us-west1) with a dedicated write region provides low-latency writes globally by using Google's managed replication and automatic failover. This design ensures high availability and meets the 10x write traffic increase without sacrificing write performance, as writes are processed in the designated write region and asynchronously replicated to other regions.

Exam trap

The trap here is that candidates often confuse scaling nodes (Option D) with geographic distribution, or assume read replicas (Option B) can handle write scaling, when in fact Cloud Spanner requires a multi-region configuration to achieve both global write low latency and high availability.

How to eliminate wrong answers

Option A is wrong because sharding across multiple regional instances would require manual application-level logic and does not leverage Cloud Spanner's built-in distributed transaction support, leading to increased complexity and potential consistency issues. Option B is wrong because read replicas do not offload write traffic; writes must still go to the primary region, which would become a bottleneck under a 10x write increase, and read replicas do not improve write latency or availability for writes. Option D is wrong because increasing nodes in a single regional instance only scales capacity within that region, failing to provide global low-latency writes or multi-region high availability, and does not address geographic distribution requirements.

17
Multi-Selecthard

A global retail company uses Cloud Spanner to manage product inventory. They need to apply a schema change to add a new column to a table that has 10 billion rows. Which THREE strategies should they consider to minimize downtime?

Select 3 answers
A.Schedule the schema change during a period of low traffic.
B.Disable the table, add the column, then re-enable.
C.Add the column with a NULL default value to avoid backfilling existing rows.
D.Use ALTER TABLE ADD COLUMN with IF NOT EXISTS to avoid errors if the column already exists.
E.Create a new table with the column, then copy data in batches.
AnswersA, C, D

Even though Spanner DDL is online, performing it during low traffic minimizes any potential performance impact.

Why this answer

Option A is correct because scheduling schema changes during low traffic reduces the risk of contention and performance impact on the live database. Cloud Spanner applies schema changes online without locking the entire table, but heavy write traffic can still cause transaction conflicts or increased latency; performing the change during a quiet period minimizes these risks.

Exam trap

Google Cloud often tests the misconception that large tables require data migration or table recreation for schema changes, but Cloud Spanner's online DDL handles column additions without backfilling, making options like B and E unnecessary and counterproductive.

18
MCQhard

A Cloud SQL for SQL Server instance has been running for months. Recently, the database size grew significantly and now query performance has degraded. The DBA checks the query execution plan and sees index scans. The current storage is 500GB SSD. What is the most likely cause and solution?

A.Increase storage capacity to 1TB SSD
B.Index fragmentation; rebuild or reorganize indexes
C.Enable query insights to analyze performance
D.Enable read replicas to offload queries
AnswerB

Index fragmentation increases scan cost; rebuilding reorganizes data pages.

Why this answer

The correct answer is B. Index fragmentation occurs over time as data is inserted, updated, or deleted, causing indexes to become inefficient. The query execution plan showing index scans (instead of seeks) is a classic symptom of fragmented indexes.

Rebuilding or reorganizing the indexes will defragment them, restoring query performance without requiring additional storage or infrastructure changes.

Exam trap

Google Cloud often tests the misconception that performance degradation from data growth is always a storage capacity issue, leading candidates to choose a storage increase instead of recognizing index fragmentation as the root cause when execution plans show index scans.

How to eliminate wrong answers

Option A is wrong because increasing storage capacity does not address index fragmentation; it only provides more space, which does not improve query performance if the indexes are fragmented. Option C is wrong because enabling query insights helps analyze performance but does not fix the root cause of index scans; it is a diagnostic tool, not a solution. Option D is wrong because read replicas offload read queries but do not resolve index fragmentation on the primary instance; the degraded performance would persist on the primary instance.

19
MCQeasy

A company is migrating their on-premises PostgreSQL database to Cloud SQL. They want to minimize downtime during the migration. Which approach should they use?

A.Export the database using pg_dump and import using psql in a single connection.
B.Use a VPN tunnel and set up Cloud SQL as a read replica of the on-premises primary.
C.Use Database Migration Service (DMS) with continuous replication from an on-premises replica.
D.Use Database Migration Service (DMS) with a one-time full dump and import.
AnswerC

Continuous replication allows near-zero downtime by keeping the target up-to-date until cutover.

Why this answer

Database Migration Service (DMS) with continuous replication minimizes downtime by performing an initial full load of the database and then continuously replicating changes from the on-premises source to Cloud SQL. This allows the target to stay nearly synchronized with the source, so the final cutover can be completed in seconds or minutes rather than hours.

Exam trap

The trap here is that candidates confuse Cloud SQL's read replica feature (which only works within Cloud SQL) with the ability to replicate from an external primary, leading them to choose Option B despite it being technically impossible.

How to eliminate wrong answers

Option A is wrong because using pg_dump and psql in a single connection is a manual, offline migration method that requires the source database to be locked or read-only during the dump, causing significant downtime. Option B is wrong because Cloud SQL does not support being configured as a read replica of an on-premises PostgreSQL primary; Cloud SQL read replicas can only replicate from a Cloud SQL primary, not from external sources. Option D is wrong because a one-time full dump and import (even via DMS) does not include ongoing change data capture, so the target will be out of sync with the source by the time the import completes, requiring additional downtime for a final sync.

20
Multi-Selectmedium

A database administrator is planning to migrate an on-premises MySQL database to Cloud SQL. Which two steps are required to ensure a secure migration?

Select 2 answers
A.Configure Cloud SQL to use a private IP address
B.Add authorized networks for all client IPs
C.Ensure the database is encrypted at rest using CMEK
D.Enable SSL/TLS for all connections
E.Set up Cloud SQL Proxy for secure authentication and encryption
AnswersA, E

Private IP ensures traffic stays within Google Cloud network.

Why this answer

Option A is correct because using a private IP address for Cloud SQL ensures that the database instance is not exposed to the public internet, reducing the attack surface. This is a fundamental security best practice for database migrations, as it restricts network access to within a Virtual Private Cloud (VPC) and requires traffic to traverse Google's internal network, which is more secure than public IP routing.

Exam trap

Google Cloud often tests the distinction between 'best practice' and 'required step' — candidates may select SSL/TLS (Option D) as a required step, but the exam expects understanding that Cloud SQL Proxy inherently provides encryption and authentication, making separate SSL/TLS configuration redundant for the migration scenario.

21
MCQmedium

A company is migrating a large Oracle database to Cloud Spanner. The source database uses sequences for primary key generation. The database engineer needs to design the Cloud Spanner schema to avoid hotspotting. What primary key design should they recommend?

A.Keep the same sequence-based integer keys.
B.Use a composite primary key with a timestamp prefix.
C.Use a hash of the original key as a prefix to the primary key.
D.Use UUIDs as the primary key without modification.
AnswerC

A hash prefix distributes the write load evenly across splits, avoiding hotspots.

Why this answer

Option C is correct because using a hash of the original key as a prefix to the primary key distributes writes evenly across Cloud Spanner's splits, preventing hotspotting. Cloud Spanner uses a distributed, append-only storage model where sequential keys (like from Oracle sequences) cause all new writes to land on the same split, creating a hotspot. A hash prefix ensures that related rows are still co-located for efficient queries while spreading write load across multiple nodes.

Exam trap

Google Cloud often tests the misconception that UUIDs or timestamps inherently solve hotspotting, but the trap here is that only a hash prefix (or similar distribution mechanism) guarantees even write distribution across Cloud Spanner's splits.

How to eliminate wrong answers

Option A is wrong because keeping the same sequence-based integer keys will cause all new inserts to target the same tablet (split) in Cloud Spanner, leading to severe hotspotting and degraded write performance. Option B is wrong because using a timestamp prefix does not guarantee distribution; if timestamps are monotonically increasing (e.g., insertion time), writes will still concentrate on the latest split, causing hotspotting. Option D is wrong because UUIDs are random but not designed to avoid hotspotting in Cloud Spanner; without a hash prefix or similar distribution mechanism, UUIDs can still lead to uneven splits and performance issues, especially under high write loads.

22
Multi-Selectmedium

A company is migrating its on-premises PostgreSQL database to Cloud SQL for PostgreSQL. They want to minimize downtime during the migration. Which TWO actions should they take?

Select 2 answers
A.Increase the disk size of the Cloud SQL instance before migration to improve performance.
B.Use pg_dump to export the database and pg_restore to import into Cloud SQL.
C.Set up a Cloud SQL read replica and promote it to the primary after migration.
D.Decrease max_connections to reduce load during migration.
E.Use Database Migration Service (DMS) with continuous replication from the source.
AnswersC, E

Using a read replica allows the source to remain online during replication, and promoting the replica minimizes cutover downtime.

Why this answer

Option C is correct because setting up a Cloud SQL read replica from the source PostgreSQL database and then promoting it to primary allows for a controlled cutover with minimal downtime. The replica stays in sync with the source using PostgreSQL's native streaming replication, and promotion is a fast metadata operation that typically takes seconds, not minutes or hours.

Exam trap

Google Cloud often tests the distinction between logical backup tools (pg_dump/pg_restore) which cause downtime, and continuous replication methods (DMS or read replicas) which minimize it, leading candidates to incorrectly choose the familiar dump-and-restore approach.

23
Multi-Selectmedium

Which THREE actions can reduce read latency for a globally distributed Cloud Spanner database?

Select 3 answers
A.Use read-only replicas (follower reads)
B.Use multi-region configuration
C.Use leader reads
D.Use interleaved tables
E.Use secondary indexes
AnswersA, B, E

Follower reads allow reads from nearby replicas instead of the leader, reducing latency.

Why this answer

Option A is correct because read-only replicas (follower reads) allow Cloud Spanner to serve read requests from non-leader replicas, reducing the distance data must travel and thus lowering read latency for globally distributed users. This is particularly effective when strong consistency is not required, as follower reads can return data that is up to a few seconds stale but much faster to access from a nearby replica.

Exam trap

Google Cloud often tests the misconception that leader reads are always optimal for latency, but the trap here is that leader reads actually increase latency for distant users because they force all reads to the single leader region, while follower reads distribute read traffic to the nearest replica.

24
MCQeasy

A company runs a production Cloud SQL for PostgreSQL instance used by a web application. The instance experiences intermittent latency spikes during peak hours. You need to diagnose the cause without downtime. Which tool should you use first?

A.Use Database Migration Service to failover to a read replica.
B.Use Cloud SQL Insights to analyze query performance and identify slow queries.
C.Use gcloud sql instances describe to check instance configuration.
D.Use VPC Flow Logs to analyze network traffic.
AnswerB

Cloud SQL Insights provides query-level performance diagnostics without downtime.

Why this answer

Cloud SQL Insights provides built-in query performance monitoring and diagnostics without requiring any downtime. It surfaces slow queries, lock contention, and resource bottlenecks directly from the PostgreSQL engine, making it the ideal first step to identify the root cause of intermittent latency spikes during peak hours.

Exam trap

The trap here is that candidates may confuse Cloud SQL Insights with a general monitoring tool like VPC Flow Logs or assume that failing over to a read replica is a diagnostic step, when in fact Insights is the only option that provides database-internal performance data without downtime.

How to eliminate wrong answers

Option A is wrong because Database Migration Service is used for migrating databases to Cloud SQL, not for failover; failing over to a read replica would cause downtime during the promotion process and does not diagnose the latency issue. Option C is wrong because gcloud sql instances describe only returns static configuration metadata (e.g., machine type, region, maintenance window) and does not provide real-time query performance or latency diagnostics. Option D is wrong because VPC Flow Logs capture network-level metadata (source/destination IP, ports, packet count) and cannot reveal slow SQL queries, lock waits, or database engine internals.

25
MCQmedium

A company has a parent-child relationship in Cloud Spanner. They want to minimize cross-table join latency. What should they use?

A.Interleaved tables
B.Cloud Functions
C.Stored procedures
D.Secondary indexes
AnswerA

Interleaved tables physically co-locate parent and child rows, minimizing join latency.

26
MCQmedium

What is the correct way to create a Spanner instance with 2 nodes?

A.Use --num-nodes=2 instead of --nodes
B.Set --processing-units=2000 and remove --nodes
C.Remove the --processing-units flag
D.Set --nodes=2 and --processing-units=0
AnswerC

Nodes and processing units are exclusive; remove one.

Why this answer

In Google Cloud Spanner, the `--num-nodes` flag is the correct way to specify the number of nodes when creating an instance. The `--processing-units` flag is used for smaller, burstable configurations (100–1000 processing units per node equivalent) and cannot be combined with `--num-nodes`. Option C is correct because removing `--processing-units` and using `--num-nodes=2` creates a 2-node instance as required.

Exam trap

The trap here is that candidates may think `--nodes` is a valid flag (it is not) or that `--processing-units` can be combined with `--num-nodes`, when in fact they are mutually exclusive and the correct flag for specifying node count is `--num-nodes`.

How to eliminate wrong answers

Option A is wrong because `--num-nodes=2` is the correct flag, but the statement says 'instead of --nodes' — there is no `--nodes` flag in the gcloud spanner instances create command; the correct flag is `--num-nodes`. Option B is wrong because setting `--processing-units=2000` would create a 2-node equivalent in processing units (1000 per node), but the question explicitly asks for '2 nodes', not a processing-units-based instance, and removing `--nodes` is not a valid approach. Option D is wrong because `--processing-units=0` is invalid (minimum is 100) and combining `--nodes=2` with `--processing-units` is not allowed; the flags are mutually exclusive.

27
MCQeasy

A small business runs a Cloud SQL instance with 10 GB data. They want to automate daily backups with 7-day retention. They also need to restore quickly if needed. What is the simplest solution?

A.Use Cloud Scheduler to trigger exports.
B.Export to Cloud Storage daily using a cron job.
C.Enable automatic backups in Cloud SQL settings.
D.Use gcloud to create a backup schedule with retention.
AnswerC

Automatic backups are simple and support retention settings.

Why this answer

Option C is correct because Cloud SQL provides a built-in automatic backup feature that can be configured with a 7-day retention period directly in the instance settings. This eliminates the need for custom scripts or external schedulers, and enables point-in-time recovery for fast restoration without manual export/import overhead.

Exam trap

The trap here is that candidates often overcomplicate the solution by choosing manual export/import methods (A, B, D) when Cloud SQL's built-in automatic backup feature provides a simpler, fully managed solution with integrated retention and fast restore capabilities.

How to eliminate wrong answers

Option A is wrong because Cloud Scheduler triggers exports to Cloud Storage, which are manual snapshot-like backups that do not support point-in-time recovery and require additional steps to restore, adding complexity. Option B is wrong because exporting to Cloud Storage via a cron job is a manual, scripted approach that lacks the automated retention management and integrated restore capabilities of Cloud SQL's native backup feature. Option D is wrong because gcloud commands can create backup schedules, but this still requires manual setup and does not leverage the fully managed automatic backup feature with built-in retention and point-in-time recovery that is simpler to enable via the Cloud Console or API.

28
MCQmedium

You need to transfer 10 TB of data from on-premises servers to Cloud Storage for loading into Bigtable. Which method is the most efficient and reliable for this volume?

A.Set up Cloud VPN and use rsync
B.Use Storage Transfer Service
C.Use gsutil cp in parallel
D.Use Dataflow to read and write data
AnswerB

Storage Transfer Service is designed for large-scale data transfers with features like incremental sync and verification.

Why this answer

The Storage Transfer Service is designed for large-scale, online data transfers from on-premises or other cloud providers to Google Cloud. It handles 10 TB efficiently by automatically managing retries, checksums, and network optimization without requiring manual scripting or persistent VPN connections, making it the most reliable and efficient choice for this volume.

Exam trap

The trap here is that candidates confuse 'efficient and reliable' with 'fastest raw throughput' (gsutil cp in parallel) or 'familiar tool' (rsync), overlooking that managed services like Storage Transfer Service provide built-in fault tolerance and optimization for large-scale transfers.

How to eliminate wrong answers

Option A is wrong because Cloud VPN provides encrypted connectivity but does not optimize bulk data transfer; rsync over VPN lacks built-in retry logic and parallelization for 10 TB, leading to slow and unreliable transfers. Option C is wrong because gsutil cp in parallel can transfer data but requires manual management of concurrency, retries, and consistency checks, and is less reliable than a managed service for 10 TB. Option D is wrong because Dataflow is a stream and batch processing framework, not a data transfer tool; using it to read and write data adds unnecessary complexity and cost compared to a purpose-built transfer service.

29
MCQhard

A company runs a BigQuery data warehouse with many scheduled queries and materialized views. They notice that materialized view refreshes are taking longer than expected, causing delays in downstream reports. What is the most effective optimization?

A.Manually refresh materialized views outside peak hours
B.Increase the refresh interval to reduce frequency
C.Disable automatic refresh and use scheduled queries to rebuild the materialized view
D.Partition and cluster the base table on columns used in the materialized view
AnswerD

Partitioning and clustering reduce the amount of data scanned during refresh, improving speed.

Why this answer

Partitioning and clustering the base table on columns used in the materialized view (D) is the most effective optimization because it allows BigQuery to perform incremental refreshes using only the changed partitions, significantly reducing scan and recomputation overhead. Without proper partitioning, the materialized view refresh must scan the entire base table, which becomes increasingly costly as data grows. Clustering further improves efficiency by co-locating related data, minimizing the data processed during aggregation or join operations in the refresh.

Exam trap

The trap here is that candidates often assume scheduling or manual timing adjustments (A, B, C) will solve performance issues, when in fact the core optimization lies in the physical design of the base table to enable incremental processing, which is a fundamental BigQuery materialized view requirement.

How to eliminate wrong answers

Option A is wrong because manually refreshing materialized views outside peak hours does not address the root cause of slow refreshes; it merely shifts the timing, and the underlying full-table scan cost remains unchanged. Option B is wrong because increasing the refresh interval reduces the frequency of refreshes but does not optimize the refresh operation itself; the refresh will still be slow when it runs, and downstream reports may become even more stale. Option C is wrong because disabling automatic refresh and using scheduled queries to rebuild the materialized view replaces an optimized incremental refresh with a full rebuild, which is typically slower and more expensive, and it loses BigQuery's automatic incremental refresh capabilities.

30
Matchingmedium

Match each database migration term to its description.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Fully managed service for migrating to Cloud SQL

Same database engine source and target

Different database engine source and target

Ongoing replication with minimal downtime

Full dump and restore with planned downtime

Why these pairings

These terms describe migration strategies and tools in Google Cloud.

31
Multi-Selectmedium

A company is migrating their on-premises MySQL database to Cloud SQL. The database is 500 GB and they have a 1 Gbps network connection. They want to minimize downtime. Which THREE steps should they take?

Select 3 answers
A.Perform a test migration to validate the process.
B.Export the database to a SQL file and import after the cutover.
C.Test the application against the new Cloud SQL instance.
D.Use Database Migration Service with continuous replication.
E.Schedule a maintenance window for the cutover.
AnswersA, C, D

Testing reduces risk.

Why this answer

Option A is correct because performing a test migration validates the entire process, including schema compatibility, data integrity, and application connectivity, before the actual cutover. This reduces the risk of unexpected failures during the production migration, which is critical for minimizing downtime. A test migration also helps estimate the time required for the final cutover and allows for tuning of the Database Migration Service settings.

Exam trap

Google Cloud often tests the misconception that a simple export/import or a maintenance window is sufficient for minimizing downtime, when in fact continuous replication and pre-validation steps are essential for achieving near-zero downtime migrations.

32
MCQmedium

A financial services company uses Cloud Spanner for transaction processing. They notice increased latency during peak hours. They suspect a hot spot. What is the best way to diagnose the issue?

A.Review Key Visualizer to identify hot keys
B.Add more nodes to the instance
C.Switch to Cloud SQL
D.Check Cloud Spanner's CPU utilization metrics
AnswerA

Key Visualizer shows read and write heatmaps per key range, allowing identification of hot spots.

Why this answer

Key Visualizer is a Cloud Spanner tool that provides a heatmap of access patterns across keys and time ranges, directly revealing hot spots (e.g., monotonically increasing keys or skewed read/write distributions). This allows you to identify the specific keys causing contention without guesswork, making it the most targeted diagnostic approach for hot spot issues.

Exam trap

The trap here is that candidates confuse high-level metrics (CPU utilization) with diagnostic tools, assuming that resource pressure alone identifies the root cause, when in fact only a key-level analysis like Key Visualizer reveals the specific hot key pattern.

How to eliminate wrong answers

Option B is wrong because adding nodes increases throughput and storage capacity but does not diagnose the root cause of a hot spot; it may mask the symptom without fixing the key design issue. Option C is wrong because switching to Cloud SQL is a migration that abandons Spanner's horizontal scaling and global consistency, and does not help diagnose the existing hot spot in Spanner. Option D is wrong because CPU utilization metrics indicate overall resource pressure but cannot pinpoint which specific keys or access patterns are causing contention, so they are insufficient for diagnosing hot spots.

33
MCQeasy

A company wants to ensure point-in-time recovery for their PostgreSQL database on Cloud SQL. What must they enable?

A.Query insights
B.Automatic backups
C.Write-ahead logging (WAL) archiving
D.Binary logging
AnswerB

Automatic backups enable PITR for Cloud SQL PostgreSQL instances.

Why this answer

Automatic backups in Cloud SQL enable point-in-time recovery (PITR) by maintaining transaction logs that allow you to restore the database to any specific time within the backup retention period. Without automatic backups enabled, Cloud SQL only supports restoring from a full backup snapshot, which does not provide the granularity needed for PITR.

Exam trap

Google Cloud often tests the misconception that enabling WAL archiving directly in PostgreSQL is required for PITR, but in Cloud SQL, this is abstracted away and controlled by the automatic backups setting.

How to eliminate wrong answers

Option A is wrong because Query insights is a performance monitoring and troubleshooting feature that provides query-level metrics and execution plans, not a mechanism for backup or recovery. Option C is wrong because write-ahead logging (WAL) archiving is a PostgreSQL internal mechanism for replication and crash recovery, but in Cloud SQL, PITR is enabled via automatic backups, not by directly configuring WAL archiving. Option D is wrong because binary logging is a MySQL/MariaDB feature used for replication and PITR in those databases, not applicable to PostgreSQL, which uses WAL instead.

34
MCQhard

A company uses Cloud Spanner with a multi-region configuration (nam7) to support a global user base. They notice increased read latency for users in Europe, while write latency is acceptable. The database engineer observes that most queries are single-row reads using the primary key. What is the best approach to reduce read latency for European users?

A.Create a secondary index on the primary key column.
B.Increase the number of Spanner nodes to distribute the load.
C.Use read-only transactions with stale reads (timestamp bound) to read from local replicas.
D.Partition the database by region and use directed reads.
AnswerC

Stale reads allow Spanner to serve reads from the nearest replica, reducing latency for far-away users.

Why this answer

Option C is correct because Cloud Spanner's multi-region configuration (nam7) includes regional replicas in Europe. By using stale reads with a timestamp bound, read-only transactions can be served from a local replica without incurring cross-region latency, which directly reduces read latency for European users while maintaining acceptable consistency.

Exam trap

Google Cloud often tests the misconception that increasing nodes or adding indexes solves geographic latency, when the real solution is leveraging replica locality via stale reads or read-only transactions.

How to eliminate wrong answers

Option A is wrong because creating a secondary index on the primary key column is redundant—the primary key is already indexed by the table's primary index, and this does not address the cross-region latency issue. Option B is wrong because increasing the number of Spanner nodes distributes load and improves throughput, but does not reduce the physical distance or network round-trip time between European users and the regional leader, so read latency remains high. Option D is wrong because Cloud Spanner does not support partitioning a database by region with directed reads; directed reads can be used to route reads to specific zones, but the database is a single global resource, and partitioning would break global consistency and transaction semantics.

35
MCQeasy

A company runs a Spanner instance with a single region configuration. They are experiencing increased latency for writes when there is a network disruption between their application and the Spanner instance. The application is deployed in the same region. What should the database engineer do to minimize write latency during such disruptions?

A.Implement client-side retry logic.
B.Enable multi-region configuration.
C.Use a compute engine instance as a proxy.
D.Increase the number of nodes.
AnswerA

Retry logic handles transient disruptions without architectural change.

Why this answer

Option D is correct because client-side retry logic with appropriate backoff is the standard approach to handle transient network disruptions without requiring architectural changes. Option A (multi-region) increases complexity and doesn't help for local disruptions. Option B (increase nodes) improves throughput but not latency during disruptions.

Option C (proxy) adds an extra hop, likely worsening latency.

36
MCQeasy

A startup is using Cloud SQL for PostgreSQL and wants to minimize downtime during maintenance. The application can tolerate a few minutes of read-only mode. Which configuration should they use?

A.Use a read replica and promote it during maintenance.
B.Enable automatic storage increase.
C.Configure a high availability (HA) instance with regional failover.
D.Schedule maintenance during off-peak hours only.
AnswerA

This allows reads to continue and writes to be redirected with minimal disruption.

Why this answer

Option A is correct because using a read replica and promoting it during maintenance allows the application to switch to a read-write capable instance with minimal downtime. The application can tolerate a few minutes of read-only mode, so the brief period when the replica is promoted and the original primary is unavailable is acceptable. This approach avoids the longer downtime associated with other methods like HA failover or simply waiting for maintenance to complete.

Exam trap

The trap here is that candidates often confuse high availability (HA) failover with read replica promotion, assuming HA provides zero downtime, but HA still incurs a brief failover delay and does not allow the application to remain in read-only mode during maintenance.

How to eliminate wrong answers

Option B is wrong because automatic storage increase only prevents out-of-disk errors, not downtime during maintenance; it does not provide any mechanism to switch traffic away from the instance being maintained. Option C is wrong because configuring a high availability (HA) instance with regional failover still requires a brief period of downtime during the failover process, and the application's tolerance for read-only mode is better served by a read replica that can be promoted independently. Option D is wrong because scheduling maintenance during off-peak hours only reduces the impact of downtime but does not eliminate it; the application still experiences downtime during the maintenance window, which the read replica approach avoids.

37
MCQmedium

A company is designing a Cloud Spanner database for a global financial application. They need to minimize latency for customer queries while handling write-heavy workloads. The current design uses a single-region instance in us-central1. Which approach should they take to reduce latency for users in Europe?

A.Reconfigure the instance to a multi-region configuration with default leader in us-central1.
B.Reconfigure the instance to a multi-region configuration with default leader in europe-west1.
C.Add a read-only regional replica in europe-west1.
D.Increase the number of nodes to improve throughput and automatically reduce latency.
AnswerB

Multi-region configuration places a leader in Europe, reducing write and strong read latency for European users.

Why this answer

Option D is correct because using a multi-region instance with leader options can place a read-write leader in a European region, reducing write latency for European users. Option A is wrong because read replicas in Spanner only serve stale reads (not strong reads). Option B is wrong because multi-region instance with default leader in US would not help.

Option C is wrong because adding more nodes does not reduce cross-continental latency.

38
MCQhard

An organization has a Cloud SQL for MySQL instance that stores sensitive data. They need to encrypt the data at rest using a customer-managed encryption key (CMEK). The database engineer creates a Cloud KMS key ring and key, and configures the Cloud SQL instance to use CMEK. However, after 30 days, the instance becomes inaccessible and the error message indicates the CMEK key is disabled. What is the most likely cause?

A.The CMEK key was disabled by the key administrator for security reasons.
B.The Cloud SQL instance exceeded the number of times it can access the CMEK key.
C.The CMEK key was rotated, and the old key version was disabled.
D.The CMEK key expired, causing automatic disablement.
AnswerA

If the key is disabled, Cloud SQL cannot access it, causing the instance to become unavailable.

Why this answer

Option A is correct because the error message indicates the CMEK key is disabled, and the most common cause in a controlled environment is that the key administrator intentionally disabled the key. Cloud SQL for MySQL requires the CMEK key to be enabled to encrypt and decrypt data at rest; if the key is disabled, the instance cannot access its data and becomes inaccessible. This aligns with the scenario where no other configuration changes are mentioned, making administrative action the likely cause.

Exam trap

The trap here is that candidates may confuse key rotation with key disablement, assuming that rotating a key automatically disables the old version, but in Cloud KMS, old key versions remain enabled unless explicitly disabled.

How to eliminate wrong answers

Option B is wrong because Cloud SQL does not have a limit on the number of times it can access a CMEK key; the key is accessed for each read/write operation, and there is no quota or threshold that would cause disablement. Option C is wrong because key rotation creates a new key version while keeping the old version enabled by default; disabling the old version is a manual action and not an automatic consequence of rotation. Option D is wrong because CMEK keys in Cloud KMS do not have an expiration date; they are disabled only by explicit administrative action or through a key lifecycle policy, not by automatic expiry.

39
Multi-Selecteasy

Which TWO actions can a team take immediately to resolve a Cloud SQL instance running out of storage?

Select 2 answers
A.Enable automatic storage increase
B.Increase storage capacity via gcloud
C.Delete binary log files
D.Migrate to Cloud Spanner
E.Add read replicas
AnswersA, B

Automatic increase ensures future storage issues are avoided.

Why this answer

Increasing storage capacity and enabling automatic storage increase directly address the storage shortage. Deleting binary logs can free space but is not recommended as it may affect point-in-time recovery. Migrating to Cloud Spanner is a long-term change.

Adding read replicas does not increase storage.

40
MCQmedium

Your company is deploying a new application on Google Cloud and needs to choose a database solution. The application requires strong transactional consistency, complex SQL queries, and the ability to scale horizontally for read-heavy workloads. Which database service should you recommend?

A.Cloud Spanner
B.BigQuery
C.Cloud SQL
D.Cloud Firestore
AnswerA

Cloud Spanner offers strong consistency, SQL, and horizontal scaling.

Why this answer

Cloud Spanner is the correct choice because it provides strong transactional consistency (ACID) across globally distributed nodes, supports complex SQL queries with standard SQL syntax, and offers horizontal scaling for read-heavy workloads through automatic sharding and read replicas. Unlike other options, Spanner uniquely combines these three requirements—strong consistency, SQL, and horizontal scaling—in a single managed service.

Exam trap

Google Cloud often tests the misconception that Cloud SQL can scale horizontally for read-heavy workloads, but Cloud SQL's read replicas are limited and do not provide true horizontal scaling or strong consistency across replicas, unlike Spanner's built-in distributed architecture.

How to eliminate wrong answers

Option B (BigQuery) is wrong because it is a data warehouse optimized for analytical queries on large datasets, not for transactional workloads requiring strong consistency and complex SQL with ACID guarantees. Option C (Cloud SQL) is wrong because while it supports complex SQL and strong consistency, it cannot scale horizontally for read-heavy workloads; it is limited to vertical scaling and read replicas with eventual consistency. Option D (Cloud Firestore) is wrong because it is a NoSQL document database that does not support complex SQL queries and offers only eventual consistency in multi-region mode, not strong transactional consistency.

41
MCQeasy

A startup is building a mobile app that requires a highly available, globally distributed, low-latency NoSQL database. The data model is key-value with occasional queries on a secondary field. Which database service should they choose?

A.Cloud SQL (PostgreSQL)
B.Cloud Firestore
C.Cloud Spanner
D.Cloud Bigtable
AnswerB

Firestore is a flexible NoSQL database with automatic multi-region replication, real-time updates, and strong consistency.

Why this answer

Cloud Firestore is a fully managed, globally distributed NoSQL document database that provides strong consistency, automatic multi-region replication, and low-latency queries on key-value pairs as well as secondary fields (via composite indexes). It is ideal for mobile apps requiring high availability and real-time data synchronization across the globe, directly matching the requirements of a key-value model with occasional secondary queries.

Exam trap

The trap here is that candidates often confuse Cloud Spanner's global distribution and strong consistency with being the best fit for NoSQL key-value workloads, overlooking that Spanner is a relational database with SQL semantics and higher operational overhead, while Firestore is purpose-built for mobile app key-value and document storage with automatic secondary indexing.

How to eliminate wrong answers

Option A is wrong because Cloud SQL (PostgreSQL) is a relational database that does not natively support global distribution or low-latency key-value access; it is designed for single-region deployments and requires manual replication for multi-region setups. Option C is wrong because Cloud Spanner is a globally distributed relational database that provides strong consistency and horizontal scaling, but it is optimized for SQL workloads and complex transactions, not for simple key-value models with occasional secondary queries, and it incurs higher cost and complexity than necessary. Option D is wrong because Cloud Bigtable is a wide-column NoSQL database designed for high-throughput, low-latency analytical workloads (e.g., time-series, IoT) but does not support secondary indexes or efficient queries on non-key fields; it is not suitable for mobile app use cases requiring ad-hoc queries on secondary attributes.

42
Multi-Selecteasy

Which TWO database services are fully managed and support global distribution of data for low-latency reads and writes?

Select 2 answers
A.Memorystore
B.Cloud Spanner
C.Firestore
D.Bigtable
E.Cloud SQL
AnswersB, C

Cloud Spanner provides global distribution with automatic synchronous replication across regions.

Why this answer

Cloud Spanner is a fully managed, globally distributed relational database service that provides strong consistency and horizontal scaling across regions. It supports global distribution of data for low-latency reads and writes by using synchronous replication and atomic clocks for TrueTime, enabling ACID transactions at global scale.

Exam trap

Google Cloud often tests the distinction between 'global distribution for reads and writes' versus 'global distribution for reads only'—candidates mistakenly choose Bigtable or Cloud SQL because they offer read replicas globally, but they do not support globally distributed writes with strong consistency.

43
MCQeasy

A company runs a BigQuery data warehouse. They notice that query performance has degraded over time. The data is loaded daily from Cloud Storage using batch loads. Which action is most likely to improve query performance?

A.Partition and cluster tables based on common query filters.
B.Increase the number of slots in the reservation.
C.Create materialized views for all frequent queries.
D.Migrate the data to Cloud SQL for better performance.
AnswerA

Partitioning and clustering reduce data scanned, improving performance.

Why this answer

Partitioning and clustering tables based on common query filters directly reduces the amount of data scanned per query by organizing data into physical segments. In BigQuery, this allows the query engine to prune entire partitions and clusters, significantly lowering I/O and improving performance without additional cost or complexity.

Exam trap

Google Cloud often tests the misconception that adding more compute resources (slots) is the default fix for slow queries, when in reality data organization techniques like partitioning and clustering are the first-line optimization for scan-heavy workloads.

How to eliminate wrong answers

Option B is wrong because increasing slot count only addresses concurrency and resource contention, not the root cause of performance degradation from growing data volumes and unoptimized table structures. Option C is wrong because materialized views add storage and maintenance overhead, and while they can speed up specific queries, they do not fix the underlying issue of full table scans on the base tables. Option D is wrong because Cloud SQL is a relational OLTP database not designed for analytical workloads; migrating there would likely worsen performance and increase latency for large-scale aggregation queries.

44
MCQmedium

A gaming company uses Memorystore for Redis to cache player session data. They need to ensure high availability with automatic failover in case of a zone failure. Which configuration should the Database Engineer choose?

A.Deploy a Standard tier Redis instance with replication across two zones.
B.Deploy a Basic tier Redis instance with multiple read replicas.
C.Deploy a Memcached cluster with multiple nodes.
D.Deploy a Basic tier Redis instance in a single zone.
AnswerA

Standard tier provides replication and automatic failover.

Why this answer

Memorystore for Redis Standard tier provides cross-zone replication with automatic failover, ensuring high availability during a zone failure. The Standard tier uses a primary and replica instance in different zones, and if the primary fails, the replica is automatically promoted. This meets the requirement for automatic failover without manual intervention.

Exam trap

Google Cloud often tests the distinction between Basic and Standard tiers in Memorystore for Redis, where candidates mistakenly assume Basic tier offers replication or failover, but it is a single-node configuration with no high availability.

How to eliminate wrong answers

Option B is wrong because the Basic tier (Standard tier in some contexts) does not support replication or automatic failover; it is a single-node instance with no high availability. Option C is wrong because Memcached is a distributed memory caching system, not a Redis instance, and does not provide the same data persistence or failover mechanisms required for session data. Option D is wrong because a Basic tier Redis instance in a single zone offers no redundancy; any zone failure would cause complete data loss and downtime.

45
MCQmedium

A company uses Cloud Firestore in Datastore mode for a multi-tenant SaaS application. Each tenant has a separate namespace. The application has grown rapidly, and the database engineer notices that write throughput is degrading. Monitoring shows that the number of writes per second is high but within Firestore limits. However, the latency for writes is increasing linearly with the number of tenants. The engineer suspects that index management is causing the problem. The current schema uses automatic indexes for all properties. What is the best corrective action?

A.Disable automatic indexing and create custom composite indexes only for queries that require them.
B.Implement a data retention policy to delete old tenant data.
C.Request a throughput increase from Google Cloud support.
D.Shard tenants into separate Firestore databases to distribute the write load.
AnswerA

Automatic indexing causes every property to be indexed, resulting in excessive write operations. Custom indexes reduce write amplification.

Why this answer

The correct answer is A because automatic indexing in Firestore in Datastore mode creates an index for every property, which causes write amplification as each write must update all relevant indexes. With many tenants in separate namespaces, the number of indexes grows linearly with tenants, increasing write latency. Disabling automatic indexing and creating custom composite indexes only for needed queries reduces the index write overhead, restoring write throughput.

Exam trap

The trap here is that candidates may assume the issue is throughput capacity (Option C) or data volume (Option B), rather than recognizing that automatic indexing creates a write amplification problem that scales with schema complexity and tenant count.

How to eliminate wrong answers

Option B is wrong because implementing a data retention policy to delete old tenant data reduces storage but does not address the root cause of write latency increasing with tenant count due to index management overhead. Option C is wrong because requesting a throughput increase from Google Cloud support does not resolve the index write amplification issue; Firestore writes are already within limits, and the bottleneck is index-related, not capacity. Option D is wrong because sharding tenants into separate Firestore databases distributes the write load but does not eliminate the per-property automatic indexing overhead within each database; it also adds operational complexity and cost without fixing the core index management problem.

46
MCQeasy

Refer to the exhibit. A company wants to perform point-in-time recovery (PITR) for their Cloud SQL MySQL instance. Is PITR enabled?

A.No, because PITR requires the backupConfiguration to have 'pointInTimeRecoveryEnabled: true'.
B.Yes, because binaryLogEnabled is true.
C.No, because transactionLogRetentionDays is set to 7.
D.Yes, because enabled is true.
AnswerB

Binary logs are used for MySQL PITR; their presence indicates PITR is enabled.

Why this answer

Option B is correct because Cloud SQL MySQL uses binary logging to enable point-in-time recovery (PITR). When `binaryLogEnabled` is set to `true`, the instance logs all changes, allowing restoration to any specific point within the configured transaction log retention period. The `pointInTimeRecoveryEnabled` field is not a valid Cloud SQL configuration parameter; instead, PITR is implicitly enabled when binary logging is active.

Exam trap

The trap here is that candidates confuse the `enabled` field (for automated backups) with PITR, or assume a separate `pointInTimeRecoveryEnabled` flag exists, when in fact Cloud SQL ties PITR directly to binary logging.

How to eliminate wrong answers

Option A is wrong because `pointInTimeRecoveryEnabled` is not a recognized field in Cloud SQL's backupConfiguration; PITR is controlled by `binaryLogEnabled`. Option C is wrong because `transactionLogRetentionDays` being set to 7 does not disable PITR; it defines how long binary logs are retained, and PITR works within that window. Option D is wrong because `enabled` refers to automated backups, not PITR; automated backups and binary logging are separate settings.

47
MCQmedium

Your company runs a critical PostgreSQL database on Cloud SQL. You need to minimize downtime during a schema migration that could take up to 30 minutes. What should you do?

A.Use Database Migration Service to migrate to a new instance during the migration window.
B.Create a clone of the instance, perform the migration on the clone, then promote the clone.
C.Configure a high-availability instance and perform the migration during a planned failover.
D.Add a read replica, perform the migration on the replica, then promote it.
AnswerB

Cloning allows offline migration with minimal downtime.

Why this answer

Option B is correct because creating a clone of the Cloud SQL instance allows you to perform the schema migration on an isolated copy without affecting the production database. Once the migration is complete and verified, you can promote the clone to take over as the primary instance, minimizing downtime to just the brief promotion switchover (typically seconds). This approach avoids the long 30-minute migration window on the live database.

Exam trap

Google Cloud often tests the misconception that read replicas can be promoted to become the primary instance in Cloud SQL, but in reality, Cloud SQL read replicas are strictly read-only and cannot be promoted; only clones or HA failover replicas can assume the primary role.

How to eliminate wrong answers

Option A is wrong because Database Migration Service is designed for continuous migrations (e.g., from on-premises or other clouds) and would introduce unnecessary complexity and potential data loss for a schema-only change; it does not provide a zero-downtime schema migration path within Cloud SQL. Option C is wrong because configuring a high-availability instance does not eliminate the need to apply the schema migration to the primary; during a planned failover, the migration would still need to run on the new primary, causing the same 30-minute downtime. Option D is wrong because read replicas in Cloud SQL are read-only and cannot be promoted to a writable primary; promoting a read replica is not supported, and any schema changes on a read replica would be overwritten by replication from the primary.

48
MCQhard

A financial services company uses Cloud Spanner for transaction processing. They need to ensure zero downtime during a schema change that adds a new column with a default value to a large table. Which approach should the Database Engineer take?

A.Create a new table with the new column, then use a fan-out pattern to write to both tables until the old table is deprecated.
B.Use an ALTER TABLE statement during a maintenance window.
C.Drop the table and recreate it with the new schema.
D.Use ALTER TABLE to add the column; Spanner handles schema changes online.
AnswerD

Spanner schema changes are online and do not cause downtime.

Why this answer

Option D is correct because Cloud Spanner supports online schema changes, including adding columns with default values, without requiring a maintenance window or causing downtime. Spanner applies schema updates asynchronously across all nodes while the database remains fully available for reads and writes, making it the ideal approach for zero-downtime requirements.

Exam trap

The trap here is that candidates assume schema changes on large databases always require a maintenance window or a workaround like dual-write patterns, but Spanner's distributed architecture is specifically designed to handle schema changes online without downtime.

How to eliminate wrong answers

Option A is wrong because it introduces unnecessary complexity and operational overhead; Spanner's native online schema change capability eliminates the need for a fan-out pattern, which would also require dual-write management and eventual deprecation logic. Option B is wrong because it assumes a maintenance window is required, contradicting Spanner's design for online schema changes that do not need planned downtime. Option C is wrong because dropping and recreating a table causes complete data loss and extended downtime, which is entirely unnecessary when Spanner can add columns online without disruption.

49
MCQmedium

You need to export data from Cloud Spanner for archival purposes. Which method is most cost-effective?

A.Use a Cloud Function to copy data
B.Use Dataflow to read and write to Cloud Storage
C.Use gcloud spanner databases export
D.Use gcloud spanner databases execute-sql
AnswerC

The export command directly exports to Cloud Storage with no extra compute cost.

Why this answer

Option A is correct because the native gcloud spanner databases export command exports data directly to Cloud Storage with minimal cost and no additional compute resources. Options B and D (Dataflow, Cloud Function) incur additional compute charges. Option C (execute-sql) is not suitable for full database export.

50
Multi-Selecteasy

A company is planning to migrate a large on-premises MySQL database (5 TB) to Cloud SQL. They need to choose the appropriate Cloud SQL edition. Which two factors should they consider? (Choose two.)

Select 2 answers
A.Availability of regional high availability.
B.Automated backup capabilities.
C.Maximum storage capacity supported by each edition.
D.Performance characteristics such as maximum IOPS and throughput.
E.Integration with VPC networks.
AnswersC, D

Enterprise Plus supports 30 TB, Enterprise supports 16 TB.

Why this answer

Option C is correct because Cloud SQL editions (Enterprise, Enterprise Plus) have different maximum storage capacities; for example, Enterprise Plus supports up to 30 TB while Enterprise supports up to 10 TB. For a 5 TB database, the edition must support at least that capacity, making this a key factor. Option D is correct because performance characteristics like maximum IOPS and throughput vary by edition and directly impact database performance, especially for a large 5 TB workload.

Exam trap

The trap here is that candidates often confuse features that are available across all editions (like VPC integration, backups, or HA) with edition-specific differentiators, leading them to select options that are not actually factors in edition choice.

51
Multi-Selectmedium

A manufacturing company is deploying a time-series database for sensor data on Cloud Bigtable. They expect 100 TB of data per year and need low-latency reads on row keys within the last hour. Which TWO design choices should they make?

Select 2 answers
A.Set the maximum QPS to 1000 to avoid overloading the cluster.
B.Partition the data into separate tables for each month.
C.Use a reverse timestamp in the row key so that recent data is at the beginning of the table.
D.Use a salting prefix on the row key to distribute writes across nodes.
E.Design row keys to be as long as possible to avoid collisions.
AnswersC, D

Reversing the timestamp makes the most recent data appear first, speeding up reads for the last hour.

Why this answer

Options A (salting) and D (reverse timestamp row keys) are correct. Salting distributes writes, and reverse timestamps allow recent data to appear first, improving read latency for recent rows. Option B is wrong because storing data across multiple tables adds overhead.

Option C is wrong because row keys should not be too long. Option E is wrong because Bigtable is designed for high throughput; limiting to 1000 QPS is unnecessary.

52
MCQhard

A Cloud Bigtable instance is experiencing hotspotting on a single node during heavy write traffic. The row keys are based on a timestamp prefix. Which change should they make to the row key design to distribute writes evenly?

A.Use a reverse timestamp (e.g., MAX_TIMESTAMP - timestamp)
B.Increase the number of nodes in the cluster
C.Add a random prefix (salting) to the row key
D.Enable replication across zones
AnswerC

Salting distributes writes across nodes by randomizing the start of the row key.

Why this answer

Adding a random prefix (salting) to the row key distributes writes across multiple tablet servers by ensuring that consecutive timestamps do not all hash to the same node. This prevents hotspotting because Cloud Bigtable partitions rows lexicographically by row key; a monotonically increasing timestamp prefix causes all new writes to land on a single tablet server. Salting spreads the write load uniformly across the cluster.

Exam trap

Google Cloud often tests the misconception that scaling infrastructure (adding nodes or replication) can fix a design-level hotspotting issue, when the correct solution is to modify the row key schema to distribute the load.

How to eliminate wrong answers

Option A is wrong because reversing the timestamp (e.g., MAX_TIMESTAMP - timestamp) still produces a monotonically decreasing sequence, which will still hotspot on a single node as all new writes will be adjacent in the key space. Option B is wrong because increasing the number of nodes does not fix the root cause—the row key design still funnels all writes to one tablet server; additional nodes will remain idle for writes. Option D is wrong because replication across zones is for disaster recovery and read scalability, not for distributing write load within a single cluster; it does not change the row key distribution.

53
MCQmedium

You are designing a database architecture for a global e-commerce application. The application requires low-latency reads in multiple regions and must handle up to 100,000 writes per second globally. Which Google Cloud database solution should you use?

A.Firestore in multi-region mode.
B.Bigtable with multiple clusters.
C.Cloud SQL with cross-region replication.
D.Cloud Spanner with multi-region configuration.
AnswerD

Spanner is designed for global scale and strong consistency.

Why this answer

Cloud Spanner with a multi-region configuration is the correct choice because it provides globally distributed, strongly consistent relational database service with horizontal scalability, supporting over 100,000 writes per second across multiple regions while maintaining ACID transactions and low-latency reads via regional replicas. This meets the requirements of a global e-commerce application needing high write throughput and low read latency in multiple regions.

Exam trap

The trap here is that candidates often confuse high write throughput with NoSQL solutions like Bigtable or Firestore, overlooking that Cloud Spanner uniquely combines horizontal scalability with strong consistency and SQL support required for transactional e-commerce workloads.

How to eliminate wrong answers

Option A is wrong because Firestore in multi-region mode is a NoSQL document database optimized for mobile and web apps with eventual consistency for multi-region reads, not designed for 100,000 writes per second globally and lacks strong transactional consistency across regions. Option B is wrong because Bigtable with multiple clusters is a wide-column NoSQL database designed for high-throughput analytical workloads, not transactional e-commerce, and does not support SQL queries or strong consistency across clusters. Option C is wrong because Cloud SQL with cross-region replication is a managed relational database with limited scalability (max ~64,000 writes per second for MySQL) and cross-region replication introduces replication lag, failing to meet low-latency reads and high write throughput globally.

54
Multi-Selectmedium

Your company is migrating a 2 TB SQL Server database to Cloud SQL. You need to choose a migration approach that minimizes downtime and supports ongoing changes. Which TWO options meet these requirements?

Select 2 answers
A.Use Database Migration Service with a source of SQL Server.
B.Export the database as a .bak file and restore to Cloud SQL.
C.Use BCP to export data and import via gcloud sql import.
D.Configure a linked server to Cloud SQL from on-premises and use data synchronization tools.
E.Migrate to Azure SQL Managed Instance first, then to Cloud SQL.
AnswersA, D

DMS supports SQL Server to Cloud SQL for SQL Server with continuous replication.

Why this answer

Database Migration Service (DMS) supports continuous change data capture (CDC) for SQL Server, enabling near-zero-downtime migrations by replicating ongoing changes from the source to Cloud SQL until cutover. This approach minimizes downtime and keeps the database synchronized during the migration window, meeting both requirements.

Exam trap

Google Cloud often tests the misconception that a full export/import (like .bak or BCP) can be performed with minimal downtime, but these methods require the source to be static, failing the 'ongoing changes' requirement.

55
MCQeasy

A database engineer is reviewing the configuration of a Cloud SQL for MySQL instance. The backup configuration shows binaryLogEnabled and pointInTimeRecoveryEnabled set to true. However, the engineer is unable to perform a point-in-time recovery (PITR) to a specific second within the last 30 days. What is the most likely reason?

A.Binary logging is not enabled for all databases on the instance.
B.The transaction log retention period is not set, defaulting to 7 days, so logs older than that are purged.
C.The instance is not in a runnable state.
D.The database version is MySQL 8.0, which does not support PITR.
AnswerB

PITR requires transaction logs to be retained for the desired recovery window; the default is 7 days.

Why this answer

Option B is correct because, by default, Cloud SQL for MySQL sets the transaction log retention period to 7 days when binary logging and point-in-time recovery are enabled. This means that binary logs older than 7 days are automatically purged, making it impossible to perform a PITR to a specific second beyond that window, even if the backup retention is set to 30 days. To recover to any point within the last 30 days, the transaction log retention period must be explicitly configured to match the backup retention period.

Exam trap

Google Cloud often tests the misconception that enabling binary logging and point-in-time recovery automatically allows recovery to any point within the backup retention period, ignoring the separate transaction log retention default of 7 days.

How to eliminate wrong answers

Option A is wrong because binary logging in Cloud SQL for MySQL is enabled at the instance level, not per database, and when binaryLogEnabled is true, it applies to all databases on the instance. Option C is wrong because the instance being in a runnable state is not a prerequisite for performing a PITR; the recovery operation uses stored backups and transaction logs, and the instance can be restored from a non-runnable state. Option D is wrong because MySQL 8.0 fully supports point-in-time recovery; the limitation is not the database version but the transaction log retention period.

56
MCQhard

A company has a Cloud SQL instance with a 500 GB database. They need to perform a major version upgrade from MySQL 5.7 to 8.0 with minimal downtime. Which strategy should they use?

A.Create a read replica with new version, then promote
B.Export and import the database
C.Use in-place upgrade via gcloud command
D.Upgrade during maintenance window
AnswerA

A read replica can be created with MySQL 8.0 and promoted after sync, minimizing downtime to a failover moment.

Why this answer

Creating a read replica with the new MySQL version and then promoting it minimizes downtime because replication keeps the replica synchronized with the primary until promotion. This approach avoids the lengthy export/import process and reduces the risk of data loss or extended unavailability.

Exam trap

The trap here is that candidates may think an in-place upgrade (Option C) is possible with a simple gcloud command, but Cloud SQL requires a replica-based approach for major version changes to ensure minimal downtime and data integrity.

How to eliminate wrong answers

Option B is wrong because exporting and importing a 500 GB database would take hours, causing significant downtime and potential data inconsistency. Option C is wrong because Cloud SQL does not support in-place major version upgrades via gcloud; the gcloud command can only trigger a database flag change or minor version upgrade, not a major version jump. Option D is wrong because upgrading during a maintenance window still requires a database restart and may involve a lengthy migration process, not minimizing downtime as effectively as a replica promotion.

57
MCQmedium

A company collects sensor data from millions of devices globally. Each write is a small record with a device ID and timestamp. They need low write latency and high availability. Which database should they choose?

A.Cloud Firestore
B.Cloud Memorystore
C.Cloud SQL for MySQL
D.Cloud Bigtable
AnswerD

Bigtable excels at high write throughput, low latency, and is ideal for IoT time-series data.

Why this answer

Cloud Bigtable is a fully managed, scalable NoSQL database designed for large analytical and operational workloads with high throughput and low latency. It supports millions of writes per second from globally distributed devices, provides high availability through replication, and is optimized for time-series data like sensor records with device IDs and timestamps.

Exam trap

Google Cloud often tests the misconception that any NoSQL database is suitable for high-throughput writes, but candidates must distinguish between document stores (Firestore) and wide-column stores (Bigtable) designed for massive write scalability.

How to eliminate wrong answers

Option A is wrong because Cloud Firestore is a document-oriented NoSQL database optimized for mobile and web app real-time sync, not for high-throughput sensor ingestion from millions of devices; it has write limits per database that cannot match Bigtable's scale. Option B is wrong because Cloud Memorystore is an in-memory cache (Redis/Memcached) that does not provide durable storage or the ability to store large volumes of historical sensor data. Option C is wrong because Cloud SQL for MySQL is a relational database with limited write throughput and scaling constraints (e.g., read replicas, not horizontal sharding), making it unsuitable for millions of concurrent small writes from global devices.

58
Multi-Selectmedium

You are designing a highly available Cloud SQL for MySQL architecture. Which TWO components are essential?

Select 2 answers
A.High availability (HA) configuration with a standby zone
B.Regional persistent disk
C.Point-in-time recovery (PITR)
D.Read replicas in the same region
E.Cross-region replication
AnswersA, B

HA provides automatic failover to a standby instance in another zone.

Why this answer

A is correct because Cloud SQL for MySQL High Availability (HA) configuration provisions a standby instance in a different zone within the same region, enabling automatic failover with minimal downtime. B is correct because regional persistent disks replicate data synchronously across two zones, ensuring data durability and availability even if an entire zone fails, which is a prerequisite for HA.

Exam trap

The trap here is that candidates often confuse high availability features (like automatic failover and zone redundancy) with disaster recovery or backup features (like PITR or cross-region replication), leading them to select options that improve data protection but do not ensure continuous uptime within a single region.

59
MCQhard

Refer to the exhibit. This DDL is used to create a table in Cloud Spanner. The table will be used for storing user data with high write throughput. What is one performance issue with this table design?

A.The primary key is a monotonically increasing integer
B.The Name column is of type STRING(MAX)
C.There are no secondary indexes
D.The table is not interleaved with another table
AnswerA

Sequential keys cause write hotspots in Spanner, leading to uneven load.

Why this answer

Option A is correct because a monotonically increasing primary key (UserId) causes hot spots as all writes concentrate on the last split. Option B (STRING(MAX)) is acceptable but not a performance issue. Option C (no indexes) is not required for write throughput.

Option D (not interleaved) is irrelevant.

60
Matchingmedium

Match each Cloud Spanner replication type to its purpose.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Participates in writes and reads

Serves reads but not writes

Participates in voting but not data storage

Replication within a single region for low latency

Global replication for higher availability

Why these pairings

These replica types support different availability and performance needs.

61
MCQeasy

A Cloud SQL instance is running low on disk space. You want to increase disk size with zero downtime. Which action should you take?

A.Stop the instance, increase disk, and restart
B.Export data, create a new instance with larger disk, and import
C.Create a clone with larger disk and failover
D.Use gcloud sql instances patch to increase the storage size
AnswerD

This operation increases storage online without restarting the instance.

Why this answer

Option D is correct because Cloud SQL supports online storage increases without downtime. The `gcloud sql instances patch` command (or the equivalent Console/API operation) dynamically adds more disk capacity to the running instance while it continues serving traffic. This is possible because Cloud SQL uses persistent disks that can be resized online, and the database engine (e.g., MySQL, PostgreSQL) does not need to restart to recognize the additional space.

Exam trap

Google Cloud often tests the misconception that any storage change requires a restart or rebuild, but Cloud SQL's online disk resize is a key differentiator that candidates must remember to avoid picking downtime-inducing options like stopping the instance or recreating it.

How to eliminate wrong answers

Option A is wrong because stopping the instance causes downtime, which violates the zero-downtime requirement. Option B is wrong because exporting and importing data is a manual, time-consuming process that also requires downtime during the cutover, and it is not the recommended method for simply increasing disk size. Option C is wrong because creating a clone with a larger disk and then failing over still involves a brief interruption during the failover process, and it is an unnecessarily complex approach when a direct online resize is available.

62
MCQhard

A Database Engineer is designing a tiered storage strategy for a large BigQuery dataset. The dataset contains data that is accessed frequently for the first 30 days, moderately for the next 6 months, and rarely after that. The engineer wants to minimize overall storage cost while maintaining fast query performance on recent data. Which approach should the engineer take?

A.Use logical storage billing and partition the table by date; older data automatically moves to long-term storage after 90 days.
B.Use Bigtable for recent data and BigQuery for historical data, with a scheduled transfer between them.
C.Export data older than 30 days to Cloud Storage as Avro files and delete them from BigQuery; query them externally when needed.
D.Use physical storage billing, partition the table by ingestion date, cluster on frequently used columns, and set an expiration on partitions older than 6 months to move them to long-term storage.
AnswerD

Physical billing with long-term storage after 90 days of no modifications reduces costs. Partitioning and clustering optimize performance on recent data.

Why this answer

Option D is correct because physical storage billing in BigQuery charges separately for active and long-term storage, and setting a partition expiration on partitions older than 6 months automatically moves that data to long-term storage at a lower cost. Partitioning by ingestion date and clustering on frequently used columns ensures fast query performance on recent data while minimizing overall storage costs.

Exam trap

The trap here is that candidates confuse logical and physical storage billing, assuming that logical billing automatically provides long-term storage discounts, when in fact only physical billing has separate active and long-term storage tiers with different pricing.

How to eliminate wrong answers

Option A is wrong because logical storage billing does not have a separate long-term storage tier; it uses a single blended rate, and the 90-day automatic move to long-term storage only applies with physical billing, not logical. Option B is wrong because Bigtable is optimized for real-time, low-latency access and high write throughput, not for cost-effective storage of historical data; using it for recent data adds unnecessary complexity and cost without leveraging BigQuery's native partitioning and long-term storage features. Option C is wrong because exporting data to Cloud Storage as Avro and querying it externally with BigQuery incurs query costs on external data sources and loses the performance benefits of native BigQuery partitioning, clustering, and automatic long-term storage pricing.

63
Multi-Selecteasy

A company is planning to migrate a self-managed MongoDB database to a fully managed Google Cloud service. They need to maintain high availability and support complex queries with aggregation pipelines. Which TWO services should they consider?

Select 2 answers
A.MongoDB Atlas on Google Cloud
B.Cloud Spanner
C.Cloud Firestore
D.Cloud Bigtable
E.Cloud SQL for PostgreSQL with JSON data type
AnswersA, E

MongoDB Atlas is a fully managed MongoDB service that can run on Google Cloud and provides high availability.

Why this answer

MongoDB Atlas on Google Cloud is a fully managed MongoDB service that provides native support for MongoDB's aggregation pipeline and high availability through replica sets and automated failover. It is the direct migration path for a self-managed MongoDB database to a managed service without changing the underlying database engine.

Exam trap

Google Cloud often tests the misconception that any managed NoSQL service (like Firestore or Bigtable) can replace MongoDB, or that a relational database with JSON support (like Cloud SQL for PostgreSQL) is a drop-in replacement for MongoDB's aggregation pipeline, when in fact the pipeline's native operators and performance characteristics are unique to MongoDB.

64
MCQhard

Your team uses Cloud SQL for PostgreSQL and needs to run a one-time data correction query that will update 10 million rows. The instance has 8 vCPUs and 30 GB memory. The query is currently running for hours and impacting production performance. What should you do?

A.Create a read replica and run the update on the replica.
B.Create a clone of the instance, run the update on the clone, then promote it.
C.Run the query during off-peak hours with reduced concurrency.
D.Increase the instance size to 16 vCPUs and 60 GB memory before running the query.
AnswerB

Cloning provides an isolated environment for the update.

Why this answer

Option B is correct because creating a clone of the Cloud SQL instance provides an isolated environment where the heavy UPDATE can run without impacting production performance. After the update completes on the clone, you can promote it to become the new primary instance, effectively applying the data correction with minimal downtime. This approach avoids the performance degradation caused by running the query on the production instance and leverages Cloud SQL's cloning feature for a one-time data correction.

Exam trap

Google Cloud often tests the misconception that read replicas can handle write operations, but in Cloud SQL for PostgreSQL, replicas are strictly read-only and cannot be used for UPDATE queries.

How to eliminate wrong answers

Option A is wrong because Cloud SQL read replicas are read-only and cannot execute UPDATE, INSERT, or DELETE statements; they are designed for offloading read traffic, not for write operations. Option C is wrong because running the query during off-peak hours with reduced concurrency still executes the update on the production instance, which will continue to consume significant CPU, memory, and I/O resources, degrading performance for any concurrent production queries. Option D is wrong because increasing the instance size to 16 vCPUs and 60 GB memory only provides more resources but does not eliminate the performance impact on the production instance; the query will still contend with production workloads for the same database engine and storage, and scaling up is not a cost-effective or risk-free solution for a one-time operation.

65
MCQeasy

A team is designing a disaster recovery plan for a Cloud SQL for PostgreSQL instance. The RPO is 5 minutes and RTO is 1 hour. Which configuration meets these requirements?

A.Schedule daily exports to Cloud Storage and import in another region
B.Enable automatic failover within the same region using HA configuration
C.Create a read replica in the same region and promote it during disaster
D.Configure a cross-region read replica with point-in-time recovery (PITR) to enable failover
AnswerD

Cross-region replica provides region failover; PITR allows recovery to any point within the backup window.

Why this answer

Option D meets the RPO of 5 minutes and RTO of 1 hour because a cross-region read replica with point-in-time recovery (PITR) allows you to failover to a replica in another region, minimizing data loss to within seconds (PITR can recover to any point in time within the retention window) and promoting the replica typically completes within minutes, well under the 1-hour RTO. This configuration provides both disaster recovery across regions and granular recovery to meet the strict RPO.

Exam trap

Google Cloud often tests the distinction between high availability (HA) within a region and disaster recovery (DR) across regions, and the trap here is that candidates confuse automatic failover in the same region (Option B) with cross-region DR, failing to realize that HA does not protect against a full regional outage.

How to eliminate wrong answers

Option A is wrong because daily exports to Cloud Storage have an RPO of up to 24 hours (the time between exports), far exceeding the 5-minute requirement, and importing to another region would take much longer than the 1-hour RTO. Option B is wrong because automatic failover within the same region using HA configuration protects against zonal failures but does not protect against a regional disaster, so it cannot meet the cross-region DR requirement. Option C is wrong because a read replica in the same region cannot survive a regional outage; promoting it still leaves you in the same failed region, violating the DR need for geographic separation.

66
MCQeasy

A company needs a cross-region disaster recovery solution for their Cloud SQL MySQL database. Which feature should they use?

A.Read replicas in the same region.
B.Cloud SQL for MySQL does not support cross-region replication.
C.Cross-region replication using external replicas.
D.Use Database Migration Service to continuously copy data.
AnswerC

An external replica in a different region can serve as a disaster recovery target.

Why this answer

Option C is correct because Cloud SQL for MySQL does not natively support cross-region replication, but you can achieve it by configuring an external replica (a MySQL instance running outside Cloud SQL, such as on Compute Engine) that uses MySQL's native binary log (binlog) replication from the primary Cloud SQL instance. This setup allows you to maintain a standby database in a different region for disaster recovery, with the external replica continuously applying changes from the primary.

Exam trap

The trap here is that candidates assume Cloud SQL for MySQL has a built-in cross-region replica feature like Cloud SQL for PostgreSQL or Spanner, but it does not, leading them to incorrectly select Option B or D.

How to eliminate wrong answers

Option A is wrong because read replicas in the same region do not provide cross-region disaster recovery; they only offload read traffic within the same region and cannot survive a regional outage. Option B is wrong because Cloud SQL for MySQL does support cross-region replication indirectly through external replicas, making the absolute statement 'does not support' incorrect. Option D is wrong because Database Migration Service is designed for one-time migrations, not continuous cross-region replication; it does not maintain an ongoing sync for disaster recovery.

67
MCQeasy

You run the above command to create a Spanner instance. Later, you need to increase the instance's compute capacity to handle higher traffic. What is the correct approach?

A.Use the console to change the instance configuration to a larger one.
B.Delete the instance and recreate with --nodes=5.
C.Create a new instance with a larger config and migrate data.
D.Run gcloud spanner instances update test-instance --nodes=5
AnswerD

This updates the node count without recreating the instance.

Why this answer

Option D is correct because Cloud Spanner allows you to increase the compute capacity of an existing instance by updating the node count using the `gcloud spanner instances update` command. This operation is performed online without downtime, as Spanner supports live resizing of nodes to handle increased traffic.

Exam trap

The trap here is that candidates confuse changing the instance configuration (which requires migration) with scaling compute capacity by adjusting node count (which is a live, online operation).

How to eliminate wrong answers

Option A is wrong because instance configuration (e.g., regional vs. multi-regional) cannot be changed after creation; you would need to create a new instance with the desired configuration and migrate data. Option B is wrong because deleting and recreating the instance is unnecessary and causes downtime; Spanner supports live node count changes without instance deletion. Option C is wrong because creating a new instance with a larger config and migrating data is only required when changing the instance configuration (e.g., from regional to multi-regional), not when simply increasing node count within the same configuration.

68
MCQeasy

A developer needs to store JSON documents that are frequently accessed by key but rarely updated. The data size is under 10 GB initially but expected to grow to 500 GB. Which database service is most suitable?

A.Firestore (Datastore mode) with document keys
B.Cloud Bigtable with row keys as document IDs
C.Memorystore for Redis with JSON data type
D.Cloud SQL for PostgreSQL with JSONB column
AnswerA

Firestore provides document store with automatic scaling and low-latency key lookups.

Why this answer

Firestore in Datastore mode is ideal because it provides a fully managed, scalable NoSQL document database with automatic sharding and strong consistency for key-based lookups. It handles growth from 10 GB to 500 GB seamlessly without manual partitioning, and its document keys enable efficient point reads for frequently accessed, rarely updated JSON data.

Exam trap

The trap here is that candidates often choose Cloud Bigtable (B) for large-scale key-value workloads, overlooking that Bigtable is designed for wide-column, high-throughput analytical access patterns, not for storing JSON documents with frequent point reads by key.

How to eliminate wrong answers

Option B is wrong because Cloud Bigtable is a wide-column NoSQL database optimized for high-throughput, low-latency analytical workloads (e.g., time-series or IoT data), not for storing and retrieving JSON documents by key; it lacks native JSON support and is overkill for this use case. Option C is wrong because Memorystore for Redis is an in-memory cache, not a persistent database; while it supports JSON data type via RedisJSON module, it is designed for ephemeral caching and cannot reliably store 500 GB of data without significant cost and data loss risk on restart. Option D is wrong because Cloud SQL for PostgreSQL with JSONB column is a relational database that requires manual sharding or read replicas to scale beyond a single instance, and it does not provide the automatic, seamless scalability to 500 GB that a NoSQL document store like Firestore offers.

69
MCQmedium

An online retailer uses Cloud SQL for PostgreSQL. They need to scale for a seasonal peak. They expect 2x current traffic. Their current instance is 16 vCPU, 64 GB RAM, 1 TB storage. The peak lasts 4 hours. They want to handle it without downtime. What is the best approach?

A.Use Cloud Spanner to auto-scale.
B.Upgrade to a higher-tier machine type permanently.
C.Add read replicas and rewrite queries to use replicas for reads.
D.Increase vCPU and memory to 32 vCPU/128 GB temporarily for the peak window.
AnswerD

Vertical scaling is straightforward and temporary, minimizing cost.

Why this answer

Option A is best because Cloud SQL allows vertical scaling (increasing vCPU and RAM) with a brief downtime (restart) but usually acceptable; for 4-hour peak, temporary scaling is cost-effective. B read replicas help reads not writes. C is overkill.

D permanent upgrade is unnecessary. So A.

70
MCQeasy

A company needs to store session data for a web application that runs on Google Kubernetes Engine (GKE). The data is temporary and high-availability is required. Which database service is most appropriate?

A.Cloud Spanner
B.Cloud SQL for MySQL
C.Memorystore for Redis with replication
D.Cloud Bigtable
AnswerC

Memorystore provides a highly available in-memory cache, perfect for session data.

Why this answer

Memorystore for Redis with replication is the most appropriate choice because session data is temporary, requires high availability, and benefits from Redis's in-memory, low-latency key-value store. Replication provides failover capability, ensuring session continuity if a primary node fails, while Redis's built-in expiry (TTL) handles temporary data cleanup automatically.

Exam trap

Google Cloud often tests the distinction between 'persistent storage' and 'temporary cache'—candidates mistakenly choose Cloud SQL or Spanner for 'high availability' without recognizing that session data is ephemeral and better served by an in-memory store with replication.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner is a globally distributed, strongly consistent relational database designed for OLTP workloads with horizontal scaling, not for temporary session data; its high cost and latency overhead are unnecessary for ephemeral key-value storage. Option B is wrong because Cloud SQL for MySQL is a relational database with disk-based storage, which introduces higher latency and operational overhead for session data that is better served by an in-memory cache; it also lacks native TTL-based expiry for temporary data. Option D is wrong because Cloud Bigtable is a wide-column NoSQL database optimized for large-scale analytical and time-series workloads, not for low-latency session storage; its access patterns and cost model are mismatched for transient, high-frequency read/write session data.

71
MCQeasy

A data engineer needs to grant a service account read-only access to a Cloud Storage bucket containing sensitive data. The service account is used by a Compute Engine instance. What is the most secure way to assign the permissions?

A.Set bucket ACLs to allow read access for the service account.
B.Make the bucket public and rely on network restrictions.
C.Grant the service account the Storage Object Viewer role at the project level.
D.Grant the service account the Storage Object Viewer role on the specific bucket.
AnswerD

Bucket-level IAM grants least privilege.

Why this answer

Option D is correct because granting the Storage Object Viewer role at the bucket level applies the principle of least privilege, restricting the service account's read-only access to only that specific bucket. This avoids granting broader permissions at the project level, which would inadvertently allow access to all buckets in the project. Using IAM roles is more secure and manageable than legacy bucket ACLs.

Exam trap

Google Cloud often tests the principle of least privilege by making candidates choose between project-level and resource-level IAM roles, where the trap is assuming project-level roles are acceptable without considering the broader access they grant.

How to eliminate wrong answers

Option A is wrong because bucket ACLs are a legacy access control mechanism that are less granular and harder to audit than IAM roles; they also do not support service accounts natively in the same way IAM does, and mixing ACLs with IAM can lead to unintended permissions. Option B is wrong because making the bucket public exposes the sensitive data to anyone on the internet, and network restrictions alone are insufficient for authentication and authorization, violating the principle of least privilege. Option C is wrong because granting the Storage Object Viewer role at the project level gives the service account read access to all buckets in the project, not just the one containing sensitive data, which unnecessarily broadens the attack surface.

72
MCQhard

A global e-commerce company uses Cloud SQL for MySQL to store inventory data. They have a single primary instance in us-central1 and two read replicas in us-west1 and europe-west1 for local reads. Recently, the primary instance experienced a hardware failure causing an outage. The failover to a Cloud SQL high availability (HA) instance took 2 minutes. However, during that time, inventory updates were lost because the binary log position was not fully synchronized. The company requires zero data loss for inventory updates. What should the database engineer do?

A.Migrate to Cloud Spanner with multi-region configuration.
B.Use Cloud SQL with external replication and a stand-by instance in another region.
C.Implement application-level write-ahead logging and replay on failover.
D.Enable point-in-time recovery with a 7-day retention.
AnswerA

Spanner offers synchronous replication across regions, ensuring zero data loss.

Why this answer

Cloud Spanner with a multi-region configuration provides synchronous replication across regions, ensuring strong consistency and zero data loss during failover. Unlike Cloud SQL's asynchronous replication, Spanner uses the Paxos protocol to commit writes across multiple regions before acknowledging success, which eliminates the risk of lost inventory updates during a primary failure.

Exam trap

The trap here is that candidates assume Cloud SQL's high availability (HA) with regional replicas can guarantee zero data loss, but they overlook that Cloud SQL uses asynchronous replication for read replicas, which inherently risks data loss during a primary failure.

How to eliminate wrong answers

Option B is wrong because Cloud SQL with external replication still relies on asynchronous binary log replication, which cannot guarantee zero data loss during a failover; the stand-by instance would have the same synchronization lag issue. Option C is wrong because implementing application-level write-ahead logging and replay on failover adds complexity and does not address the underlying database replication gap; it still depends on the database's binary log position, which was not fully synchronized. Option D is wrong because point-in-time recovery (PITR) with a 7-day retention only allows restoring to a specific time in the past from backups, not real-time failover; it does not prevent data loss during a hardware failure because the binary log position was not synchronized at the moment of the outage.

73
MCQhard

A financial institution requires all data stored in Cloud Spanner to be encrypted using customer-managed encryption keys (CMEK) stored in Cloud KMS. The security team mandates that the key be in a separate project from the Spanner instance. How should the database engineer configure this?

A.Grant the Cloud Spanner service account the Editor role in the key project.
B.Grant the Cloud Spanner service account the Cloud KMS CryptoKey Encrypter/Decrypter role on the key.
C.Specify the key in the Spanner instance creation and provide the user's credentials for KMS access.
D.Grant the Spanner instance's service account the Cloud KMS Admin role on the key.
AnswerB

This role allows Spanner to use the key for encryption and decryption.

Why this answer

Option B is correct because Cloud Spanner uses a service account to access Cloud KMS keys. To enable customer-managed encryption keys (CMEK) from a separate project, the Cloud Spanner service account must be granted the Cloud KMS CryptoKey Encrypter/Decrypter role on the specific key. This allows Spanner to encrypt and decrypt data using the key without granting broader permissions.

Exam trap

The trap here is that candidates often confuse the Cloud KMS Admin role (which manages the key lifecycle) with the Encrypter/Decrypter role (which performs cryptographic operations), leading them to select option D instead of B.

How to eliminate wrong answers

Option A is wrong because granting the Editor role in the key project is overly permissive and violates the principle of least privilege; it would allow the Spanner service account to manage all resources in the key project, not just the specific key. Option C is wrong because user credentials cannot be used for KMS access; Spanner requires a service account, not a user account, to authenticate with Cloud KMS. Option D is wrong because the Cloud KMS Admin role grants permissions to manage key policies and rotations, which is unnecessary for encryption/decryption operations and introduces security risks.

74
MCQhard

A Cloud Spanner database is experiencing high CPU utilization on one node. Users report slow queries. The table uses a UUID primary key. What is the most effective action?

A.Add a database index on frequently queried columns.
B.Convert the UUID to a monotonically increasing integer.
C.Use a hash key prefix to distribute writes.
D.Increase the number of nodes in the instance.
AnswerC

A hash prefix spreads writes across multiple nodes, reducing load on a single node.

Why this answer

A hash key prefix can distribute writes more evenly across nodes, preventing hot spots that cause high CPU on a single node. Adding nodes may not resolve a hot spot.

75
MCQhard

A global gaming company uses Cloud Spanner for user profiles and game state. They have a single-region instance in us-central1. Recently, they launched in Europe and notice high latency for European users. They also need to ensure data locality compliance (GDPR). The database is heavily written with throughput spikes. They want to minimize latency without sacrificing write throughput. They consider adding a secondary index on region column. What is the best course of action?

A.Shard the database by region into separate Spanner instances.
B.Use Cloud CDN to cache read data.
C.Create a read-only replica in Europe using Cloud Spanner's read replica feature.
D.Create a multi-region configuration spanning US and Europe, and modify application to read from closest region.
AnswerD

Multi-region provides synchronous replication for low-latency reads/writes globally and meets compliance.

Why this answer

Option D is correct because a multi-region Spanner configuration with regional endpoints allows the application to read from the closest region, reducing latency for European users while maintaining strong consistency and write throughput. Spanner's multi-region configurations use synchronous replication across regions, ensuring GDPR compliance by keeping European user data within Europe for reads, and the write throughput is not sacrificed because all writes are committed to the primary region and replicated asynchronously to other regions.

Exam trap

The trap here is that candidates confuse Cloud Spanner's read replica feature with a read-only replica, but Spanner does not offer standalone read replicas; instead, it uses multi-region configurations with regional endpoints for read affinity, and the term 'read replica' is a common misconception from other databases like Cloud SQL.

How to eliminate wrong answers

Option A is wrong because sharding into separate Spanner instances would break global consistency and require complex application-level routing, and it would not provide a single global database for user profiles and game state. Option B is wrong because Cloud CDN caches static content, not dynamic database writes or transactional data, and it cannot reduce latency for write-heavy workloads or ensure data locality for GDPR. Option C is wrong because Cloud Spanner does not support read-only replicas; it uses multi-region configurations with regional endpoints for read affinity, and a read replica would not handle write throughput spikes or maintain strong consistency.

Page 1 of 2 · 144 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Plan and manage database infrastructure questions.