Design innovative, scalable, and highly available cloud database solutions →easyMultiple ChoiceObjective-mapped
PCDE Practice Question: Design innovative, scalable, and highly available cloud database solutions
You are designing a schema for Cloud Spanner and need to avoid write hotspots. Which primary key design strategy is recommended?
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 UUID or hash prefix as the first part of the primary key
Using a UUID or a hash prefix as the first part of the primary key ensures that writes are distributed across nodes, avoiding hotspots. Monotonically increasing keys like timestamps cause all writes to hit the same tablet, creating a hotspot.
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 the most frequently queried column as the primary key
Why it's wrong here
While query performance is important, for write distribution you need to avoid sequential patterns.
- ✓
Use a UUID or hash prefix as the first part of the primary key
Why this is correct
UUIDs or hash prefixes distribute writes across tablets, avoiding hotspots.
- ✗
Use a composite key with the leading column being a timestamp
Why it's wrong here
Leading with a timestamp still creates a hotspot.
- ✗
Use a monotonically increasing timestamp as the primary key
Why it's wrong here
Monotonically increasing keys create hotspots because all writes go to the same tablet.
Go deeper
Related to this question
About these practice questions
One of 1,446 original PCDE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.