Store files on disk or MongoDB

后端 未结 3 899
鱼传尺愫
鱼传尺愫 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:57

    Aside from GridFS, you might be considering a cloud-based deployment. In that case, you might consider storing files in cloud-specific storage (Windows Azure has Blob Storage, for example). Sticking with Windows Azure for this example (since that's what I work with), you'd reference a file by its storage account URI. For example:

    https://mystorageacct.blob.core.windows.net/mycontainer/myvideo.wmv
    

    Since you'd be storing the MongoDB database itself in its own blob (and mounted as disk volume on your Linux or Windows VM), you could then choose to store your files in either the same storage account or a completely different storage account (with each storage account providing 100TB 200TB of storage).

提交回复
热议问题