Engineering Decisions · Junior · Question 7 of 12

Users upload avatars of up to 5 MB. The app runs on several instances behind a load balancer. Where do you store the files?

Show the answer

Correct answer: In object storage, keeping the URL in the database

Explanation

Object storage is reachable from every instance, is cheap, and keeps files out of database backups. A local disk fits a single server, but behind a load balancer other instances wouldn't see the file. Binary columns fit a few small files that must stay transactional with their row, but avatars for many users would bloat the database and its backups.

Further reading

Problem with a question

Engineering Decisions · Junior · question 7

Test yourself

Take the Engineering Decisions · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz