-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set TTL attribute when soft-delete a sync item #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just the comment around the business effects around deleting items forever.
// items automatically by dynamoDB. | ||
if *entity.Deleted { | ||
update = update.Set(expression.Name(ttlAttrName), expression.Value(time.Now().Add(ttl).Unix())) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means we will delete this forever, and will not be recoverable. I would suggest we create a cold storage s3 bucket where these soft deleted expired items exist. Or we need clear expectations to the users that soft delete means it will be deleted forever after 90 days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point, will create an issue and kick-off a follow up discussion on this with @jsecretan and @hspencer77, we could definitely explore more options regarding the actions we want to take after this expired on dynamo, code would stay the same for go-sync here so merging.
Revert "Merge pull request #22 from brave/ttl"
Fix #21