Design innovative, scalable, and highly available cloud database solutions →hardMultiple SelectObjective-mapped
PCDE Practice Question: Design innovative, scalable, and highly available cloud database solutions
A company is migrating a large relational database to Bigtable. The database has a table with columns: user_id (string), event_type (string), timestamp (timestamp), and details (JSON). The access patterns include retrieving all events for a user in a time range, and filtering by event_type. Which THREE row key design strategies should they apply? (Choose 3)
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
✓
Include event_type as a column qualifier instead of row key
A row key like hash(user_id) + user_id + reverse_timestamp + event_type distributes writes (hash), allows user-level scans (user_id), orders by time (reverse_timestamp), and enables filtering on event_type by using it as a column qualifier or part of key.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Include event_type as a column qualifier instead of row key
Why this is correct
Column qualifiers can be used to filter, and including event_type in row key may cause wide rows.
- ✗
Store all events for a user in a single row
Why it's wrong here
Would create huge rows and poor performance; each event should be a separate row.
- ✓
Use a hash prefix of user_id to distribute writes
Why this is correct
Avoids hotspots on popular users.
- ✗
Use a monotonically increasing timestamp as the row key
Why it's wrong here
Causes hotspotting; use reverse timestamp and append after user_id.
- ✓
Use reverse timestamp to enable recent data first scans
Why this is correct
Allows efficient retrieval of recent events for a user.
Go deeper
Related to this question
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 →
Same concept, more angles
3 more ways this is tested on PCDE
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company is migrating from a relational database to Cloud Bigtable. They have a table with a 'user_id' and 'login_timestamp'. Queries often filter by user_id and time range. What should be the row key?
medium- A.timestamp
- ✓ B.hash(user_id) + timestamp
- C.user_id + timestamp
- D.user_id
Why B: hashing the user_id prevents hotspots, and appending timestamp enables range scans. 'user_id' alone may cause hotspots if sequential.
Variation 2. An engineer is designing a Bigtable row key for global user events. They want to avoid hotspots and enable efficient queries by user_id and time range. Which row key design is best?
medium- ✓ A.hash(user_id) + timestamp
- B.reverse(timestamp) + user_id
- C.user_id + timestamp
- D.timestamp + user_id
Why A: Using a hash of user_id ensures distribution, and appending timestamp enables range scans by time within a user's events.
Variation 3. You need to design a Cloud Bigtable row key for a time-series application that records user activity. The most common queries filter by user_id and then by timestamp (most recent first). Which row key design is MOST appropriate?
medium- A.user_id#timestamp
- ✓ B.user_id#reverse_timestamp
- C.reverse_timestamp#user_id
- D.timestamp#user_id
Why B: For time-series with frequent queries filtering by user_id and recent data, the recommended design is to put user_id first and then use a reverse timestamp. This ensures data for a user is co-located and the latest data appears first when scanning.
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.