1

Mongo can't natively guarantee atomicity for multi-document transactions.

Considering that the method of storing files via mongo's gridfs functionality (I'm using gridfs-stream from npm) involves creating multiple documents, I was wondering if it is dependable in the following ways:

1) If for some reason some of the file chunks can't be created, will no documents be created? Or will the db be left in a state where a file only had some of its chunks saved?

2) If the server running mongo loses power or crashes unexpectedly in the middle of a gridfs file upload, is it possible that upon rebooting the db will contain corrupt or partially-uploaded files?

Thanks!

Gershom Maes
  • 7,358
  • 2
  • 35
  • 55

0 Answers0