Assumption:
lets assume rate of data insertion into DynamoDB is huge.
Context:
Streams are enabled on DynamoDB table and this will trigger lambda. The lambda reads the streamed record and indexes the record in elastic search.
Problem statement:
There is a delay between the time that record got inserted into DynamoDB and the time lambda got triggered through streamed record. This delay or lag kept increasing and is directly proportional to the amount of data getting inserted into dynamoDB.
How to find where the lag is? Is it the stream is not immediately triggering the lambda? or as there are huge dynamo writes the stream is getting hampered? or is there any limit that lambda could not be hit for certain number of times in a given second?
I couldn't understand where the issue is because I could not even see whether currently the streams still contains records OR the records in streams have already been delivered but lambda trigger is the lag?
Example delay: We did huge writes yesterday and we are seeing those records hitting the lambda today! incredible delay! :)
Any suggestions please?