DEA-C01 exam dumps

DEA-C01 practice question 265 of 550

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

DEA-C01 Question 265

Single answer

You are designing a data model for an e-commerce application using Amazon DynamoDB. The application needs to store information about customer orders. Each order has attributes such as OrderID, CustomerID, OrderDate, and OrderStatus. The application frequently queries all orders for a specific customer sorted by OrderDate. Which primary key design should you choose for optimal performance?

  1. A

    Use OrderID as the partition key and OrderDate as the sort key.

  2. B

    Use CustomerID as the partition key and OrderDate as the sort key.

  3. C

    Use CustomerID as the partition key and OrderID as the sort key.

  4. D

    Use OrderDate as the partition key and OrderID as the sort key.

Show answer and explanation

Correct answer: B

Explanation

In Amazon DynamoDB, designing the primary key involves selecting a partition key (and optionally a sort key) that aligns with the application's query patterns. Since the application frequently queries all orders for a specific customer sorted by OrderDate, using CustomerID as the partition key ensures all orders for each customer are grouped together. Using OrderDate as the sort key enables efficient sorting of orders by date within each customer group. This design optimally supports the application's query pattern.

  • A. Incorrect.

    Using OrderID as the partition key and OrderDate as the sort key will not optimize queries for retrieving all orders for a specific customer. OrderID does not group the data by customer.

  • B. Correct.

    Using CustomerID as the partition key and OrderDate as the sort key is the best choice because it groups all orders by customer and allows efficient sorting by OrderDate.

  • C. Incorrect.

    Using CustomerID as the partition key and OrderID as the sort key groups orders by customer but fails to optimize sorting by OrderDate, which is a frequent query requirement.

  • D. Incorrect.

    Using OrderDate as the partition key and OrderID as the sort key will not group data by customer, making it inefficient for customer-specific queries.

Timed practice exam

Take a DEA-C01 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