Hey, Thank you very much for the post!
I had a quick question - Considering lambdas are short lived (3 or 5 mins if I am not wrong) - do we benefit from keeping a ConnectionPool?
Once the lambda lifecycle ends, would we not need to create this connection pool again?
If we keep creating this connection pool, isn't the purpose of pooling defeated?
Software engineer with 4+ years of experience in building products for numerous domains like fin-tech, real estate, video streaming, retail, and now e-commerce.
Hey, Thank you very much for the post!
I had a quick question - Considering lambdas are short lived (3 or 5 mins if I am not wrong) - do we benefit from keeping a ConnectionPool?
Once the lambda lifecycle ends, would we not need to create this connection pool again?
If we keep creating this connection pool, isn't the purpose of pooling defeated?
Thanks!
Hi Anirudh, if we create a connection pool for each lambda then we're not reusing pool code. For code reusability, I have defined dbConfig.js file.