GridFS vs Filesystem storage

Does anyone know what are the clear benefits of using MongoDb’s GridFS file storage as compared to the Filesystem storage?

Thank you.

It’s easy to setup/use :slight_smile:

Beyond that use some form of local file storage.

GridFS is fine for small low use environments but it doesn’t scale and you will hit performance issues quite quickly.

The primary benefit is using GridFS is the migration part. you don’t need to worry about the migration of data as data is stored as chunks in the collection itself. But yes it doesn’t scale and will cause performance issues.

1 Like

Correct. If you move the server elsewhere the data is in the database.

1 Like

Great, Thank you. Now I understand.

1 Like

On my small ARM server when I used Filesystem storage users on iOS couldn’t watch videos and the slider of voice messages didn’t work anywhere. When I switched to GridFS new videos and voice messages worked as intended (except the voice message slider on android that didn’t work anyway). I think that’s because of the way files are stored in GridFS, in chunks, and on my small server that avoided the stall we experienced with Filesystem storage.

It might be a little more complicated, but quite possibly so.

On small devices there may be other issues with writing to the storage - it depends what the storage type is.

But if you start to scale your server it is pretty well the first thing to fix to increases performance.

1 Like

Great, Thank you for posting.