Compliance

Data Retention & Erasure

Intermediate

Every piece of data has a lifespan: a time it should be kept until, and a time it must be gone by. Holding data too long is a liability and a GDPR breach. Deleting regulated data too soon is destruction of evidence. Retention is the discipline of getting both ends right, deliberately and automatically.

Two duties pull in opposite directions, and both are mandatory. GDPR's storage limitation says: do not keep personal data longer than its purpose needs. AML law says: keep KYC, transaction, and SAR records for the statutory period and never destroy evidence. The system must satisfy both. So retention cannot be ad hoc. It must be a defined policy enforced in code.

The answer is per-category retention rules, plus the right deletion method for each: hard-delete what GDPR says must go, soft-delete (never destroy) what AML says must stay. The dangerous failures are silent: data that stays forever because nothing deletes it, or regulated records hard-deleted because someone reused a generic delete path.

Define and enforce retention

Erase safely and provably

One delete path for everything public void Delete(Guid id) => db.Execute("DELETE FROM Records WHERE Id=@id", new { id });

Used for a disposable draft today, reused for a KYC record tomorrow. The AML evidence is then gone with no audit trail. Regulated records must never reach a hard-delete.

Category-aware deletion // regulated record: soft-delete, gated, audited
db.Execute("UPDATE KycRecords SET DeletedUtc=@now, DeletedBy=@u WHERE Id=@id AND TenantId=@t", ...);
audit.Record("KycRecord.SoftDelete", id, user);

The record survives for the statutory period, the action is linked to a person, and tenant scope is enforced.

Self-review checklist

Why it matters: Both failure directions are serious: over-retention breaches GDPR and grows the blast radius of any breach, while destroying AML evidence is a regulatory offence in its own right. Automatic, category-aware retention is how we satisfy two opposing legal duties without depending on anyone getting it right by hand.