Question

Difficulty: EasyResolving DynamoDB Throttling and Key Distribution Issues

An HR management application named StaffSync records employee clock-in and clock-out events to an Amazon DynamoDB table. During the start of a morning shift, hundreds of employees clock in at the exact same minute. The application code makes direct write requests using a custom HTTP client without retry logic. This results in unhandled ProvisionedThroughputExceededException errors and application crashes, even though the table's total provisioned write capacity is not fully exhausted.

Which of the following is the most effective developer-centric solution to resolve these application crashes during brief write spikes?

  1. Configure the client application to retry failed writes using the AWS SDK's built-in retry mechanism with exponential backoff and jitter.Answer
  2. B
    Increase the DynamoDB table's overall provisioned Write Capacity Units (WCUs) to handle the short-lived spikes.
  3. C
    Perform a DynamoDB Scan operation before each write to verify if the employee has already clocked in for the day.
  4. D
    Configure a larger Amazon SQS visibility timeout on the DynamoDB table to queue the write requests automatically.

Answer

Configure the client application to retry failed writes using the AWS SDK's built-in retry mechanism with exponential backoff and jitter.
The correct option is to configure the client application to retry failed writes using the AWS SDK's built-in retry mechanism with exponential backoff and jitter. When DynamoDB throws a ProvisionedThroughputExceededException, it is often a transient error due to a brief spike in traffic. Implementing client-side retries with exponential backoff and jitter allows the client to pause, back off, and retry the request, which successfully handles the throttling event without requiring database schema changes or capacity increases.

Step-by-Step Solution

1
Identify the cause of the application failures.
The application crashes due to ProvisionedThroughputExceededException errors from transient burst traffic without any retry handling.
Understanding the transient nature of the spike explains why the client-side configuration needs adjustment rather than database re-provisioning.
2
Implement the retry strategy in the client code.
The client application automatically pauses and retries requests when throttled, spacing them out using exponential backoff and jitter.
This prevents the client from overwhelming the database with immediate retries and allows transient traffic spikes to clear.

Key Concept

Handling ProvisionedThroughputExceededException with Client-Side Retry Policies
Rate this question