내용으로 건너뛰기

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

질문됨 일 년 전820회 조회

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
전문가

답변함 일 년 전

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

답변함 일 년 전

전문가

검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.