how does a CDN access database?

假装没事ソ 提交于 2019-12-12 04:44:39

问题


just to be specific the database I will be using is mongodb and the files in question would be images.

My question is......... if you store your pictures inside a database instead of a regular static file structure... how does this work?

I guess you could store the link to the CDN file along with the picture in the database. so {"image": "cdnurl/fakefilelocation"}

so when a user requests the image they just get the CDN url but how does the "pull" request work from the CDN? how do they get the images? Would you have to manually route their get request for a specific image to the actual picture instead of a link?


回答1:


I have never tried or tested such things by myself on a big production server, but I would need to come up with such decision I will read what people who has experience with this problem have been doing.

Here are few threads that I found really interesting:

  • https://groups.google.com/forum/?fromgroups=#!topic/mongodb-user/-iljwXX-Ml8
  • Storing Images in DB - Yea or Nay?
  • https://groups.google.com/forum/?fromgroups=#!topic/mongodb-user/CxhawCS8yZw


来源:https://stackoverflow.com/questions/13314579/how-does-a-cdn-access-database

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!