AZ-204 Develop for Azure storage Practice Question
A table stores session records in Azure Table Storage. Queries frequently retrieve all records for one customer in a time range. What key design is best?
⚠ Common exam trap
Watch out — candidates often think randomizing the PartitionKey improves load balancing, but for query-heavy workloads targeting a single entity group, a fixed PartitionKey is essential for performance, and Azure Table Storage handles hot partitions through other mechanisms like entity-level throttling.
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
✓
PartitionKey as customer ID and RowKey based on sortable timestamp
Azure Table Storage queries are most efficient when they target a single partition key. Using the customer ID as the PartitionKey ensures all records for a customer are in the same partition, and using a sortable timestamp (e.g., inverted ticks) as the RowKey allows efficient range queries within that partition, leveraging the table's natural index order.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
RowKey as a constant value
Why it's wrong here
Using a constant value for the RowKey within Azure Table Storage is fundamentally problematic because the combination of PartitionKey and RowKey must be unique for every entity. If all records within a given PartitionKey share the same RowKey, only one entity can ever exist in that partition, effectively preventing the storage of multiple session records for a single customer. This design would severely limit data storage capabilities and eliminate any possibility of ordering or retrieving specific records within a partition.
- ✗
PartitionKey as a random GUID for every record
Why it's wrong here
Employing a random GUID for the PartitionKey for every record in Azure Table Storage results in data being scattered across an extremely large number of partitions. This distribution prevents efficient data retrieval for common query patterns, such as fetching all sessions for a specific customer or a range of customers. Such queries would necessitate either a full table scan, which is highly inefficient and costly, or numerous individual partition lookups, significantly degrading performance and increasing latency.
- ✓
PartitionKey as customer ID and RowKey based on sortable timestamp
Why this is correct
Setting the PartitionKey as the customer ID and the RowKey based on a sortable timestamp is the optimal design for session records in Azure Table Storage. This structure ensures that all session data for a particular customer is co-located within a single partition, enabling highly efficient point queries or range queries for that customer. The sortable timestamp as the RowKey further allows for rapid retrieval of sessions within a specific time range or in chronological order, leveraging Azure Table Storage's inherent indexing capabilities for fast and cost-effective data access.
- ✗
PartitionKey as the full JSON payload
Why it's wrong here
Utilizing the full JSON payload as the PartitionKey in Azure Table Storage is an impractical and inefficient approach. Azure Table Storage keys have strict size limitations (1KB per key), which a full JSON payload would almost certainly exceed, leading to insertion failures. Beyond size constraints, using a large, unstructured string as a key makes querying extremely difficult, as it would require an exact match of the entire payload, rendering range queries or partial searches impossible and negating the benefits of indexed access.
Go deeper
Related to this question
About these practice questions
One of 881 original AZ-204 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 AZ-204 practice question is part of Courseiva's free Microsoft 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 AZ-204 exam.