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 ?

질문됨 일 년 전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.

답변함 일 년 전
  • 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
전문가
답변함 일 년 전
profile pictureAWS
전문가
kentrad
검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠