A logistics company is deploying a tracking system on AWS that ingests status updates from packages. The ingestion rate is expected to reach write operations per second. The solutions architect designs an Amazon DynamoDB table with `status_date` (formatted as YYYY-MM-DD) as the partition key. During performance testing, the application experiences write throttling errors, even though the total allocated write throughput is far below the table's limit. Which modification should the solutions architect make to resolve this write bottleneck and optimize performance?
- Change the partition key of the table to a high-cardinality attribute, such as `package_id`, to distribute write requests evenly across partitions.Answer
- BSwitch the DynamoDB table capacity mode to On-Demand to allow the table to automatically scale to handle the write spikes.
- CProvision additional Write Capacity Units (WCUs) on the DynamoDB table to scale the partition limits during peak ingestion hours.
- DMigrate the data store to an Amazon RDS PostgreSQL database configured with Multi-AZ and multiple Read Replicas to offload write operations.
Answer
Change the partition key of the table to a high-cardinality attribute, such as `package_id`, to distribute write requests evenly across partitions.
The correct answer is to change the partition key to a high-cardinality attribute like `package_id`. Amazon DynamoDB distributes data and workload traffic across physical partitions based on the partition key value. A single partition has a hard limit of Write Capacity Units (WCUs) per second. Using `status_date` (which changes only once per day) results in all write requests targeting a single partition, creating a hot partition. Changing the partition key to `package_id` ensures that writes are evenly distributed across many partitions, allowing the table to support the full writes per second without partition-level throttling.
Step-by-Step Solution
Key Concept
DynamoDB partition key design and partition throughput limits
Estimated Time:1m 30s