Courseiva

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

An engineer is migrating a workload from a relational database to Bigtable. The current schema has a Customers table (1M rows) and an Orders table (100M rows) with a foreign key. Queries often fetch all orders for a customer. What is the best row key design for the Bigtable orders table?

⚠ Common exam trap

A common misconception in Google Cloud exams is that a unique row key (like UUID or hash) is always best for distribution, ignoring that Bigtable's access pattern requires locality for range queries, which is the core trade-off in NoSQL row key design.

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 customer ID + order ID as the row key (e.g., cust123#ord456).

Using customer ID + order ID as the row key ensures that all orders for a single customer are stored in contiguous rows, enabling efficient range scans. Bigtable orders rows lexicographically by row key, so a prefix scan on the customer ID retrieves all related orders in a single read operation, avoiding expensive joins or scatter-gather patterns.

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 customer ID + order ID as the row key (e.g., cust123#ord456).

    Why this is correct

    This enables efficient scans by customer ID prefix.

  • Use the order ID as the row key and store customer ID as a column.

    Why it's wrong here

    This would require scanning all rows to find orders for a customer.

  • Use a hash of the customer ID as the row key.

    Why it's wrong here

    Hashing defeats the ability to scan all orders for a customer.

  • Use a random UUID as the row key.

    Why it's wrong here

    A random UUID does not group orders by customer.

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 →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way 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 financial services company uses Cloud Bigtable to store transaction data. The row key is constructed as customer_id reversed timestamp. The team wants to retrieve the most recent 100 transactions for a specific customer quickly. Which row key design principle is being used to optimize this query?

hard
  • A.Reverse timestamp
  • B.Field promotion
  • C.Salting
  • D.Composite key

Why A: Reverse timestamp in the row key ensures that the most recent transactions for a given customer appear first when scanning rows with that customer prefix.

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.