Purging data from DynamoDB

0

I loaded a massive database but now I need to purge the data so I can retest my load process. Currently I am dropping g the table and the-adding it but this takes time. Is the a better way to handle?

Awsdev
已提問 8 個月前檢視次數 258 次
1 個回答
1
已接受的答案

The best way to delete data is to utilize the time to live (TTL) feature in dynamoDB. Once enabled at the table level, you specify a field to hold the numeric value to expire the data. This numeric field is the epoch date time. Once this date time is in the past, AWS (within a day or so) will automatically remove this data (at no extra charge). With this in place, you will not need to drop and rebuild the table, but you will need to manage this TTL attribute.

Another option is to use infrastructure as code (such as CDK, CloudFormation templates, etc), to rename this table which will drop and establish a new table.

profile picture
已回答 8 個月前
profile pictureAWS
專家
已審閱 8 個月前
profile pictureAWS
專家
已審閱 8 個月前
  • Thank you sir! Ttl is exactly what I needed

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南