Skip to main content

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

ObjectBehavior in sourceClassification
Asset recordHard delete, permitted only when status is Available, Requested, or Rejected (deletable gate); no soft-delete flagHard delete (guarded)
Assignment historyNo independent cleanup; removed only by cascade when the parent asset is hard-deletedCascade removal only
Document referenceReference row removed on delete; the external blob is retained with no delete call to the Document ServiceReference removal; external retention
Audit logAppend-only; no cleanup worker, no soft-delete, no TTLNo cleanup found
TimelineAppend-only; no cleanup worker, no soft-delete, no TTLNo cleanup found
Outbox messagesNo cleanup, replay-purge, or dead-letter table in sourceNo cleanup found
Processed-event ledgerModeled idempotency ledger; no cleanup path in sourceNo cleanup found
Compatibility identityCarried as a property on the asset; removed only if the asset is hard-deletedNo 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. Retired is 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

See Also

Keywords

  • Asset retention
  • Data cleanup
  • Draft database documentation

Source References

  • microservices/src/asset-service/Domain/Asset/Asset.cs
  • microservices/src/asset-service/Application/Commands/AssetCommands.cs
  • microservices/src/asset-service/Application/Commands/DocumentCommands.cs
  • microservices/src/asset-service/Infrastructure/AssetDbContext.cs

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-17
  • Review cycle: Quarterly