From the course: AWS Certified Developer - Associate (DVA-C02) Cert Prep

Unlock this course with a free trial

Join today to access over 23,200 courses taught by industry experts.

Hands-on lab: AWS Lambda execution environment reuse

Hands-on lab: AWS Lambda execution environment reuse

- [Instructor] In this session, I will show you how to reuse the execution context in a Lambda function through a quick demonstration. And just like the last video, the objective of this demo is to reinforce the concepts that we've learned in the execution environment lifecycle video. Looking at this Lambda function code, what I have here inside the handler is a bunch of code that fetches data from a MySQL database. This piece of code here is what actually creates the connection to the database. The rest runs the query and this one just prints the result. So what I will do next is run a series of invocations to this Lambda function by clicking this test button here. What I want you to do is to pay attention to the execution duration of the Lambda function. I'm going to invoke the function now. Okay, keep track of the duration. I will run the function for the second time. Again, take note of the duration, And after that,…

Contents