跳至內容

Max TTL for DynamoDB

0

Hi DynamoDB Team,

I am working on setting up a TTL for an DynamoDB Table that holds important information for accounting purposes. The recommended approach is to implement a TTL set for 10 years when creating the entries. I am curious whether there is a max epoch time value that we can put for this TTL. I would assume there is not but I just want to double check.

Thanks, Matt

已提問 1 年前檢視次數 821 次

2 個答案
2

There is no maximum time in the future that you can use as a TTL value, however there is a limit that it can't be more than 5 years in the past.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/time-to-live-ttl-before-you-start.html

AWS
專家

已回答 1 年前

0

For DynamoDB's Time To Live (TTL) feature, there is a limitation on how far in the past the TTL value can be, but there isn't a specific maximum limit mentioned for future expiration dates. According to the documentation, the TTL can't be more than five years in the past to be considered for expiry and deletion.

The TTL value must be stored in Unix epoch time format (in seconds). For example, if you set the expiration date to a specific future time like August 21st, 2024, the item will be expired after that specified time.

For your accounting data that needs to be retained for 10 years, you can set the TTL attribute to a timestamp that is 10 years in the future from when the item is created. This approach is valid and commonly used - you would calculate the expiration time by adding the desired retention period (in this case, 10 years) to the creation timestamp.

Keep in mind that TTL deletions are asynchronous and can take up to 48 hours or more after the expiration time for the actual deletion to occur. The TTL process runs roughly every six hours, but there's no guarantee on exact timing of deletions.
Sources
Computing time to live (TTL) in DynamoDB - Amazon DynamoDB
Data modeling building blocks in DynamoDB - Amazon DynamoDB
Using time to live (TTL) in DynamoDB - Amazon DynamoDB

已回答 1 年前

專家

已審閱 1 年前

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

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