At first I will use only the local file system in development mode, during production I will use GridFS or Amazon S3.
Allows you to make this more understandable.
First point (Store files in MongoDB itself.)
- If you process images as small or as small as 16 MB, you should store them in your collections.
contrast
Every time you make a request, you should know that you are exploring the entire collection, so it will take a bit (you can exclude the βimageβ field to avoid this.)
Second point (use MongoDB GridFS to store files.)
- If you process images larger than (16 MB>)
- You can add metadata (I like it).
Take a look at the GridFs Docs .
This article talks about the pros and cons of using GridFs , it can also be helfup
also When should I use gridfs?
Third Point (Use Amazon S3)
I am not very familiar with S3 (I never use it).
But this is from Amazon docs when should I use Amazon S3?
S3 is free to join, and it is a pay-as-you-go service, which means that you only ever pay for any hosting and bandwidth costs that you use, which makes it very attractive for start-ups, flexible and thrifty companies to minimize costs.
In addition, Amazon's fully scalable, fast and reliable service makes it very attractive to video makers and marketers around the world.
Amazon offers S3 as a hosting system, with a price that depends on the geographic location of the data center where you store your videos.
Four points (use local file system)
I only use the file system, when I test my applications, I never use it in production, since with my POV, it is not so scalable.
In my personal opinion, I would use GridFS, but I think that you need to analyze the requirements of your application and therefore know which storage adapter is using