Lifecycle and retention
We decide how long source bytes, derived bytes, versions, and unfinished transfers remain. Moving data to another tier can change retrieval behavior as well as cost. We will compute retention totals, make deletion explicit, recover orphaned states, and preserve operational evidence.
#Section 25Lifecycle policies move or expire objects
Heron keeps a clip for the illustrative 30-day retention period, but most reads happen early. A lifecycle policy applies actions such as storage-class transition or expiration according to object age, tags, or other supported rules. It changes the retained object population over time.
Assume an additional illustrative media workload of 100 clips per day, each 5,000,000,000 bytes. Thirty days retains 3,000 clips and 15,000,000,000,000 payload bytes. If 7 days remain in a hot tier, that population holds 3,500,000,000,000 bytes, while the remaining 23 days hold 11,500,000,000,000 in another tier.
S3 lifecycle documentation describes supported transition and expiration actions. A selected class can require restoration or different access charges. Do not quote prices from memory; a design can compare bytes and retrieval requirements without inventing a current bill.
#Section 26Retrieval behavior is part of the policy
A viewer requests an archived clip and the app returns a signed URL immediately. If the selected storage tier requires a restore first, the link may not supply playable bytes yet. Retention policy must coordinate with playback availability and the application state.
Represent archival or restore progress explicitly. Heron can show that a clip is retained but not immediately playable, start a permitted restore request, and publish availability only when the object is retrievable. A cached rendition may provide a limited alternative, but it has its own age, availability, and authorization contract.
The storage calculation should count source, renditions, old versions, restore copies, and transfer buffers separately where they coexist. A lifecycle transition does not delete every derived object automatically. Associate each derived identity with its source and policy so cleanup can decide what is still needed.
#Section 27Delete through a recoverable application state
A user deletes clip c7. If the object disappears before metadata changes, the app may still offer a broken playback link. If metadata disappears first and storage deletion fails, bytes remain orphaned. There is no single shared transaction across those owners.
Commit a deletion state or tombstone in the database, stop issuing new playback access, and perform storage cleanup under a retained idempotent job. Record the exact immutable identities or versions to delete. A worker retry should not infer the current key and accidentally remove a replacement upload.
Deletion is a security and product promise as well as space reclamation. Retained backups, legal retention, version histories, and already-issued access may affect what disappear means. State these boundaries instead of assuming a successful object delete instantly erases every copy and cached response.
#Section 28Reconciliation finds stranded states
A worker completes storage upload but crashes before publishing metadata. Another fails after marking deletion but before deleting bytes. A reconciler compares retained state across owners and repairs mismatches through idempotent actions. It is a designed recovery path, not a speculative cleanup script.
For each pending upload, ask whether the exact reserved object or multipart session exists and is still within its supported lifetime. For each published record, verify required object identities according to the chosen audit policy. For each tombstone, finish recorded cleanup. These scans need bounded batches and indexes so they do not overload normal serving.
A notification can speed discovery, but notifications need deduplication and loss recovery according to their actual delivery contract. Periodic reconciliation catches states not resolved by the fast path. Keep command evidence long enough that retries and cleanup can distinguish completed work from new work.