Markdown Editor

Data Retention and Deletion Standard Template (GDPR Art. 17, SP 800-88)

Retention rule method, deletion classes, standard periods, deletion per store (OLTP, Iceberg, Delta, search, logs, ML, backups), erasure propagation, evidence, sanitisation

Kỹ thuật & Quản trị dữ liệuĐầy đủGDPR Art. 5(1)(e), 17; NIST SP 800-88 Rev. 2; ISO/IEC 27555:2021retentiondeletionstandard
Mở trong editorTải .md

Cách dùng: Use it when you turn a records schedule and privacy obligations into platform deletion jobs. Fill the retention rule method and standard periods first, then the mechanics for each store you run. The main pitfall is treating a DELETE on a versioned lakehouse table as deletion while snapshots, deletion vectors and backups still hold the data.

Xem trước

Data Retention and Deletion Standard: [Organisation or platform name]

Technical standard for how long data is kept on a data platform and how it is removed: the method for writing retention rules (trigger event, period, legal basis, holds), deletion classes, standard retention periods, deletion mechanics per store (operational databases, lakehouse tables with snapshot expiry, vacuum and deletion vectors, backups, search indexes, logs and machine learning features), propagation of erasure requests under GDPR (Regulation (EU) 2016/679) Article 17, verification evidence, and media sanitisation following NIST SP 800-88 Rev. 2 (September 2025). The concepts of deletion classes and deletion rules follow the structure of ISO/IEC 27555:2021 (guidelines on PII deletion), cited by name only. Replace every [bracketed] value and every row marked Example. This is a documentation format, not legal advice.

Document control

FieldValue
Document ID[STD-RET-001]
Version[1.0]
Status[Draft / In review / Approved / Superseded]
Owner[@head-of-data-platform]
Approvers/reviewers[@dpo], [@records-manager], [@ciso], [@legal]
Stores in scope[OLTP databases, lakehouse, warehouse, search, logs, feature store, backups]
Related records schedule[compliance/iso-15489-records-schedule reference and version]
Effective dateYYYY-MM-DD
Next reviewYYYY-MM-DD
Last updatedYYYY-MM-DD
Classification[Internal]

Approvals

RoleNameDecisionDate
Standard owner[@head-of-data-platform][Approved]YYYY-MM-DD
Data protection officer[@dpo][Approved]YYYY-MM-DD
Records manager[@records-manager][Approved]YYYY-MM-DD

Revision history

VersionDateAuthorChange
0.1YYYY-MM-DD[@author]Initial draft
1.0YYYY-MM-DD[@author]Approved
1.12026-10-24[@author]Example: Rule register completed as the single source of rule IDs and periods for the ROPA, the records schedule, DPIAs and data sharing agreements; security logs split out as RET-016; metadata and column-statistics residue added for Iceberg and Delta Lake

Contents

1. Purpose, scope and principles

1.1 Purpose

This standard makes sure that data is kept only as long as a purpose or an obligation requires, that deletion happens on schedule in every copy of the data, and that [Organisation name] can prove it. It supports the storage limitation principle of GDPR Article 5(1)(e), the right to erasure in Article 17, and the time limits recorded in the record of processing activities under Article 30(1)(f) (compliance/gdpr-ropa).

1.2 Scope

All data stores that hold organisation or customer data: operational databases, event streams, the lakehouse and warehouse, derived marts, search indexes, caches, logs and traces, feature stores, model training sets, exports, backups and archives, including those operated by processors.

1.3 Principles

  1. Every dataset has a rule. No dataset is released to production without a retention rule ID in its data contract (data/data-contract).
  2. Rules are expressed as trigger plus period. Calendar dates alone are not used.
  3. Deletion means unrecoverable by normal means in every primary store, and aged out of backups within the stated backup window.
  4. Holds override deletion, and only holds do.
  5. Deletion is automated and produces evidence; manual deletion is an exception.
  6. Derived data follows its source: lineage drives propagation.

2. Roles and responsibilities

RoleResponsibilities
Data ownerApproves the retention rule for each dataset, confirms the purpose and period
Records managerMaintains the records schedule, maps record classes to retention rules
DPOConfirms legal basis and periods for personal data, oversees erasure requests
LegalIssues and releases legal holds, advises on statutory periods
Data platform team (custodian)Implements deletion jobs per store, maintains evidence, reports failures
Data producersDeclare the retention rule ID in contracts and model metadata
Privacy operationsReceives erasure requests, verifies identity, tracks completion

3. Retention rule method

3.1 Rule structure

Each retention rule has these fields:

FieldDescription
Rule IDRET-NNN
Data scopeDatasets, record classes or data categories the rule covers
Trigger eventThe event that starts the clock: record creation, last activity, contract end, account closure, transaction date, consent withdrawal
PeriodDuration after the trigger, in days, months or years
Legal basis or reasonStatute, contract, limitation period, or business purpose with justification
Deletion classClass from section 4
Action at endDelete, anonymise, aggregate, or transfer to archive
Hold behaviourWhether legal hold applies and who can apply it
OwnerData owner
Records schedule linkRecord class in the records schedule

3.2 Writing a rule

  1. Identify the purpose and any legal obligation to keep the data.
  2. Choose the trigger that best reflects when the purpose ends (for example account closure, not account creation).
  3. Set the period to the minimum that satisfies the purpose or the obligation; record the source of any statutory period.
  4. Choose the action at end. Prefer deletion; anonymisation needs a completed assessment (compliance/de-identification-assessment).
  5. Assign a deletion class.
  6. Get approval from the data owner and, for personal data, the DPO.

3.3 Rule register

Rule IDData scopeTriggerPeriodBasisClassAction
RET-001 (Example)Checkout session eventsEvent time90 daysFraud analysis and debugging purposeDC-2Delete
RET-002 (Example)Orders, sales invoices and credit notesEnd of the financial year of the transaction7 years (statutory period of [jurisdiction])Tax and accounting law of [jurisdiction]DC-4Delete
RET-003 (Example)Customer account profileAccount closure30 daysContract performance ended; grace period for reactivationDC-3Delete
RET-004 (Example)Consent records (marketing, saved checkout details)Consent withdrawal or account closure[Limitation period]Proof of consent (Art. 7(1))DC-4Delete
RET-005 (Example)Application logs with IP addressesLog time30 daysDebugging and service operationDC-2Delete
RET-006 (Example)Daily order aggregates without personal dataNot applicableIndefinite while useful, reviewed annuallyBusiness reportingDC-5Review
RET-007 (Example)Fraud features, scores and outcomesOrder date13 monthsFraud prevention, chargeback window and model retrainingDC-2Delete
RET-008 (Example)Payroll recordsEnd of the financial year of payment7 years (statutory period of [jurisdiction])Tax and social security law of [jurisdiction]DC-4Delete
RET-009 (Example)Personnel fileEnd of employment2 yearsEmployment and social security law of [jurisdiction]DC-3Delete
RET-016 (Example)Security and access logsLog time12 months (first 30 days hot, then archive)Security monitoring and incident investigationDC-2Delete
RET-017 (Example)Customer and supplier contracts, accepted termsEnd of contract6 yearsContractual claims limitation period of [jurisdiction]DC-3Review, then delete
RET-018 (Example)Security incident recordsIncident closure5 yearsTrend analysis and evidence for claimsDC-3Review, then delete
RET-019 (Example)Newsletter subscriber email and languageUnsubscribe30 daysConsent withdrawn; time to process suppressionDC-3Delete (suppression hash kept under RET-004)
RET-020 (Example)Saved checkout details (delivery address, payment token reference)Last account activity, or removal by the customer24 months of inactivity; removal takes effect at onceConsent for convenience storage, Art. 6(1)(a)DC-3Delete and revoke the token

The register is the single source of rule IDs and periods. The record of processing activities (compliance/gdpr-ropa), the records schedule (compliance/iso-15489-records-schedule), DPIAs and data sharing agreements quote the rule ID and its period exactly as written here; when a period changes, they change in the same release. Rules RET-010 to RET-015 are the platform defaults in section 5.

4. Deletion classes

ClassDescriptionTypical triggerTypical period (Example)Mechanism
DC-1Transient: in-memory, caches, staging filesCreationHours to 7 daysTTL, automatic expiry
DC-2Short-lived operational and telemetry dataEvent time30 to 90 daysPartition drop, TTL, index lifecycle
DC-3Relationship data, kept while a customer or contract is activeEnd of relationship30 days to 1 year after endScheduled deletion job keyed on status change
DC-4Statutory recordsTransaction or period endAs required by lawScheduled deletion after the statutory period, archive tier in between
DC-5Non-personal aggregates and reference dataNot applicableReviewed annuallyOwner review
DC-6Erasure on requestRequest acceptedWithin the response deadlineErasure workflow (section 8)

Rules:

  • A dataset with mixed classes is split, or takes the class of its longest-lived element only when the owner records why splitting is impractical.
  • Personal data never sits in DC-5.

5. Standard retention periods

Data categoryDefault ruleTriggerPeriod (Example)Notes
Raw ingestion landing zoneRET-010Ingestion time14 daysReplay window only
Bronze or raw lakehouse tables with personal dataRET-011Event time13 monthsYear-on-year comparison
Curated personal data in silver and goldFollows source ruleSource triggerSource periodInherited via lineage
Aggregates without personal dataRET-006Not applicableReviewed annuallyDC-5
Application logsRET-005Log time30 daysDebugging only; no archive
Security and access logsRET-016Log time12 months (first 30 days hot, then archive)See security/security-logging-standard
Data science sandboxes and extractsRET-012Creation30 daysAuto-deleted unless renewed
ML training snapshotsRET-013Model retirement6 monthsKeep for reproducibility, then delete
BackupsRET-014Backup time35 daysRolling window per backup policy
Support tickets and transcriptsRET-015Ticket closure24 monthsRedact special-category content earlier

6. Deletion mechanics per store

6.1 Operational databases (OLTP)

  • Hard delete rows by primary key, or delete by partition for time-based rules.
  • Soft-delete flags are allowed only as a short grace period ([30] days); a scheduled job then hard deletes.
  • Cascade to child tables or nullify foreign keys deliberately; check orphaned rows.
  • Run vacuum or compaction according to the engine so freed pages are reused; remember that write-ahead logs, replicas and point-in-time recovery windows still hold the data until they roll over.
  • Change data capture streams carry the delete as an event; downstream consumers must act on it.

6.2 Lakehouse tables: Apache Iceberg

Iceberg tables are versioned: each commit creates a snapshot, and old snapshots keep references to data files that contain deleted rows.

StepOperationPurpose
1DELETE or MERGE on the tableRemoves rows logically. With copy-on-write, affected data files are rewritten. With merge-on-read, the engine writes delete files instead: position or equality delete files in format v2; in format v3, new position deletes are written as deletion vectors (Puffin deletion-vector-v1 blobs), while equality delete files are still allowed (for example from streaming writers) and are applied only when compaction rewrites the data files
2Compact data files (rewrite_data_files) and rewrite position delete filesProduces new data files without the deleted rows
3Expire snapshots (expire_snapshots) older than the delete commitRemoves snapshot references to old files and deletes files no longer reachable
4Delete orphan files (remove_orphan_files)Cleans files left by failed or interrupted writes
5Check branches and tagsSnapshots referenced by a branch or tag are not expired; remove or move them

Configure snapshot retention so step 3 runs within the deletion deadline. Time travel stops working for expired snapshots, which is the intended effect.

Metadata residue: manifest files record per-file column statistics, including lower and upper bounds. With the default metrics mode (truncate(16)) the bounds of a string column such as email are real values (the first 16 characters), and they stay in manifests until snapshot expiry removes every manifest that lists the old file. For personal-data columns, set write.metadata.metrics.column.<column> to none or counts (bounds are then not persisted), or count manifest expiry in the residual window. Changing the metrics mode affects new files only; rewrite existing files to clear old bounds.

6.3 Lakehouse tables: Delta Lake

StepOperationPurpose
1DELETE, UPDATE or MERGERemoves rows logically. With deletion vectors enabled, rows are marked in a deletion vector and the Parquet file is not rewritten
2REORG TABLE <table> APPLY (PURGE)Rewrites files that contain soft-deleted rows so the rows are physically excluded
3VACUUM <table>Removes data files no longer referenced and older than the retention threshold (default 7 days)
4Transaction log and checkpoint retention (delta.logRetentionDuration, default 30 days)Log entries age out when a checkpoint is written after the retention interval. The add actions in the log and checkpoints carry file-level column statistics (minValues, maxValues), which are real values of the indexed columns, so deleted values survive in the log until it ages out

Notes: the vacuum threshold must be measured from the purge commit, not the original delete. If change data feed is enabled, its files also hold deleted values until vacuumed. Shallow and deep clones are separate copies and need their own deletion. Time travel to versions before the purge stops working once VACUUM removes their files; this is the intended effect.

Column statistics: exclude personal-data columns from statistics collection (list only non-personal columns in delta.dataSkippingStatsColumns, or order the schema so they fall outside delta.dataSkippingNumIndexedCols), or include the log retention period in the residual window. Changing these properties affects statistics written from then on; existing log entries keep their statistics until they age out.

6.4 Apache Hudi and other formats

Apache Hudi (current release line 1.2.x) keeps older file versions for time travel and incremental queries. A delete writes a new file version or, for merge-on-read tables, a log entry that compaction later merges. The cleaner service removes older file versions according to the configured cleaning policy (for example by number of commits or file versions retained), and timeline archival moves old instants out of the active timeline. Set the cleaning policy so the residual window fits the deletion deadline, and verify the configuration names against the documentation of the version you run. For any other format, record the equivalent of: logical delete, rewrite, removal of unreferenced files, and metadata history expiry.

6.5 Warehouses and marts

  • Rebuild derived models from cleaned sources; incremental dbt models need an explicit delete step or a periodic full refresh.
  • Warehouse time travel and fail-safe features keep data for a set period after deletion: record that period here: [N days].
  • Snapshots (slowly changing dimension history) must apply erasure to historical rows, not only the current row.

6.6 Search indexes and caches

  • Delete documents by ID; force merge or segment rewrite so deleted documents leave disk ([schedule]).
  • Use index lifecycle policies for time-based rules (DC-2).
  • Caches use TTLs no longer than the class period; invalidate on erasure.

6.7 Logs, traces and observability

  • Avoid personal data in logs by design (security/security-logging-standard).
  • Apply retention at the log platform by index or bucket lifecycle.
  • Erasure requests do not usually require editing immutable security logs; document that position, the basis and the retention period.

6.8 Machine learning features and models

  • Feature store tables follow source rules; online stores need TTLs.
  • Training sets are snapshots: record which rule applies and delete at the end of the period.
  • Where a model was trained on data later erased, record whether retraining is required, using the risk assessment in the model documentation (ai-data/model-card).
  • Embeddings and vector indexes of personal content are deleted with the source document.

6.9 Backups and archives

  • Backups are not edited to remove single records. They age out on the rolling window in ops/backup-policy (RET-014).
  • On restore, replay the erasure log (section 8.4) before the restored system goes live, so erased records do not reappear.
  • Archives under DC-4 are deleted at the end of the statutory period by a scheduled job with evidence.

6.10 Store register

StoreEngine and versionDelete mechanismPhysical purge jobResidual windowOwner
Orders OLTP (Example)[PostgreSQL version]Hard delete by keyAutovacuum; PITR window 7 days7 days[@orders-platform]
Lakehouse orders namespace (Example)Apache Iceberg [library version], format v3Merge-on-read delete with deletion vectors; metrics mode none on personal-data columnsNightly compaction, expire snapshots older than 7 days, weekly orphan cleanup8 days (1 day to compaction plus 7 days to snapshot expiry)[@data-platform]
Search (Example)[Engine and version]Delete by IDWeekly force merge7 days[@search-team]
Backups (Example)[Backup system]Age outRolling deletion35 days[@infra]

7. Legal holds and suspension

  • Legal issues holds through the hold register with scope, reason, start date and review date.
  • Deletion jobs check the hold register before deleting and skip held data, logging each skip.
  • Holds are reviewed [quarterly]; on release, deletion resumes and any overdue data is deleted within [30] days.
  • Erasure requests for held data are answered with the reason for restriction, as advised by Legal.
Hold IDScopeReasonIssued byStartReviewStatus
HOLD-001 (Example)Orders for merchant M-4471, 2025Commercial dispute[@legal]YYYY-MM-DDYYYY-MM-DDActive

8. Erasure request propagation

8.1 Workflow

The sequence below shows one request from receipt to response. Each store completes its own ticket and returns evidence before the response is sent.

8.2 Resolving the subject

  • Map the request to stable subject keys (customer ID, email hash, device IDs) through an identity resolution table.
  • Use lineage (for example OpenLineage events or the catalogue) to list every dataset containing those keys or derived from them.
  • Include free-text stores (tickets, chat logs) by search.

8.3 Execution

  • Batch erasure requests per store per day to limit rewrite cost on lakehouse tables.
  • The physical purge deadline (sections 6.2 and 6.3) must fall inside the response deadline.
  • Where data is kept under an exception (for example statutory invoices), restrict processing and record the reason.

8.4 Erasure log

Keep a minimal erasure log (subject key hash, request ID, date, stores completed) so erasure can be reapplied after a backup restore. The log itself holds no more personal data than necessary and has its own retention rule.

Request IDReceivedStoresExceptions appliedCompletedRecipients notified
ER-2026-0142 (Example)YYYY-MM-DDOLTP, lakehouse orders, search, CRMInvoices kept under RET-002YYYY-MM-DDEmail service provider, payment processor

9. Verification and deletion evidence

EvidenceProduced byRetained for
Deletion job run log with rule ID, row or file counts and statusPlatform jobs[2 years]
Post-deletion verification query returning zero rows for the deleted keys or periodsPlatform jobs[2 years]
Snapshot expiry and vacuum logs showing removed filesLakehouse maintenance[2 years]
Erasure ticket closure with stores completedPrivacy operations[Per erasure log rule]
Media sanitisation record (section 10)Infrastructure or disposal vendor[Per records schedule]
Deletion certificate for processors and suppliersProcessor[Contract term plus limitation period]

Verification rules:

  • Run a verification query per store after each purge cycle; failures open an incident with severity per ops/incident-severity-matrix (SEV3 by default, SEV2 if personal data is overdue by more than the response deadline).
  • Sample [5] percent of erasure requests each quarter for end-to-end testing across stores, including a restore test.

10. Media sanitisation

  • Choose the sanitisation method (Rev. 2 section 3.1) per media and classification: Clear (logical techniques against simple, non-invasive recovery through the normal interface), Purge (recovery infeasible with state-of-the-art laboratory techniques, media possibly reusable) or Destroy (as Purge, media no longer usable; not applicable to logical or virtual storage). Cryptographic erase is a purge technique where encryption was enabled from first use and keys are managed properly. See IEEE 2883 for media-specific techniques.
  • Restricted data media: Purge or Destroy.
  • Cloud storage: rely on the provider's documented sanitisation attestations and on cryptographic erase of customer-managed keys.
  • Keep a sanitisation record for each item: media identifier, data classification, method, tool, operator, verification result and date.
  • Vendors performing destruction provide a certificate per batch.
Record IDMediaClassificationMethodVerifiedDate
SAN-001 (Example)12 NVMe drives from decommissioned database hostsRestrictedPurge (cryptographic erase) then DestroyYes, vendor certificateYYYY-MM-DD

11. Exceptions and monitoring

Exception IDRuleStoreReasonCompensating controlExpiry
EXC-RET-001 (Example)RET-011Legacy warehouseMigration in progressAccess restricted to two engineers, monthly manual purgeYYYY-MM-DD
Metric IDMetricTarget (Example)
RET-M-01Datasets with a retention rule ID100 percent
RET-M-02Data older than rule period plus residual window0 rows
RET-M-03Erasure requests completed within deadline100 percent
RET-M-04Deletion jobs failed and not rerun within 48 hours0
RET-M-05Open retention exceptions past expiry0

12. Traceability matrix

ObligationSectionImplementationEvidence
GDPR Art. 5(1)(e) storage limitation3, 5Retention rules RET-NNNRule register, verification queries
GDPR Art. 17 right to erasure8Erasure workflowErasure log
GDPR Art. 19 notification to recipients8.1Recipient notification stepConfirmations
GDPR Art. 30(1)(f) time limits in ROPA3.3Rule IDs referenced in ROPAROPA entries
ISO/IEC 27555:2021 deletion classes and rules3, 4Deletion classes DC-1 to DC-6Rule register
NIST SP 800-88 Rev. 2 media sanitisation10Sanitisation recordsSAN records, certificates
Records schedule3Rule to record class mappingcompliance/iso-15489-records-schedule

13. Glossary and references

13.1 Glossary

TermMeaning
Retention ruleTrigger, period, basis and action for a data scope
Trigger eventEvent that starts the retention period
Deletion classGroup of data sharing a trigger type, period and mechanism
Logical deleteRemoval from query results while bytes remain in storage
Metadata residueValues of deleted rows kept in table metadata, such as column bounds in Iceberg manifests or minValues and maxValues in the Delta log
Physical purgeRemoval of the bytes from all live files in a store
Residual windowMaximum time between logical delete and physical purge
Deletion vectorMarker of deleted row positions for a data file, used by Delta Lake and by Iceberg format v3
Legal holdInstruction suspending deletion for a defined scope

13.2 References

ReferenceVersion or dateUse
Regulation (EU) 2016/679 (GDPR)Check the consolidated textArticles 5, 12, 17, 19, 30
ISO/IEC 27555:2021, Guidelines on personally identifiable information deletionEdition 1, 2021-10Deletion class and rule concepts, by name only
NIST SP 800-88 Rev. 2, Guidelines for Media SanitizationSeptember 2025, supersedes Rev. 1Section 10
Apache Iceberg table specification, configuration and maintenance docsFormat v3; library 1.12.0Section 6.2, metrics modes
Delta Lake protocol and documentation (deletion vectors, table utility commands, table properties)Delta Lake 4.4.1; check the version you runSection 6.3, column statistics
IEEE 2883, Standard for Sanitizing StorageCheck the current editionMedia-specific sanitisation techniques
Data Classification Policydata/data-classification-policyLevels and flags

Standard and licence note

Based on Regulation (EU) 2016/679 (GDPR) and NIST SP 800-88 Rev. 2 (September 2025), with structure aligned with ISO/IEC 27555:2021, which is cited by name only; no ISO text, tables or definitions are reproduced. Lakehouse mechanics refer to the Apache Iceberg specification and the Delta Lake documentation (Apache-2.0 projects), described in original wording. NIST publications are US government works and EU legislation is free to reuse. All text and examples are original and use a fictional organisation. Check the current official versions, the consolidated GDPR text and the documentation of the engine versions you run before use. This is a documentation format, not legal advice. Template licence: MIT.

Template liên quan