Thank you for your question! Since we are incorporating our MongoClient outside of our `lambda_handler` to establish our connection, Lambda will reuse this instance. For a more in-depth and step-by-step view of this tutorial, please check out our written article with code examples here: mdb.link/article--ZSKyLspT3Q
Thank you for the tutorial! Could you explain why it takes so long to fetch data? Half a second is too long for my use case, I would love to hear a solution for that.
You're welcome! Yeah, there can actually be a number of reasons for this...the ones off the top of my head for this specific tutorial are: starting up the connection after not using it for a while (a cold start), making sure your MongoDB cluster is in the same region as your lambda function, and personal code optimization (for the sake of the tutorial I didn't optimize my code as well as I should have, but I wanted to ensure watchers understand what's happening step by step). Hopefully some of these reasons can help you out with your use case. :)
✅ Sign-up for a free cluster at → mdb.link/free--ZSKyLspT3Q
✅ Written article with code samples → mdb.link/article--ZSKyLspT3Q
seems too easy the way she is doing
Great video!
the best tutorial, thank you
Wow! This is exactly the tutorial I was looking for, thank you! Wonderfully made.
Glad it was helpful!
you took the words out of my mouth!
for every request will it be creating new connections? How can we efficiently handle connections?
Thank you for your question! Since we are incorporating our MongoClient outside of our `lambda_handler` to establish our connection, Lambda will reuse this instance. For a more in-depth and step-by-step view of this tutorial, please check out our written article with code examples here: mdb.link/article--ZSKyLspT3Q
Thank you for the tutorial! Could you explain why it takes so long to fetch data? Half a second is too long for my use case, I would love to hear a solution for that.
You're welcome! Yeah, there can actually be a number of reasons for this...the ones off the top of my head for this specific tutorial are: starting up the connection after not using it for a while (a cold start), making sure your MongoDB cluster is in the same region as your lambda function, and personal code optimization (for the sake of the tutorial I didn't optimize my code as well as I should have, but I wanted to ensure watchers understand what's happening step by step).
Hopefully some of these reasons can help you out with your use case. :)
I love this
Security open? :/