Courseiva

PCDE Practice Question: Design innovative, scalable, and highly available cloud database solutions

A company is using Cloud Spanner and needs to add a new column to an existing table that has billions of rows. The column must have a default value of 0. The team is concerned about downtime. Which approach should they take to add the column with zero downtime?

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 ALTER TABLE ADD COLUMN with DEFAULT 0; the operation is online and non-blocking

Cloud Spanner supports online schema changes that are non-blocking. Adding a column with a DEFAULT value is an online operation that does not block reads or writes, and does not require copying data. The new column is added with the default value for existing rows at read time, not by backfilling.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Take the application offline, run ALTER TABLE to add the column, then bring the application back online

    Why it's wrong here

    Unnecessary downtime; Spanner supports online schema changes.

  • Create a new table with the column, copy data using Dataflow, then rename the tables

    Why it's wrong here

    This is overly complex and involves downtime during the rename; Spanner supports direct online schema changes.

  • Add the column without a default, then run a batch update to set the default value

    Why it's wrong here

    This approach requires a separate batch operation that may cause performance impact, while Spanner allows online addition with default.

  • Use ALTER TABLE ADD COLUMN with DEFAULT 0; the operation is online and non-blocking

    Why this is correct

    Spanner schema changes are non-blocking; adding a column with a default is immediate and does not cause downtime.

About these practice questions

This PCDE question is part of Courseiva's 1,446-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.