Evaluating RDS Proxy for Lambda functions performing queries on Aurora RDS Serverless v2 database

0

Hi,

We are using Lambda functions for our REST API. Those lambda functions performs queries on our Aurora RDS Serverless v2 database. We have read that an RDS Proxy is advised so that we can take advantage of connection pooling and not overload the database with hundreds of connections. However, our Senior Engineer have a question that we couldn't answer. We are hoping someone might have a clue on how. Thanks in advance :)

  • Is RDS Proxy really necessary? Since the database is on Aurora Serverless, wouldn't the automatic scaling handle the increase in connections?

  • Can we skip the RDS proxy if we make sure that the lambda code properly manages and closes the connections?

  • What is the reason why 200 connections per second is the threshold for IAM authentication as per this piece of documentation? https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html?

asked 19 days ago477 views
1 Answer
1
Accepted Answer

Hello.

Is RDS Proxy really necessary? Since the database is on Aurora Serverless, wouldn't the automatic scaling handle the increase in connections?

I don't think the number of connections to the database will scale automatically.
I think that by default, the number of connections calculated from the memory usage rate set in the maximum ACU is applied.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.setting-capacity.html#aurora-serverless-v2.parameters-based-on-max-capacity

When Aurora Serverless v2 evaluates the formula, it uses the memory size based on the maximum Aurora capacity units (ACUs) for the DB instance, not the current ACU value. If you change the default value, we recommend using a variation of the formula instead of specifying a constant value. That way, Aurora Serverless v2 can use an appropriate setting based on the maximum capacity.

Can we skip the RDS proxy if we make sure that the lambda code properly manages and closes the connections?

I think it depends on how you use Lambda, but for example, if you are using it in a way where processes are executed simultaneously, the number of connections should increase, so I think there is an advantage to using RDS Proxy.

What is the reason why 200 connections per second is the threshold for IAM authentication as per this piece of documentation?

I think this is probably a restriction to avoid throttling errors in IAM processing.
IAM itself is managed by AWS, but if multiple AWS users send a large number of requests to IAM, it is inevitable that errors will occur due to the load.
I suspect that this is why there are restrictions in place.
https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/control-planes-and-data-planes.html

profile picture
EXPERT
answered 19 days 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