1
votes

I have a data migration job running in AWS that is sending data to a Kinesis Stream and a Lambda function that acts as a consumer that is writing the data to DynamoDB (I set the kinesis as a trigger to lambda).

My problem comes when the Kinesis Stream starts to hit:

Write Throughput Exceeded (Count / Request) — Average - WriteProvisionedThroughputExceeded

and I see 200 or 300 counts on spikes on that chart even when the lambda consumer never stops reading data and writing data to the DDB table, but once the migration process is done (there are no more information to be sent to the kinesis) I noted there are some missing records (the lambda consumer never failed), my question is: Is data lost when AWS Kinesis Stream returns "ProvisionedThroughputExceededException"? That data won't ever be sent to the kinesis consumer?

1

1 Answers

6
votes

You are right, throttled calls are not processed by Kinesis; your data will be dropped by Kinesis:

If a PutRecord request cannot be processed because of insufficient provisioned throughput on the shard involved in the request, PutRecord throws ProvisionedThroughputExceededException.

To avoid this, you should retry your PutRecord(s) call using (preferably) exponential backoff:

Throttled requests should be retried automatically after a short delay, using an exponential backoff strategy.