Which DynamoDB attribute should be used as a partition key for well-distributed records?
A company is releasing a new feature. Users can request early access to the new feature by using an application form. The company expects a surge of requests when the application form becomes available. Each request will be stored as an item in an Amazon DynamoDB table. Each item will contain the user's username, the submission date, and a validation status of UNVALIDATED. VALID, or NOT VALID. Each item also will contain the user's rating of the process on a scale of 1 to 5. Each user can submit one request. For the DynamoDB table, the developer must choose a partition key that will give the workload well-distributed records across partitions. Which DynamoDB attribute will meet these requirements?
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The core concept is choosing a partition key with high cardinality and uniqueness to avoid hot partitions; the common trap is selecting attributes with low cardinality like status or rating.
This question tests the selection of an optimal DynamoDB partition key to ensure even data distribution across partitions during high-traffic surges. Community consensus strongly favors Username due to its high cardinality and uniqueness.
Candidates often mistakenly choose Submission date, thinking it has many distinct values, but simultaneous submissions during a surge can still cause hot partitions.
Community Discussion (7 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Understanding DynamoDB Partition Keys
In Amazon DynamoDB, the partition key (also known as the hash key) is critical for distributing data evenly across partitions. A well-chosen partition key ensures that the workload is spread out, preventing hot partitions that can degrade performance.
Why Username is the Correct Choice
Username is the best partition key because it is inherently unique for each user. Since each user can submit only one request, the username provides high cardinality and ensures that data is distributed evenly across partitions. This avoids the risk of hot partitions, even during a surge of requests.
Why Other Options Fail
- Submission date (Option B): While it may seem to have many distinct values, submissions during a surge often occur at the same time, leading to concentrated data in specific partitions. This creates hot partitions.
- Validation status (Option C): This attribute has only three possible values (UNVALIDATED, VALID, NOT VALID), resulting in extremely low cardinality. Most data would be concentrated in just a few partitions.
- Rating of the process (Option D): With only five possible values (1 to 5), this attribute also has very low cardinality, making it unsuitable as a partition key.
Community Insights
The community overwhelmingly agrees that Username is the correct answer. As one user noted, "Username avoids a hot partition key," while another emphasized that the other options "are not even distributed." These insights reinforce the importance of selecting attributes with high cardinality and uniqueness for partition keys.
Key Takeaways
- Always choose a partition key with high cardinality and uniqueness to ensure even data distribution.
- Avoid attributes with low cardinality, such as status or rating, as they lead to hot partitions.
- Consider the workload pattern (e.g., surges) when selecting a partition key.
Official Reference
Exam Strategy
When selecting a partition key, prioritize attributes with high cardinality and uniqueness. Eliminate options with low cardinality (e.g., status, rating) or attributes that may cluster during peak traffic (e.g., submission date).
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →