Retention rules and deletion jobs are the two parts of storage limitation in software. A retention rule defines how long a category of personal data may be kept and which event starts the clock. A deletion job is a scheduled process that finds records past their rule and removes or anonymises them, including copies held in backups and integrations.
Key takeaways
- A retention rule ties each data category to a purpose and to a defined end event, so deletion has a clear trigger.
- A deletion job applies those rules on a schedule and writes an audit record of what it removed.
- Backups, replicas, integrations and analytics copies are where deletion most often fails.
- Test every deletion job on non-production data before it runs against live records.
What does storage limitation require from business software?
Storage limitation requires that personal data is kept only for as long as the purpose it was collected for still needs it. Software must therefore know the purpose, recognise when that purpose has ended and act on it without manual intervention.
The principle appears in Article 5(1)(e) of the GDPR, which requires personal data to be kept in a form that permits identification of individuals for no longer than is necessary for the purposes of the processing. The official text is available on EUR-Lex. This article is general information and not legal or tax advice.
Storage limitation is a design property rather than a policy document. A retention schedule that exists only in a spreadsheet does nothing when a customer record sits untouched in a database for years. The software has to carry the rule, enforce it and leave evidence that it did.
How do you write a retention rule?
A retention rule has three parts: a data category, a retention period tied to a trigger event, and a disposal action. If any of the three is missing, the rule cannot be executed by a machine and will drift into manual practice.
Define the data category narrowly
Rules attached to vague categories such as customer data cannot be applied reliably. Split the data by the purpose it serves, for example quote requests, signed contracts, support tickets and payroll records, because each may have a different end point.
Choose a trigger event the system can observe
The clock should start on an event the database records, such as a ticket being closed, an account being terminated or a contract ending. Triggers based on judgement, such as the project no longer being relevant, cannot be queried and will never fire automatically.
Record exceptions explicitly
Legal holds, ongoing disputes and statutory archiving duties override normal periods. Model them as a flag on the record with an owner and a reason, so the deletion job skips the record and the exception can be reviewed later.
- Each data category has an owner who approved the period.
- Each rule names one trigger event that exists in the data model.
- Each rule names one disposal action: delete, anonymise or archive.
- Each exception has a reason, an owner and an expiry review date.
How should a deletion job be designed?
A deletion job selects the records whose rule has expired, performs the disposal action, and writes an audit entry for each batch. It should be repeatable, so running it twice does not cause a second round of damage.
Write the selection query from the rule
The selection should be generated from the rule definition, not hand-written per table. This keeps the schedule and the documented policy identical, which makes an audit far easier to answer.
Use dry runs and batch limits
A dry run lists the records that would be affected without changing them. Batch limits stop a logic error from removing an entire table in one transaction, and they make it possible to halt the job midway.
Keep an audit trail without keeping the data
The audit log should record the rule identifier, the timestamp, the record count and the disposal action. It should not copy the deleted personal data, otherwise the log itself becomes a store that needs its own retention rule.
Which deletion method fits which data?
The right method depends on whether the business needs the record later, whether other records depend on it, and whether the data must be recoverable. Hard deletion is simple but removes reporting value, while anonymisation keeps aggregate totals at the cost of more design work.
| Method | Recoverable afterwards | Keeps aggregate reporting | Main failure mode |
|---|---|---|---|
| Hard delete | No | No | Broken references in related tables |
| Soft delete (flag only) | Yes | Yes | Personal data stays in place and is never purged |
| Anonymisation | No | Yes | Identifiers survive in free-text fields or logs |
| Archive then purge | Until purge date | Depends on archive format | The archive is forgotten and never purged |
Soft deletion is the method most often mistaken for compliance. A flag that hides a record from the interface does not limit storage, so it should always be followed by a purge step with its own date.
Hypothetical examples of retention rules in practice
Here are two hypothetical scenarios:
Hypothetical scenario one: a support ticket system
Prefer a delivered project to a scenario? Read the case study: EveryTranslate, an AI-powered translation platform.
A support platform closes tickets when the customer confirms resolution. The rule anonymises the customer name and email on tickets that have been closed for a defined period, while keeping the ticket category and resolution time for reporting. The job runs nightly, and tickets under a legal hold are skipped and listed in a review queue.
Hypothetical scenario two: a recruitment database
A recruitment tool stores applications for roles that are filled. The retention rule starts when the role is closed, and candidates who did not consent to a talent pool are deleted after the period. Attachments are removed from file storage as well as from the database, which is the step most often forgotten.
Where do retention rules and deletion jobs fail?
Retention rules fail most often at the edges of the primary database. A job can perform correctly on the main table and still leave personal data in places the team did not map, so the failure is usually in the data flow rather than the rule.
- Backups keep copies that the main job never touches, so the backup policy must define how and when those copies expire.
- Integrations push copies into CRM, email or analytics tools, which need their own deletion calls or a documented manual step.
- Logs and exports often contain personal data in free text, which a column-based job will not find.
- Unclear trigger events leave records with no end date, so the rule never fires.
Connecting the deletion job to downstream systems is usually where the most engineering effort goes. Our work on system integrations covers how these data flows are mapped and how deletion requests can be passed between systems, and the cloud infrastructure security baseline covers the storage and backup layer that deletion must reach.
Putting storage limitation into practice
Start with an inventory of data categories, assign an owner and a trigger event to each, and only then write the job. Build the rules into the data model so they are visible to the team, and keep the audit trail so that the schedule can be shown to be running. If your existing business software holds personal data without expiry rules, a custom software review can map where that data lives and which parts of the system need a deletion path. Request a project consultation at https://ruicodex.com/Contact or email info@ruicodex.com to discuss your project.
Frequently Asked Questions
Is deleting a record the same as anonymising it?
No. Deletion removes the record so it can no longer be retrieved, while anonymisation keeps the record but removes or replaces the fields that identify a person. Anonymisation is useful when totals and trends matter, but it only counts as a disposal method if the identifiers are removed everywhere they appear, including free-text fields and logs.
How often should a deletion job run?
There is no universal interval. The job should run often enough that records do not remain past their rule for longer than the documented period allows, and the schedule should be written into the same rule definition that describes the retention period.
Do deletion jobs need to reach backups?
Backups should be covered by a documented process, because a backup copy of a deleted record still exists until the backup expires. The usual approach is to set backup retention to a defined period and state that restored data is checked against deletion requests before it returns to production.
Who decides the retention periods for business data?
The business owner of each data category decides the period, and legal or compliance advisers should confirm it against the rules that apply to that data. Rui Codex provides technical implementation support for building these rules and jobs, but does not give legal, tax or compliance advice.
Sources
- Regulation (EU) 2016/679 (General Data Protection Regulation) - Publications Office of the European Union