By default its not possible unlike Regular Kinesis, which has max retention of 7 days, Kinesis behind DynamoDB has max retention of 24 hours and messages will be discarded after it exceeds max retry attempts and deleted after 24 hours.
So, we need to build an exception handling process, one such methods
- Create an SQS Queue with higher
MessageRetentionPeriod
(max 14 days) and set a RedrivePolicy maxReceiveCount
on no of times to retry.
- Setup
Destination on Failure
on Lambda to SQS.
- Same Lambda can be slightly modified to read either from Kinesis or from SQS or a different Lambda can be used to read from SQS.
Throw error back from Lambda when it fails to write to DocumentDb. This will send record back to Kinesis/SQS. This way we can get away up to 14 days. We can add a DLQ on SQS to another SQS too, which can send left over messages after 14 days to DLQ, with destination to a persistent storage.