Question

Difficulty: MediumResolving DynamoDB Throttling and Key Distribution Issues

A ticketing application named 'PassGate' registers entry scans for high-attendance live events in a DynamoDB table. The table is configured with provisioned write capacity units (WCUs). During the check-in period for a major music concert, the application frequently encounters ProvisionedThroughputExceededException errors. CloudWatch metrics indicate that the table's overall consumed WCUs are well below the provisioned threshold, but a single partition key matching the popular EventID is receiving almost all the write traffic. Which action should the developer take to resolve this throttling issue?

  1. A
    Increase the visibility timeout of the SQS queue that feeds ticket scans to the application, allowing more time for message processing.
  2. Modify the table schema to append a random or calculated suffix to the EventID partition key, distributing the write load across multiple partitions.Answer
  3. C
    Transition the application's read operations to perform a full Scan with filter expressions instead of using Query operations.
  4. D
    Embed static access keys in the application's SDK client configuration to ensure client credentials do not expire during peak throughput.

Answer

Modify the table schema to append a random or calculated suffix to the EventID partition key, distributing the write load across multiple partitions.
The correct answer is correct because salting the partition key (appending a random or calculated suffix) distributes the writes across multiple logical partitions, preventing a hot key issue on a single partition.

Step-by-Step Solution

1
Identify the root cause of the DynamoDB throttling.
CloudWatch metrics show a disproportionate amount of write traffic targeting a single partition key value (the EventID).
A single hot partition key limits throughput to the maximum capacity of a single partition, regardless of the overall table provisioning.
2
Evaluate partition key design options to distribute write load.
Adding a random or calculated suffix (salting) to the partition key distributes the write load across multiple partitions.
This prevents write traffic from bottlenecking on a single physical partition by spreading it across multiple sub-partitions.

Key Concept

DynamoDB Partition Key Salting and Hot Partitions
Estimated Time:1m 30s
Rate this question