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.
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?
Yes, that sounds like a reasonable implementation for your use case.
Hello, Thanks for the answer and suggestions.
Unable to query dynamodb table in Athena using DynamoDB ConnectorAccepted Answer
Amazon Athena error on querying DynamoDB exported dataasked 5 months ago
How to query DynamoDB nested elements from AthenaAccepted Answer
How to download encrypted Athena query results in readable formatasked 8 days ago
Querying rows containing GZipped and Base64 encoded string in Athenaasked a month ago
When querying athena using aws sdk, is it necessary to save results in s3?Accepted Answerasked 5 months ago
Query DynamoDB Backup to S3 with AthenaAccepted Answerasked 3 months ago
Next Steps in Athena Based Projectasked 3 months ago
How to store the Athena Query Results in DynamoDB table?asked 3 years ago
INVALID_INPUT in Athena Queryasked 10 months ago