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 ?

preguntada hace un año457 visualizaciones
2 Respuestas
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.

respondido hace un año
  • 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
EXPERTO
respondido hace un año
profile pictureAWS
EXPERTO
kentrad
revisado hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas