Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is faster between storing images in Mongo GridFS or Amazon S3? [closed]

I am working on a project, where each user can post many images. We use Node.js with Express and MongoDB as the database. I was wondering which way would be better in terms of speed and scalability:

  • Storing images in Mongo GridFS

Or

  • Storing images on Amazon S3, and paths of images on MongoDB. Then retrieve images using paths.

Any thoughts are appreciated !

Thank you,

like image 730
c0mrade Avatar asked May 25 '14 04:05

c0mrade


1 Answers

This is like comparing Go vs Node.js. There's no better general solution.

Each might have their own advantages and solutions. MongoDB is more like the DIY solution, and Amazon S3 is the managed solution. With MongoDB you have to scale it yourself. I can say S3 will be faster initially and it's already scaled by Amazon, and probably cheaper(S3 is cheaper than EBS). You can get a lot of servers with huge amounts of RAM and MongoDB will definitely be faster. Also if the MongoDB instance is in the same instance as your App, you will have less latency.

Also check this question: MongoDB as static files provider?

And this: What are the advantage of using MongoDB GridFS vs Amazon S3 to store assets for a product with MongoDB as the database backend?

like image 160
Farid Nouri Neshat Avatar answered Sep 21 '22 07:09

Farid Nouri Neshat