Skip to content
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

DynamoDB TTL #101

Open
Dnomyar opened this issue Oct 15, 2021 · 0 comments
Open

DynamoDB TTL #101

Dnomyar opened this issue Oct 15, 2021 · 0 comments

Comments

@Dnomyar
Copy link

Dnomyar commented Oct 15, 2021

Short description

Add feature to allow to expire DynamoDB items.

Details

DynamoDB has the feature that allow to expire an item based on a field value. In a nutshell, if the today > than the date specified in the item, the item is eventually going to get delete by DynamoDB. It is useful to handle the data retention.

I suggest having a configuration at the table level. It would contain:

  • the field name that need to be specified when the dynamo TTL feature is turned on.
  • the ttl that would specify the delay for the item to be deleted.
my-dynamodb-journal { // also available for snapshots tables
  dynamodb-item-ttl-config {
    field-name = "expiresAt" // in the AWS UI, we need to set the field name https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/time-to-live-ttl-how-to.html
    ttl = 30d
  }
}

Then, for each insertion in the journal and snapshot, a new field would be added: expiresAt -> now + 30d.
This configuration is optional. The field would only be added if the field-name and ttl are defined.

What do you think about this approach?

Screenshot 2021-10-11 at 16 48 50

I also have a suggestion of implementation #99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant