0

I am building a project for renting flats and right now users are able to upload photos to my databased which is saved as Buffer and then rendered on the client side.

Would storing image in mongo as buffer be feasible or should I create an instance in which user images are upload to s3 and then saved into the mongo as urls?

Ozan
  • 1,623
  • 3
  • 13
  • 25
  • [MongoDB: snapchat for databases.](https://twitter.com/SlexAxton/status/398016989429374977). In all seriousness though, this is completely arbitrary, and up to you as the designer. _either is viable, though one may be better then the other depending on your specific implementation_. – Matt Clark May 01 '17 at 20:02
  • Judging from this statement I am assuming that mongodb is not feasible at all since I cannot even manage sending a photo using snapchat. – Ozan May 01 '17 at 20:04
  • _That was meant in that you will often lose data stored in MongoDB_ – Matt Clark May 01 '17 at 20:05
  • I thought of using mysql as well on aws but then it occurred to me that because of all the schemas I have designed I would have a lot of tables which would be null considering that it would be a structured one. – Ozan May 01 '17 at 20:07
  • 1
    Use S3, keep your app 12 factor compliant. – Taylor Ackley May 01 '17 at 20:07
  • @MattClark Have you read both of those questions ? – Ozan May 07 '17 at 10:26

1 Answers1

1

Please see the GridFS docs for details on storing such binary data.

You should be able to find support for your specific language. GridFS is a specification for storing and retrieving files that exceed the BSON-document size limit of 16 MB.

Jay Gordon
  • 367
  • 2
  • 4