A company will store one application form submission per user in a DynamoDB table. Each item includes username, submission date, validation status (UNVALIDATED, VALID, NOT VALID), and a rating from 1 to 5. To ensure records are well distributed across partitions during a surge of submissions, which attribute should be used as the partition key?
Choose an answer
Tap an option to check your answer.
Correct answer: Username.
Why this is the answer
Username is the best choice for the partition key because it provides high cardinality and ensures an even distribution of data across partitions. Each user will have a unique username, preventing hot partitions during a surge of submissions. Submission date, validation status, and rating are poor choices for a partition key. Submission date would lead to hot partitions if many submissions occur on the same day. Validation status has very low cardinality (only three possible values), causing all items to be concentrated on a few partitions. Rating also has low cardinality (only five possible values), leading to a similar issue of uneven distribution and hot partitions.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed