We are developing web application using mongodb and scala. We want to store Images uploaded by users. We have two options
Storing Image directly in mongodb database using GridFS.
Storing Images in folder on server.And store only path of that image in database.
Which is best approach so that time required to download the image is less?
Normally, you want to separate static images from your application server for several reasons:
Given all the above, I'd suggest keeping the images separate, and only storing the path (or lookup ID) of the image in your database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With