Joy
Joy

Reputation: 4511

Processing S3 events in order with Lambda

I am setting up an S3 bucket. In this S3 bucket, data is going to be written by an external process.

I am setting up an AWS Lambda that would be triggered when an object in S3 gets created/updated and would process and store the data in RDS.

Here my question is as follows:

If objects get written too fast on s3, there is a possibility for multiple Lambda functions to get triggered simulatenously.

So, in this case, is there any chance for the objects to be processed not in the order they are written to the S3 bucket?

If the answer to the above question is yes, then with Lambda, I have to push the payload to FIFO SQS and set up a listener to process the payload to store the data into RDS finally.

Upvotes: 1

Views: 1979

Answers (1)

Marcin
Marcin

Reputation: 238957

Sadly, they are not guaranteed to be in order. From docs:

Event notifications are not guaranteed to arrive in the order that the events occurred. However, notifications from events that create objects (PUTs) and delete objects contain a sequencer, which can be used to determine the order of events for a given object key.

Upvotes: 4

Related Questions