Courseiva
Question 1,467 of 1,446

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

A financial services company is migrating from an on-premises Oracle RAC database to Cloud Spanner. The current application uses sequences to generate globally unique IDs for transactions. To avoid creating hotspots in Spanner, the database architect recommends using a different primary key strategy. Which primary key design is most appropriate for Spanner to avoid hotspots?

⚠ Common exam trap

A common trap in this question is that candidates may assume UUIDs are the best choice for distributed databases due to their uniqueness, but in Cloud Spanner, UUIDs cause storage bloat and poor performance due to random key distribution. The real pitfall is overlooking the hotspot issue with sequential keys and not considering Spanner's key-range sharding behavior.

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 a bit-reversed sequential key generated by the application.

Bit-reversed sequential keys distribute writes evenly across Cloud Spanner's split boundaries, preventing hotspots. Spanner uses key-range-based sharding, so monotonically increasing keys (like Oracle sequences) cause all new writes to hit a single split, leading to contention. Bit-reversal spreads sequential values across the key space, ensuring balanced write distribution.

Answer analysis

Option-by-option breakdown

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

  • Use a bit-reversed sequential key generated by the application.

    Why this is correct

    Bit-reversed keys distribute writes evenly while preserving some locality, avoiding hotspots.

  • Use a UUID string as the primary key.

    Why it's wrong here

    UUIDs work but are large and inefficient for indexing. A bit-reversed key is preferred.

  • Continue using sequential IDs from Oracle sequences to maintain consistency.

    Why it's wrong here

    Sequential IDs cause hotspots in Spanner.

  • Use a composite key with a hash prefix derived from the transaction timestamp.

    Why it's wrong here

    While hashing can distribute writes, using a timestamp prefix may not be random enough and could still cause hotspots.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.