4 ms·
Declare your connection outside of your handler function - this post is from 2017 but it shows it clearly: https://www.jeremydaly.com/reuse-database-connection
by josevalerio 3y ago
Declare your connection outside of your handler function - this post is from 2017 but it shows it clearly:
https://www.jeremydaly.com/reuse-database-connections-aws-lambda/ https://www.jeremydaly.com/reuse-database-connections-aws-la...
It will get re-used across lambda invocations as long as the instance of it isn't killed which typically happens after a few minutes