Question

Difficulty: EasyResolving DynamoDB Throttling and Key Distribution Issues

A microservice processes real-time telemetry data from IoT devices and writes it to an Amazon DynamoDB table. The table's partition key is DeviceType, which has three possible values: SmartWatch, FitnessTracker, and SmartScale. During periods of high traffic, the write operations fail with a ProvisionedThroughputExceededException, even though the total consumed write capacity of the table is well below the overall provisioned limit. Which TWO actions should the developer take to resolve these throttling errors? (Select TWO.)

  1. Redesign the partition key schema to use a more unique attribute, such as a combination of DeviceType and DeviceId, to distribute writes across more partitions.Answer
  2. Configure the application's AWS SDK client to use exponential backoff and jitter for request retries when throttled.Answer
  3. C
    Modify the application configuration to execute Scan operations instead of Query operations to read data from the table.
  4. D
    Increase the visibility timeout of the Amazon SQS queue consuming data from the DynamoDB Streams.
  5. E
    Hardcode temporary AWS access keys directly in the SDK client initialization to speed up database connection times.

Answer

To resolve the throttling, the developer must redesign the partition key schema to use a high-cardinality attribute (such as combining DeviceType and DeviceId) and configure the AWS SDK client to use exponential backoff and jitter for retries.
Redesigning the partition key schema to use a unique combination like DeviceType and DeviceId distributes writes evenly across multiple partition keys, eliminating the hot partition bottleneck. Implementing exponential backoff with jitter in the application SDK client handles transient throttling errors by spacing out retry attempts.

Step-by-Step Solution

1
Analyze the cause of the ProvisionedThroughputExceededException.
Identify that a partition key with only three values (SmartWatch, FitnessTracker, SmartScale) creates a hot partition because write requests are concentrated on too few partitions.
DynamoDB partitions are allocated throughput limits. Having a low-cardinality partition key causes individual partitions to exceed their limits, even if the total table capacity is underutilized.
2
Improve partition key cardinality.
Combine DeviceType with a unique identifier like DeviceId to create a synthetic key.
A high-cardinality key distributes write requests across a larger number of partitions, ensuring even workload distribution.
3
Configure the client application's retry logic.
Enable exponential backoff and jitter within the AWS SDK client settings.
This prevents client-side retry storms and allows the application to recover gracefully from temporary spikes in traffic.

Key Concept

DynamoDB partition throttling occurs when a low-cardinality key concentrates requests on a single partition. This is resolved by increasing partition key cardinality and implementing client-side retries with backoff and jitter.
Estimated Time:1m 30s
Rate this question