CDN如何访问数据库? [英] how does a CDN access database?

查看:305
本文介绍了CDN如何访问数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具体来说,我将使用的数据库是mongodb,所涉及的文件将是图像。

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?

我想您可以将链接存储到CDN文件中以及数据库中的图片。因此 { image: cdnurl / fakefilelocation}

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

因此,当用户请求图像时,他们只会得到CDN网址
,但是CDN的拉请求如何工作?他们如何获得图像?您是否必须手动将他们对特定图片的获取请求路由到实际图片,而不是链接?

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?

推荐答案

我从来没有我自己在大型生产服务器上尝试或测试了这些东西,但是我需要做出这样的决定,我将阅读有此问题经验的人在做什么。

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

这篇关于CDN如何访问数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆