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, yo…


This content originally appeared on DEV Community and was authored by Kirk Kirkconnell

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:

  1. 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.
  2. 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.


This content originally appeared on DEV Community and was authored by Kirk Kirkconnell


Print Share Comment Cite Upload Translate Updates
APA

Kirk Kirkconnell | Sciencx (2021-10-25T23:49:55+00:00) How to identify items in an Amazon DynamoDB table that haven’t been accessed for a time and move them to Amazon S3.. Retrieved from https://www.scien.cx/2021/10/25/how-to-identify-items-in-an-amazon-dynamodb-table-that-havent-been-accessed-for-a-time-and-move-them-to-amazon-s3/

MLA
" » How to identify items in an Amazon DynamoDB table that haven’t been accessed for a time and move them to Amazon S3.." Kirk Kirkconnell | Sciencx - Monday October 25, 2021, https://www.scien.cx/2021/10/25/how-to-identify-items-in-an-amazon-dynamodb-table-that-havent-been-accessed-for-a-time-and-move-them-to-amazon-s3/
HARVARD
Kirk Kirkconnell | Sciencx Monday October 25, 2021 » How to identify items in an Amazon DynamoDB table that haven’t been accessed for a time and move them to Amazon S3.., viewed ,<https://www.scien.cx/2021/10/25/how-to-identify-items-in-an-amazon-dynamodb-table-that-havent-been-accessed-for-a-time-and-move-them-to-amazon-s3/>
VANCOUVER
Kirk Kirkconnell | Sciencx - » How to identify items in an Amazon DynamoDB table that haven’t been accessed for a time and move them to Amazon S3.. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/10/25/how-to-identify-items-in-an-amazon-dynamodb-table-that-havent-been-accessed-for-a-time-and-move-them-to-amazon-s3/
CHICAGO
" » How to identify items in an Amazon DynamoDB table that haven’t been accessed for a time and move them to Amazon S3.." Kirk Kirkconnell | Sciencx - Accessed . https://www.scien.cx/2021/10/25/how-to-identify-items-in-an-amazon-dynamodb-table-that-havent-been-accessed-for-a-time-and-move-them-to-amazon-s3/
IEEE
" » How to identify items in an Amazon DynamoDB table that haven’t been accessed for a time and move them to Amazon S3.." Kirk Kirkconnell | Sciencx [Online]. Available: https://www.scien.cx/2021/10/25/how-to-identify-items-in-an-amazon-dynamodb-table-that-havent-been-accessed-for-a-time-and-move-them-to-amazon-s3/. [Accessed: ]
rf:citation
» How to identify items in an Amazon DynamoDB table that haven’t been accessed for a time and move them to Amazon S3. | Kirk Kirkconnell | Sciencx | https://www.scien.cx/2021/10/25/how-to-identify-items-in-an-amazon-dynamodb-table-that-havent-been-accessed-for-a-time-and-move-them-to-amazon-s3/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.