Skip to content

DynamoDB TTL #101

Description

@Dnomyar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions