Storing user avatar uploads: database blob, local disk, or object storage
The article argues that avatar images are best kept in object storage, with only an object key and validation metadata saved in the database, and local disk treated as disposable. This separation keeps image reads away from transactional database connections and lets images have their own retention policy. The author starts design reviews from failure tolerance rather than storage cost, noting that an avatar failing should not block authentication or initials rendering. Local disk breaks when instances are replaced, while database blobs compete with profile writes for capacity and backup throughput. Object storage, with signed read URLs and direct client uploads, gives independent scaling and recovery, though it introduces permission and routing risks.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in