Cache table data for Lambda Processing

0

Hello All,

I have use case where in I have table in AWS postgres database . This is configuration table ( few rows even less than 100 ) and data stored in this table will be used by lambda for some processing . Now lambda has to run multiple times so I don't want it to go and read the table every time from database . Is there a way to cache the table data (apart from Redis option) for lambda processing . I was going through AWS extension https://github.com/aws-samples/aws-lambda-extensions/tree/main/cache-extension-demo but here in config file dynamoDB is mentioned . What do I need to mention for RDS . Can we even use it for my use case ? Does Anyone has working example .

Is there any other way we can resolve this ?

已提问 1 年前457 查看次数
2 回答
0

Hello, I was thinking that you might just capture that config data into a JSON file in your /tmp directory - like /tmp/config.json

Then your Lambda function would first check for the existence of that file before it queries the database. Would that work for your use case? As long as the Lambda is being warm started, I believe the /tmp folder will remain intact on the next invocation.

已回答 1 年前
  • Hello @patrick but data in config file can change so I want to use new changed data without any deployment effort.

0

Hi,

I see a few options, of course depending on your case.

Hope it helps!

profile picture
专家
已回答 1 年前
profile pictureAWS
专家
kentrad
已审核 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则