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
asked 7 months ago238 views
1 Answer
1
Accepted Answer

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
answered 7 months ago
profile pictureAWS
EXPERT
reviewed 7 months ago
profile pictureAWS
EXPERT
reviewed 7 months ago
  • Thank you sir! Ttl is exactly what I needed

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions