Reputation: 3406
I want to ask a possible fault in this design:
I have AWS Lambda in VPC which accesses RDS. It's pretty slow because of the cold starts (large part of it because of accessing RDS as lambda would have to create ENI)
Now, what if I present DynamoDB before accessing RDS? if there's no record in dynamodb, I'll access RDS in the next step.
Will this improve the overall performance of the system?
Thanks
Upvotes: 0
Views: 578
Reputation: 269881
If your AWS Lambda function is attached to an Amazon VPC, then the warmup time required to attach the ENI would still be required whether accessing Amazon RDS, Amazon DynamoDB or Amazon ElastiCache. They all require a connection to the VPC, even if it is just to gain Internet access.
If you used DynamoDB exclusively (without Amazon RDS), you could choose to not attach the Lambda function to the VPC and this would reduce the warmup time.
See: How to manage Lambda VPC cold starts and deal with that killer latency
Upvotes: 1