AWS Certified Developer – Associate / Question #875 of 557

Question #875

A company is launching a beta program for a new product. Users can register for the beta by filling out an enrollment form. The company anticipates a high volume of registrations when enrollment opens. Each registration will be stored as an item in an Amazon DynamoDB table. Each item includes the user's unique ID, the registration timestamp, an approval status of PENDING, APPROVED, or REJECTED, and a feedback score from 1 to 10. Each user may only register once. For the DynamoDB table, the developer must select a partition key that ensures evenly distributed access patterns across partitions. Which DynamoDB attribute best satisfies these requirements?

A

User ID

B

Registration timestamp

C

Approval status

D

Feedback score from 1 to 10

Explanation

The correct answer is A (User ID) because:
1. High Cardinality: User IDs are unique per registration, ensuring even distribution of data across partitions.
2. Avoid Hot Partitions: Timestamp (B) risks clustering during registration spikes. Approval status (C) has only 3 values, causing imbalance. Feedback score (D) has only 10 values, leading to skewed access.
3. DynamoDB Best Practices: Partition keys should be unique and high-cardinality attributes to prevent performance bottlenecks. User ID meets these requirements, while other options do not.

Key Points:
- DynamoDB uses partition keys to distribute data.
- High-cardinality attributes prevent hot partitions.
- Unique identifiers (e.g., User ID) are ideal for uniform access patterns.

Answer

The correct answer is: A