0

For my course project, I have to develop a Telegram bot. This bot is being hosted on Heroku.

For this bot, I need storage of images. Two options came to my mind - Amazon S3 and MongoDB. As images are quite small and there not so many of them, both services seem to be equal. Therefore, I would like to have the opinions of other developers as I have to justify my choice.

Files will be uploaded only by moderators, and it will happen rarely. End users will only read these images.

Which one is easier to integrate with the Heroku app? Which one is easier to manage?

I would be happy to see other related points.

Dark_Furia
  • 29
  • 5
  • for me , s3 for many reasons , please check those links : https://www.quora.com/What-are-the-advantages-of-using-MongoDB-GridFS-vs-Amazon-S3-to-store-assets-for-a-product-with-MongoDB-as-the-database-backend – Moussab Kbeisy Sep 16 '21 at 08:09
  • and https://stackoverflow.com/questions/5058180/mongodb-as-static-files-provider – Moussab Kbeisy Sep 16 '21 at 08:10

1 Answers1

0

Amazon S3 (like Dropbox and other file remote storage) is more suitable for storing files (images, documents, etc..). They are cheaper than DBs and scale up a lot better.
From the development point of view it is easier to deal with plain files as you only need (typically) to perform operations like put, get and delete.

MongoDB is suitable for storing data in a loosely structured way: you can search, order, add and edit conveniently your data.
From the development point of view dealing with a DB it involves configuring/managing the connection and use the relevant API to store/fetch the data.

Obviously the final choice it is a trade-off between the effort/complexity and the benefits: if you use MongoDB already for your metadata it might be convenient to store the images too (and avoid an additional storage).
In my experience files are better stored and managed on file systems.

DBs can indeed be used to store images, you can read an interesting debate here.

Beppe C
  • 11,256
  • 2
  • 19
  • 41