6

I know MongoDB documents only supports up to 16MB. If I want to store files bigger than this value, I should use GridFs. Lower than that, they suggest to use BSON instead.

I have made a test, saving 33000 files with 10MB each, 16500 using BSON and 16500 using GridFs. The result I got for saving and getting the last 10 files using BSON vs GridFs was:

Saving the last 10 files

And for retrieving the last 10 files I got the following result:

Getting the last 10 files

Thinking about performance, it seems that using GridFs for files lower than 16MB it is still better than using BSON. So, the question is: For saving any file (no matter its size), it is best to use GridFs? Or for files under 16MB, BSON should be used for another reason that I don't know?

Gabriel
  • 952
  • 10
  • 31
  • I ask myself the same question today! So based on your experience is it good idea? – Nux May 18 '19 at 09:01

0 Answers0