Short answer: upload each replacement under a new tenant-scoped key, then conditionally switch a small metadata pointer; never overwrite the object that readers currently use. For a B2B SaaS that processes receipts, keep the original receipt as an immutable audit record and apply the same pointer pattern only to replaceable derivatives such as avatars, thumbnails, or corrected display attachments.
The decision is mostly about isolation, not upload syntax. A stable filename such as avatar.jpg looks convenient until two browser tabs, a retrying worker, and a cache disagree about which bytes are current. A unique object key keeps those writes apart. A compare-and-swap on the database row decides which one becomes visible.
It is a small split with a useful consequence: storing bytes and publishing bytes become two different operations.
1. How should an avatar upload replace an existing file without an object storage race condition?
Use an immutable-object, mutable-pointer flow.…