DVA-C02 exam dumps

DVA-C02 practice question 82 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 82

Single answer

You are designing a DynamoDB table to store log data for a large-scale application. The application generates millions of log entries daily and queries are primarily based on time ranges. To ensure balanced partition access and avoid hot partitions, which approach should you use for the partition key?

  1. A

    Use a combination of a unique identifier and the timestamp as the partition key.

  2. B

    Use a hash of the timestamp as the partition key.

  3. C

    Use a high-cardinality attribute, such as a user ID or request ID, as the partition key.

  4. D

    Use the raw timestamp as the partition key.

Show answer and explanation

Correct answer: A

Explanation

To achieve balanced partition access in DynamoDB, it is essential to use a high-cardinality partition key. Combining a unique identifier with the timestamp ensures that the data is evenly distributed across partitions, avoiding hot partitions and optimizing query performance. Other options either fail to address the risk of hot partitions or do not align with the nature of the queries.

  • A. Correct.

    Correct: Using a combination of a unique identifier (e.g., user ID or request ID) and the timestamp ensures high cardinality and distributes the data evenly across partitions, avoiding hot partitions.

  • B. Incorrect.

    Incorrect: Hashing the timestamp alone does not guarantee even distribution because timestamps may still cluster around specific time periods, leading to hot partitions.

  • C. Incorrect.

    Incorrect: Using only a high-cardinality attribute like user ID or request ID does not account for the time-based nature of the queries, potentially making it harder to query efficiently.

  • D. Incorrect.

    Incorrect: Using the raw timestamp as the partition key can lead to hot partitions because timestamps often cluster during peak traffic periods.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam