aws-lambdaamazon-rdsamazon-auroraamazon-rds-proxy

AWS Lambda and RDS Aurora Integration - How to handle open connections?


I have an API gateway in order to expose services, using lambda integration(Python 3.6) and I need to integrate lambda with RDS Aurora MySQL.

As far as I know, lambdas are stateless, that means I cannot save the status of all the open connections within lambda. So my question is....if I have a limit of 100 opened connections in my database, should I control the list of opened connections from lambda, or opening and closing connections after executing queries would be enough?

What is the best practice in this scenario? I wanted to use RDS proxy, but It is on preview for now. Also, I read about some limitations with Aurora serverless, so right now I am using DB instances.


Solution

  • The best practice is to use a database proxy. RDS Proxy is out of preview.