Not quite right.
Saving images in GridFS increases the size of the database. So most of the database needs to be in memory, and I will spend more time / money managing servers when it comes to things like Sharding.
Mongodb gridfs breaks huge files into pieces, and only they will be loaded and maintained (for each fragment) when they are requested. Yes, definitely it will take more memory than the file system. These are all trade-offs when using in-memory data stores.
Getting the image from GridFS takes longer than the cloud, because I need to: a) request an image using the identifier b) read the image in memory c) use the php header to display the image
As I said in the previous paragraph, it will be loaded into memory for the first time. so you wonβt have a performance problem, in fact it will be a win since it is served from RAM instead of a disk. But if you are not satisfied yet, I would recommend caching images in nginx. therefore he will not come to mongo after the first.
source share