Asset Retention and Cleanup
Summary
Source-backed account of what the Asset Service deletes, retains, or leaves untouched across every persisted object. There is no cleanup worker and no soft-delete; the only deletion paths are a guarded hard delete of an asset and removal of a document reference row.
Audience
Backend engineers, database reviewers, architects, QA, support, operations, security reviewers, and product owners.
Overview
The Asset Service keeps data indefinitely except in two explicit paths. An asset may be hard-deleted, but only while it sits in a deletable status; deleting it cascades to its child rows. A document reference may be removed, but that removes only the pointer row — the external blob is retained. Everything else (audit, timeline, outbox, processed-event, and the compatibility identity carried on the asset) has no cleanup, no soft-delete, and no time-to-live in source. Retired is a terminal lifecycle state, not a deletion.
Confirmed persistence behavior
| Object | Behavior in source | Classification |
|---|---|---|
| Asset record | Hard delete, permitted only when status is Available, Requested, or Rejected (deletable gate); no soft-delete flag | Hard delete (guarded) |
| Assignment history | No independent cleanup; removed only by cascade when the parent asset is hard-deleted | Cascade removal only |
| Document reference | Reference row removed on delete; the external blob is retained with no delete call to the Document Service | Reference removal; external retention |
| Audit log | Append-only; no cleanup worker, no soft-delete, no TTL | No cleanup found |
| Timeline | Append-only; no cleanup worker, no soft-delete, no TTL | No cleanup found |
| Outbox messages | No cleanup, replay-purge, or dead-letter table in source | No cleanup found |
| Processed-event ledger | Modeled idempotency ledger; no cleanup path in source | No cleanup found |
| Compatibility identity | Carried as a property on the asset; removed only if the asset is hard-deleted | No independent cleanup |
- Hard delete only. Asset deletion is a physical delete guarded by the deletable status gate; there is no soft-delete column anywhere in the schema.
- Terminal state is not deletion.
Retiredis a terminal lifecycle status. A retired asset remains stored and cannot be edited; it is never removed by reaching that state. - External document retention. Removing a document reference deletes only the local pointer row; the bytes in the Document Service are left in place, with no reconciliation, versioning, or retention handling of the external object.
Classification
Implemented guarded hard delete and reference removal; no soft delete, no cleanup worker, and no retention automation across any object.
Requires confirmation
- Retention periods and purge governance for audit, timeline, outbox, and processed-event data.
- Whether orphaned external document blobs should ever be reconciled or removed.
- Any regulatory retention or right-to-erasure obligations — none are implemented in source.
Diagram
Related Articles
See Also
Keywords
- Asset retention
- Data cleanup
- Draft database documentation
Source References
microservices/src/asset-service/Domain/Asset/Asset.csmicroservices/src/asset-service/Application/Commands/AssetCommands.csmicroservices/src/asset-service/Application/Commands/DocumentCommands.csmicroservices/src/asset-service/Infrastructure/AssetDbContext.cs
Revision Information
- Status: Draft
- Last reviewed: 2026-07-17
- Review cycle: Quarterly