Store files on disk or MongoDB

后端 未结 3 932
鱼传尺愫
鱼传尺愫 2021-01-02 06:03

I am creating a mongodb/nodejs blogging system (similar to wordpress).

I currently have the images being saved on the disk and a pointer being placed in mongo. I was

3条回答
  •  佛祖请我去吃肉
    2021-01-02 06:54

    Storing the image as document in mongodb would be a bad idea, as the resources which could have been used to send a large amount of informational data would be used for sending files.

    Have a look at mongoDb file storage GridFS , that might solve your problem of storing images, and providing horizontal scalability as well.

    http://www.mongodb.org/display/DOCS/GridFS http://www.mongodb.org/display/DOCS/GridFS+Specification

提交回复
热议问题