2

I am planning to invoke AWS Lambda function by modifying objects on AWS S3 bucket. I also need to send a large amount of data to the AWS Lambda function. How can I send the data to it in an efficient way?

3
  • What do you mean by "send" large data? Commented Jan 4, 2016 at 7:39
  • Let's say, I will retrieve the data from the database and want to send them to lambda function. Commented Jan 4, 2016 at 7:40
  • Why not have the Lambda function retrieve the additional data from the database? Commented Jan 4, 2016 at 10:45

3 Answers 3

4

I would use another S3 bucket to first send the data and then use it from the Lambda function

Sign up to request clarification or add additional context in comments.

Comments

1

Your Lambda function should just read from the database your large data resides in.

Assuming your modified object on S3 contains - inside the object or as the object name - some type of foreign key to the data you need out of your database:

A) If your Lambda has access to the database directly: then you can just make your lambda function query your database directly to pull the data.

B) If your Lambda does not have direct access to the database: Then consider cloning the data as needed from the database to a secure S3 bucket for access by your lambda's when they are triggered/need it. Clone the data to S3 as JSON or some other easy to read format as logical objects for your business case (orders, customers, whatever). This method will be the fastest/most efficient for the Lambda if its possible for your use case.

Comments

1

I recently did this by gzipping the data before invoking the lambda function. This is super easy to do with most programming languages. Depending on your database content this will be a better or worse solution. The content of my database had a lot of data repetition and zipped very nicely.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.