How to store the Athena Query Results in DynamoDB table?

0

Hello, recently working on a project that includes querying with Athena. What I wanted to achieve is to store the Athena results in a DynamoDB table with some meta-data.

mrrizvi
질문됨 5년 전943회 조회
4개 답변
0

Hi,
One approach you can take is to run the Athena Query with the ResultConfiguration set to send the results to an S3 bucket. You can then create a lambda function that triggers on new s3 objects in this bucket and then reads in the results, adds the meta-data and then inserts the data into DynamoDB.
-randy

답변함 5년 전
0

Speaking to why I want this is I have some Webpage that includes charts and whenever a user visits that webpage some API calls happen and Athena queries run on S3 data to fetch the data and then load that result data in charts and show it to the user. The data stored in S3 changes every week so let's say within a week if any user that visits the webpage sees the same data on charts no matter how many times he/she visits the webpage. So querying again & again the same data is not a cost-effective way when we already know the output would be the same within a week. So what I wanted to do is store the results in DynamoDB table a single time with a TTL & then check that if there is data in DynamoDB then directly fetch the data & perform some other functions.

Will this be a good approach to use DynamoDB in such a use case?

mrrizvi
답변함 5년 전
0

Hi,
Yes, that sounds like a reasonable implementation for your use case.
-randy

답변함 5년 전
0

Hello, Thanks for the answer and suggestions.

mrrizvi
답변함 5년 전

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

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

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