RDS Proxy + ORM for lambda

0

Hi. I would like to implement RDS proxy in our system. Currently we are using a direct connection between lambda (nodejs runtime) and the RDS MySQL database.For the current connection we are using @type/mysql I would like to know if in addition to changing the Endpoint to point to the RDS proxy, is it necessary to use an ORM like sequalize ? Is there any benefit of using RDS Proxy + ORM ?

Ref: https://aws.amazon.com/es/blogs/compute/using-amazon-rds-proxy-with-aws-lambda/

1 Answer
1
Accepted Answer

Greetings,

Thank you for contact AWS Team.

Your understanding is correct on the update of endpoint. That would be the only change required which makes the integration of RDS Proxy useful.

Now, with regards to using sequalize, it not recommended to be used as it is in Lambda as its containers based architecture. It is mentioned in their documentation as well and please go through them to get more details. [+] https://sequelize.org/docs/v6/other-topics/aws-lambda/#sequelize-connection-pooling-in-aws-lambda

On the other hand, RDS Proxy provides the required options of maintaining the connections across the containers. The best practice would be to close the connections at the end of the running code in lambda.

To summarise on adding ORM with RDS Proxy, we cannot assure on it being useful to help on performance. It would be better to first being with only RDS Proxy and test for your applications, optimize the proxy on its settings and avoid pinning and only then look at added integrations if required.

Hope this answers your query.

Thanks

AWS
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions