简体   繁体   English

VPC中的AWS Lambda使用DynamoDB作为缓存访问RDS

[英]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. 我在访问RDS的VPC中有AWS Lambda。 It's pretty slow because of the cold starts (large part of it because of accessing RDS as lambda would have to create ENI) 由于冷启动,它相当慢(很大一部分是因为访问RDS,因为lambda必须创建ENI)

Now, what if I present DynamoDB before accessing RDS? 现在,如果在访问RDS之前显示DynamoDB怎么办? if there's no record in dynamodb, I'll access RDS in the next step. 如果dynamodb中没有记录,我将在下一步中访问RDS。

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. 如果您的AWS Lambda函数已附加到Amazon VPC ,则无论访问Amazon RDS,Amazon DynamoDB还是Amazon ElastiCache,仍然需要附加ENI所需的预热时间。 They all require a connection to the VPC, even if it is just to gain Internet access. 它们都需要连接到VPC,即使只是为了获得Internet访问权限也是如此。

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. 如果仅使用DynamoDB(不使用Amazon RDS),则可以选择将Lambda函数附加到VPC,这将减少预热时间。

See: How to manage Lambda VPC cold starts and deal with that killer latency 请参阅: 如何管理Lambda VPC冷启动并处理该致命延迟

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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