Design innovative, scalable, and highly available cloud database solutions →hardMultiple ChoiceObjective-mapped
PCDE Practice Question: Design innovative, scalable, and highly available cloud database solutions
You have a Cloud Spanner instance and need to add a new column and a secondary index to an existing table. The table is heavily used by production traffic. Which approach minimizes downtime and performance impact?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use 'gcloud spanner databases ddl update' to add the column and create the index concurrently
Spanner supports online schema changes: you can add columns and indexes without downtime. The gcloud command 'gcloud spanner databases ddl update' applies DDL changes in the background without locking the table. Dropping and recreating the table causes downtime. Creating a new table and copying data requires application changes and downtime.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Export the table to Avro, modify the schema, import back into a new table, then rename
Why it's wrong here
This involves significant downtime and data movement.
- ✗
Create a new table with the new schema, use a temporary application to dual-write and backfill, then switch
Why it's wrong here
Creating a new table with dual-writes and backfill introduces extended operational risk because Cloud Spanner’s native schema changes—`ALTER TABLE ... ADD COLUMN` and `CREATE INDEX`—are already online, non-blocking operations that avoid any application-level dual-write logic. This approach is tempting because it mirrors a common zero-downtime migration pattern used in databases lacking online DDL, such as older relational systems where schema changes lock tables; it would be correct in a database that cannot alter schema without downtime.
- ✓
Use 'gcloud spanner databases ddl update' to add the column and create the index concurrently
Why this is correct
Spanner DDL changes are online and non-blocking; they can be applied without downtime.
- ✗
Drop the table and recreate it with the new schema, then restore from backup
Why it's wrong here
Dropping the table causes downtime; restore takes time.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PCDE question from scratch — 1,446 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PCDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCDE exam.