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 年前檢視次數 952 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南