Question

Difficulty: MediumHigh-Performing Database Solutions

A logistics company is deploying a tracking system on AWS that ingests status updates from packages. The ingestion rate is expected to reach 10,00010,000 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?

  1. Change the partition key of the table to a high-cardinality attribute, such as `package_id`, to distribute write requests evenly across partitions.Answer
  2. B
    Switch the DynamoDB table capacity mode to On-Demand to allow the table to automatically scale to handle the write spikes.
  3. C
    Provision additional Write Capacity Units (WCUs) on the DynamoDB table to scale the partition limits during peak ingestion hours.
  4. D
    Migrate 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 1,0001,000 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 10,00010,000 writes per second without partition-level throttling.

Step-by-Step Solution

1
Identify the cause of throttling in Amazon DynamoDB.
The current partition key `status_date` (YYYY-MM-DD) has very low cardinality, causing all 10,00010,000 write operations per second on a given day to target the same partition key value.
DynamoDB allocates capacity across partitions. A single partition can support a maximum of 1,0001,000 Write Capacity Units (WCUs).
2
Evaluate the proposed solutions against the partition limits.
Changing the partition key to `package_id` introduces high cardinality. Since each package has a unique ID, writes are spread across many partitions.
Distributing the writes across partitions prevents any single partition from exceeding the 1,0001,000 WCU limit.

Key Concept

DynamoDB partition key design and partition throughput limits
Estimated Time:1m 30s
Rate this question