DVA-C02 · Question #358
A developer is creating a new application for a pet store. The application will manage customer rewards points. The developer will use Amazon DynamoDB to store the data for the application. The…
The correct answer is A. A randomly generated universally unique identifier (UUID). A randomly generated UUID provides high cardinality and uniform distribution across DynamoDB partitions, preventing hot partition scenarios before load testing is performed.
Question
A developer is creating a new application for a pet store. The application will manage customer rewards points. The developer will use Amazon DynamoDB to store the data for the application. The developer needs to optimize query performance and limit partition overload before actual performance analysis. Which option should the developer use for a partition key to meet these requirements?
Options
- AA randomly generated universally unique identifier (UUID)
- BThe customer's full name
- CThe date when the customer signed up for the rewards program
- DThe name of the customer's pet
How the community answered
(32 responses)- A69% (22)
- B19% (6)
- C3% (1)
- D9% (3)
Why each option
A randomly generated UUID provides high cardinality and uniform distribution across DynamoDB partitions, preventing hot partition scenarios before load testing is performed.
A UUID has extremely high cardinality (2^128 possible values) and no natural clustering pattern, so write and read traffic is spread evenly across all DynamoDB partitions, eliminating hot partitions and maximizing throughput from the start of the application lifecycle.
A customer's full name has low cardinality (names repeat) and uneven distribution, which can create hot partitions for common names and cause throttling.
A signup date has very low cardinality since many customers share the same date, concentrating all writes for that date on a single partition and creating a severe hot partition problem.
Pet names have low cardinality and skewed distribution (common names like 'Max' or 'Bella' would concentrate traffic), making them a poor partition key for even data distribution.
Concept tested: DynamoDB partition key design for even distribution
Source: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-uniform-load.html
Community Discussion
No community discussion yet for this question.