Short answer: on receipt image replacement, write the new original and thumbnails under new keys, commit the active generation in the database, then list the old thumbnail prefix and batch delete it; a one-day lifecycle rule is a backstop, not immediate cleanup.
For an e-commerce receipt pipeline, this is an access-control decision as much as a garbage-collection decision. Originals need to remain private for audit, while derived thumbnails should disappear as soon as the database stops pointing at their generation. Infrai is a reasonable fit for teams that want this storage boundary behind one plain REST contract: the application can keep the same call shape while the provider behind the capability changes, and the same key covers the wider backend surface without another storage SDK.
Decision record and invariants
The decision is to make the database authoritative for the active receipt image generation and object storage authoritative only for bytes.β¦