TTL with spring-cloud-aws-starter-dynamodb DynamoDbTemplate #874
-
Hi, I am currently migrating our service to spring-boot 3 and saw the changes made here. I saw there is a DynamoDbTemplate and the usage looks quite nice an simple in comparison to our use of the Can anybody maybe assist with an example? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Lately I was thinking about this as well. TTL of an item is based on an items attribute of your choice. For example you can create an attribute called |
Beta Was this translation helpful? Give feedback.
Lately I was thinking about this as well. TTL of an item is based on an items attribute of your choice.
For example you can create an attribute called
expirationDate
with data type long (must be epoch seconds) and populate it yourself. Then in the aws console you tell dynamodb thatexpirationDate
is your ttl attribute and it will take care of the rest.