Question #586
An application is processing clickstream data using Amazon Kinesis Data Streams. The data is sent using the PutRecord API, which occasionally fails with a ProvisionedThroughputExceededException. The logs indicate the error message: 'Rate exceeded for shard shardId-000000000003 in stream exampleStream under account 123456789.' Which techniques will help mitigate this exception? (Choose two.)
Implement retries with exponential backoff.
Switch to using the PutRecords API for batch writes.
Decrease the size of each record and space out requests.
Replace Kinesis with Amazon SQS for message processing.
Increase the number of KCL consumers.
Explanation
The ProvisionedThroughputExceededException occurs when a shard's write capacity (1,000 records/sec or 1 MB/sec) is exceeded.
- A: Implement retries with exponential backoff helps recover from transient throttling by retrying failed requests with increasing delays, aligning with AWS best practices.
- C: Decrease record size and space out requests ensures the shard's throughput limits are not breached, as smaller records reduce MB/sec usage, and spaced requests avoid spikes.
Other options:
- B: PutRecords API batches writes but does not inherently resolve shard-level throughput limits if the total data/records still exceed capacity.
- D: Replacing Kinesis with SQS changes the service's purpose (streaming vs. queuing) and is not a direct fix.
- E: Increasing KCL consumers affects read throughput, not write capacity.
Key Points: Kinesis shard write limits, retry strategies, and optimizing record size/throughput are critical for handling this exception.
Answer
The correct answer is: AC