PCDBE Professional Cloud Database Engineer Practice Questions
Prepare for PCDBE with more than an answer.
Unlock the full exam and previous versions
- v1Google Cloud Professional Cloud Database Engineer 207 questions Locked
- PCDBELegacy Professional Cloud Database Engineer 258 questions Current
- 1
You are tasked with optimizing storage costs for a Cloud Bigtable instance that stores historical log data. The data is frequently accessed for the first 30 days, but access drops significantly after that. The data must be retained for a total of 365 days for compliance reasons. What is the most cost-effective and automated way to manage the lifecycle of this data in Bigtable?
Show answer details
Correct answer: A
Bigtable's built-in garbage collection policies are the intended mechanism for automated data lifecycle management. By setting an age-based policy (
max_age) of 365 days on the relevant column family, you instruct Bigtable to automatically and efficiently delete any cells older than that period. This is a simple, automated, and cost-effective solution that requires no external services. - 2
A DevOps team is building an automation script using Terraform to provision Cloud SQL for PostgreSQL instances. As part of the configuration, they need to set the
max_connectionsflag for the database. However, they want the script to be reusable for different instance sizes (e.g., small, medium, large) without hardcoding the value, as the maximum allowed connections depend on the instance's available memory. How should they approach this in their automation?Show answer details
Correct answer: A
This is the correct and simplest approach. Cloud SQL manages many PostgreSQL parameters automatically. For
max_connections, if the flag is not explicitly set by the user, Cloud SQL calculates and applies a sane default value based on the amount of memory allocated to the instance. This ensures that the setting is always appropriate for the instance size without requiring manual calculation or logic in the automation script. - 3
A new regulation requires your company to store certain customer data only within European Union member states. The application serving this data is deployed in multiple EU regions (e.g.,
europe-west1,europe-west4) for high availability and low latency. You need a database solution that is strongly consistent, supports SQL, and can enforce this data residency requirement while still being managed as a single logical database. Which solution should you choose?Show answer details
Correct answer: A
Cloud Spanner is designed for these requirements. A multi-region configuration like
eur5provides a single logical database that spans multiple regions, offering high availability and strong consistency. Crucially, Google guarantees that for such regional configurations, all data is stored and processed exclusively within the specified geographic area (in this case, the EU), satisfying the data residency requirement. - 4
You have been hired as a consultant to optimize a company's Google Cloud database costs. You find they are running a large, development-focused Cloud SQL for MySQL instance 24/7, even though it is only actively used during business hours (9 AM to 5 PM, Monday-Friday). What is the most direct and effective recommendation to reduce the cost of this instance?
Show answer details
Correct answer: A
Cloud SQL instances accrue costs for CPU and memory even when idle. For non-production environments with predictable usage patterns, the most effective cost-saving measure is to stop the instance when it's not needed. You are only billed for storage when the instance is stopped. Automating this process using Cloud Scheduler to trigger Cloud Functions (or call the Cloud SQL Admin API directly) is the standard, Google-recommended practice.
- 5
You have configured a cross-region read replica for a Cloud SQL for PostgreSQL instance for disaster recovery purposes. The primary instance is in
us-central1and the replica is inus-east1. A regional outage has occurred inus-central1. What is the process to fail over to the replica?sequenceDiagram participant Admin participant gcloud/API participant Replica_us-east1 participant Primary_us-central1 Admin->>gcloud/API: Promote Replica gcloud/API->>Replica_us-east1: Stop replication & become writable Note over Replica_us-east1, Primary_us-central1: Primary is unavailable Admin->>Application: Update connection string Application->>Replica_us-east1: Connect to new primaryShow answer details
Correct answer: B
Unlike the automatic failover provided by the HA configuration (which is zonal), failing over to a cross-region read replica is a manual process. You must explicitly promote the replica to a standalone, writable instance. Because the replica has its own unique IP address, you must then manually update your application's configuration to connect to this new primary.
- 6
A financial services firm is migrating its on-premises PostgreSQL database to Google Cloud. A key regulatory requirement is that all database administrator actions must be logged, including the exact SQL text of queries executed against administrative views. You have configured Cloud Audit Logs for the Cloud SQL for PostgreSQL instance, but the CISO reports that Data Access audit logs are not capturing the full text of
SELECTstatements run by DBAs. Which action is required to meet this compliance mandate?Show answer details
Correct answer: A
Standard Cloud Audit Logs for Cloud SQL do not capture the full SQL text for data access events like SELECT queries for performance reasons. To meet the strict requirement of logging the exact SQL text for administrative queries, you must enable the
pgauditextension. This is done by setting thecloudsql.enable_pgauditflag toonand then configuring thepgaudit.logflag to specify which classes of commands to log, such asREADfor select statements. - 7
A global media company uses a multi-region Cloud Spanner instance for its content metadata catalog. To optimize costs, the development team has been instructed to use stale reads (
exact_stalenessormax_staleness) for non-critical user-facing queries. However, they report that some stale reads are unexpectedly slow, occasionally taking almost as long as strong reads. You need to diagnose the underlying cause of this performance anomaly. What is the most likely reason for this behavior?Show answer details
Correct answer: A
Cloud Spanner serves stale reads from the closest replica that has data up to the requested timestamp. If the staleness bound (e.g.,
max_stalenessof 1 second) is too aggressive, the nearest replica may not have received the data for that timestamp yet. In this case, the query must wait for the data to propagate, which can introduce latency and make the stale read perform similarly to a strong read that goes to the leader region. - 8
You are designing a database migration strategy for a large retail company moving from a self-managed Oracle RAC environment on-premises to Google Cloud. The primary goals are to minimize downtime and provide a safety net for rollback if issues arise post-migration. The target database will be Cloud SQL for PostgreSQL. You will use the Database Migration Service (DMS) for the migration. Which TWO actions should you incorporate into your migration plan to meet the requirements? (Select TWO)
Show answer details
Correct answer: A, B
A continuous migration job using Change Data Capture (CDC) is essential for minimizing downtime. It performs the initial bulk copy and then streams ongoing changes, allowing the target database to remain in sync with the source until the final cutover.
Setting up reverse replication is a critical part of a fallback plan. After promoting the Cloud SQL instance and directing traffic to it, this reverse stream sends any new changes back to the original source database. This keeps the source 'warm' and enables a rapid rollback to the on-premises environment if a critical issue is discovered in the new Google Cloud application.
- 9
A social media company is launching a new feature that generates a personalized, chronological feed of events for each user. The projected workload is extremely write-heavy, with billions of events ingested daily. The most common query pattern is retrieving the last N events for a specific user. The data must be durable, but eventual consistency is acceptable for the feed generation. The company wants a solution that offers predictable low latency for writes and scales linearly without manual sharding. Which database solution and schema design should you recommend?
Show answer details
Correct answer: A
Cloud Bigtable is ideal for massive-scale, low-latency write workloads like this event ingestion scenario. The key to performance is the row key design. A
userIdprefix groups all events for a single user together. Appending a reversed timestamp (e.g.,Long.MAX_VALUE - timestamp) ensures that the most recent events are stored at the beginning of the row range for that user. This makes the query for the 'last N events' a highly efficient scan of just a few rows, satisfying all requirements.
