Deleting data from DynamoDb table automatically

Is there any concept of a life saving period in DynamoDB.

I mean, is there a way for the data inside the table to be deleted after a while, since we can set some storage period in S3.

Thanks,

+6
source share
2 answers

No, there are no save settings in DynamoDB.

You can run a daily / monthly query that uses the date field to filter the results, and use this output to determine which items will be deleted. This should be implemented in your own code.

Some users prefer to use separate tables for aging. For example, create a separate table for each month. Then delete the old tables when they reach a certain age. However, your software must know how to handle multiple data tables.

Examples:

+4
source

DynamoDB introduced the Time to Live (TTL) feature. You can create a numeric field and set the value to β€œtime in seconds” (from the era) when you want the record to be deleted.

DynamoDB will automatically delete the record at the specified time. Of course, TTL must be configured for each table.

You can find out more: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/time-to-live-ttl-how-to.html

+3
source

Source: https://habr.com/ru/post/989320/


All Articles