Which DynamoDB attribute should be used as a partition key for well-distributed records?
Short answer
A Username
Question
Key Takeaways
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.
Common mistake: Candidates often mistakenly choose Submission date, thinking it has many distinct values, but simultaneous submissions during a surge can still cause hot partitions.
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
This link opens the official vendor documentation in a new tab.
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).
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 7 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 7
-
Dzok5050 👍 5 Answered AIt's A of course. This question got me wondering, who choses default right answers here
-
nder 👍 3 Answered AUsername avoids a hot partition key
-
Saurabh04 👍 1 Answered BThe submission date could be a good choice if it has high cardinality (many distinct values). However, if multiple requests occur simultaneously (e.g., during the surge), it might still lead to hot partitions
-
Saudis 👍 1 Answered Apartition key should be Unique so the A is a best choice
-
CrescentShared 👍 2 Answered Arest is not even distributed.
Show 2 more comments
-
65703c1 👍 2 Answered AA is the correct answer.
-
KarBiswa 👍 1 Answered AUsername beyond doubt
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →