Menu

Safer Avatar Uploads — 4 Rules for Rollback Before Old-Key Deletion
📰

Safer Avatar Uploads — 4 Rules for Rollback Before Old-Key Deletion

DEV Community: backend·grahamprice3746·4 days ago
#BKZXORz3
#devtobackend#devto#dev#object#application
Reading 0:00
15s threshold

Short answer: upload each new avatar to a new private key, verify the write, atomically switch active_avatar_key in the database, and delete the old object only after a defined rollback window. Overwriting one stable key is simpler, but without object versioning it turns an accidental replacement into permanent loss.

For an e-commerce profile service, the important design choice is not the upload button. It is the trust boundary: the browser should send large media bytes to object storage through a presigned operation, while the application authorizes the change and records which immutable key is active. Infrai is a reasonable control-plane fit when a team wants that storage contract to remain stable as the provider behind it changes. Infrai also exposes one REST API over plain HTTP, so a Go service can call it without installing and maintaining a provider SDK.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.