DVA-C02 · Question #332
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 availabl
The correct answer is A. Username. A good DynamoDB partition key must have high cardinality and distribute writes evenly; username uniquely identifies each user and spreads load across partitions.
Question
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?
Options
- AUsername
- BSubmission date
- CValidation status
- DRating of the process on a scale of 1 to 5
How the community answered
(55 responses)- A84% (46)
- B4% (2)
- C11% (6)
- D2% (1)
Why each option
A good DynamoDB partition key must have high cardinality and distribute writes evenly; username uniquely identifies each user and spreads load across partitions.
Username is unique per user and the schema enforces one request per user, giving this attribute the highest cardinality of all options. High-cardinality partition keys distribute items evenly across DynamoDB partitions, avoiding hot partitions during a traffic surge.
Submission date has low cardinality during a surge because many users submit at nearly the same time, concentrating writes on a small number of partitions.
Validation status has only three possible values (UNVALIDATED, VALID, NOT VALID), which would funnel nearly all new items into a single hot partition.
Rating has only five possible values (1-5), creating at most five partitions and severe hot-partition skew during a high-volume event.
Concept tested: DynamoDB partition key cardinality and hot partition avoidance
Source: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html
Community Discussion
No community discussion yet for this question.