An Interest In:
Web News this Week
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
October 25, 2021 11:49 pm GMT
Original Link: https://dev.to/nosqlknowhow/how-to-identify-items-in-an-amazon-dynamodb-table-that-havent-been-accessed-for-a-time-and-move-them-to-amazon-s3-fam
How to identify items in an Amazon DynamoDB table that haven't been accessed for a time and move them to Amazon S3.
Question: How to identify items in an Amazon DynamoDB table that haven't been accessed for a time and move them to Amazon S3.
Answer: There is no built in way for DynamoDB to know which items have or have not been accessed lately. More than likely, your best option is to do the following:
Prerequisites:
- Have TTL enabled on the table and a TTL attribute on every item in the table. If not, you will have to do that first.
- If you do not already update TTL attributes on items when they are accessed, you must change your application code to update the TTL attribute on an item when you access that item. Otherwise none of this will work.
With that in place, enable DynamoDB Streams. Then create a Lambda function that watches DDB Streams specifically for TTL Deletes which reads from the table's stream, then write the expired items to S3. Here is an older blog post which should still be mostly relevant for this purpose.
Original Link: https://dev.to/nosqlknowhow/how-to-identify-items-in-an-amazon-dynamodb-table-that-havent-been-accessed-for-a-time-and-move-them-to-amazon-s3-fam
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To