Retention management for Envers audit table

Hello,

A few years ago go we used envers to have an audit log on some tables for our application.
At the time the question of “how long are we going to keep theses audit record ?” was not asked and since then the GDPR came in to play which forces us to think about it.

My first naive idea was to just drop records belonging to older revisions that have to be removed but this will eventually leave some records with no audit record linked to it.
I remember that, at the time, we had to populate the audit table with an initial snapshot of the table’s content because we had errors regarding missing initial records (even though we are not using the Validity Audit Strategy).

Therefore my question is: how can I implement a retention mechanism for audit table without breaking the application ?

1 Like