Exam DVA-C02 All QuestionsBrowse all questions from this exam
Question 378

A company has a website that displays a daily newsletter. When a user visits the website, an AWS Lambda function processes the browser's request and queries the company's on-premises database to obtain the current newsletter. The newsletters are stored in English. The Lambda function uses the Amazon Translate TranslateText API operation to translate the newsletters, and the translation is displayed to the user.

Due to an increase in popularity, the website's response time has slowed. The database is overloaded. The company cannot change the database and needs a solution that improves the response time of the Lambda function.

Which solution meets these requirements?

    Correct Answer: B

    Caching the translated newsletters in the Lambda/tmp directory can help reduce the repeated load on the on-premises database by storing the results of translations temporarily. This approach takes advantage of the local temporary storage provided by AWS Lambda, which can be a simple but effective way to improve response times. Note that while this directory is ephemeral, meaning it is cleared when the function execution environment is recycled, it can still be useful for caching within a single execution context, potentially reducing repeated queries to the database during that time frame.

Discussion
komorebi

B. Cache the translated newsletters in the Lambda/tmp directory.

catoteja

No. Tmp directory is TEMPORAL and ephemeral