简体   繁体   中英

AWS Lambda in VPC accessing RDS with DynamoDB as Cache

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM