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
asked 5 years ago954 views
4 Answers
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

answered 5 years ago
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
answered 5 years ago
0

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

answered 5 years ago
0

Hello, Thanks for the answer and suggestions.

mrrizvi
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions