I'm developing a website which allows the user to upload an image per item. I guess there will be hundreds per user.

What is more preferred?

Save the images:

  • as bytes in the DB (mongodb)
  • as files in the server

I don`t really know where to place this question in the "Stack Exchange" forums.

2 Answers 2


People have tested data vs. file storage for this sort of thing (you can see the full details of a test here.

Per this test, for performance reasons, the file system is the best option for production.


MongoDB will happily store binary data such as files, using its GridFS system. That way you can keep the images and other user data together in one place, which is an advantage over storing the images on the file server.

  • Thanks. I eventually choose to store the images on the server for easier sharing which came later in the customer requests Feb 27, 2017 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.