MongoDB as static files provider?

后端 未结 2 399
我寻月下人不归
我寻月下人不归 2021-02-04 12:38

It\'s MongoDB a good candidate to serve static files (files, video) as cdn. I searching a solid way to store big amounts of data (>+To) remplacing S3 and managing cache features

2条回答
  •  渐次进展
    2021-02-04 13:01

    Generally the answer would be yes, you can use mongodb to do this but mongodb does not have an http interface to serve files like apache/random-webserver does. If you need to add additional feature, like application authentication for those files then it might make more sense, as an example.

    You can create an infrastructure around mongodb where you replicate changes and write a http front-end to serve files (like nginx-gridfs or any of the other gridfs http components). But you would need to build/integrate these, test and deploy it all. Using a file-system with a standard web-server to provide the files is very well tested and documented; many systems use rsync to efficiently replicate files to many nodes.

    There are so many things that a cdn does that you would have to re-implement it might not make sense to tackle all of that yourself, but that is really another question.

提交回复
热议问题