Menu

Store Generated AI Images per User Folder: Node/Express Object Storage Lifecycle
📰

Store Generated AI Images per User Folder: Node/Express Object Storage Lifecycle

DEV Community: go·QuintonShaw1483·about 1 hour ago
#b5WTH736
#devtogo#devto#dev#deletion#upload
Reading 0:00
15s threshold

Short answer: keep the original image in object storage under an application-owned, user-scoped key, and treat the database as the authority for retention and deletion. For a media service processing receipts, large-file throughput should decide the upload path first; lifecycle cleanup and user-requested deletion are separate controls with separate SLOs.

The useful design is boring: one immutable object key per source file, a small record describing that object, bounded workers, and an audit trail for every deletion decision. A folder is only a prefix in a flat object namespace. It is not an access-control boundary, a transaction, or a substitute for metadata.

How should I store generated images per user folder?

Use a key that is difficult to confuse with another receipt, for example users/{userID}/receipts/{receiptID}/original.png . Generate receiptID server-side, store the complete key in the database, and keep the original separate from derived previews.…

Continue reading — create a free account

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