在 CouchDB/Cloudant 与 CDN (CloudFront) 中存储文件(视频/图像/音乐)?

发布于 2024-09-28 07:35:43 字数 464 浏览 3 评论 0原文

我是 CouchDB/Cloudant 和 CDN (CloudFront) 的新手。

我即将使用 CouchDB 作为数据库构建一个应用程序。

该网络应用程序将处理大量文件。

我知道CouchDB可以将文件作为附件存储在数据库中。但后来我听说利用 CDN 在世界各地存储和分发文件。

我的问题:

  1. 与 CDN (CloudFront) 相比,在 CouchDB 中存储文件如何?
  2. Cloudant 的服务与 CDN (CloudFront) 相比如何?
  3. Google 存储也是 CDN 吗?
  4. Amazon CloudFront 和 S3 有什么区别?
  5. 我是否必须选择将文件存储在 CouchDB/Cloudant 或 CDN 中,还是可以/应该将它们结合起来?
  6. 使用 CouchDB 时存储文件的最佳实践是什么?

I am new to CouchDB/Cloudant and CDN (CloudFront).

I am about to build an application using CouchDB as database.

This web application will handle a lot of files.

I know that CouchDB can store files in the database as attachments. But then I have heard about leveraging CDN to store and distribute the files all over the world.

My questions:

  1. How is storing files in CouchDB compared to CDN (CloudFront)?
  2. How is Cloudant's service compared to CDN (CloudFront)?
  3. Is Google storage also a CDN?
  4. What is the difference between Amazon CloudFront and S3?
  5. Do I have to choose to store files either in CouchDB/Cloudant or CDN, or could/should I actually combine them?
  6. What are best practices for storing files when using CouchDB?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木槿暧夏七纪年 2024-10-05 07:35:43

其中一些问题基于您的具体实施,但这里有一个概括(不按任何特定顺序):

  • 除非他们在世界各地的众多服务器上镜像了 Cloudant(实际上是一个 CDN,只是没有静态文件) ),真正的 CDN 可能会有更好的响应时间,这主要取决于您如何使用 Cloudant(例如,您可能会获得良好的响应时间,但如果您在输出之前将整个文件加载到内存中,您就会输掉 CDN 之战) .

  • CouchDB 必须在服务器端处理更多数据才能输出附件。

  • CloudFront(以及一般的 CDN)经过优化,可在最近的服务器上实现最快的响应时间。

  • S3只是存储; 并将其分布在许多服务器上,这些服务器根据哪一台服务器距离请求该内容的用户更近来提供内容。

  • 是的,您必须在 Cloudant 或 CDN 之间进行选择;一种将它们逐字存储在文件系统中,另一种将它们存储在数据库内的文件系统中。

我不知道其中一些问题的答案,例如,CouchDB 实际上如何在低级别处理附件存储,也不知道它的最佳实践,但是,这应该给您足够的想法,至少开始考虑哪个适合您的需求最好的。

Some of these questions are based on your specific implementation, but here's a generalization (not in any particular order):

  • Unless they have Cloudant mirrored on numerous servers around the world (effectively a CDN in its own right, just sans static files), a true CDN would probably have better response time, depending mostly on how you used Cloudant (eg, you might get good response times, but if you load the entire file into memory before outputting it, you're losing the CDN battle).

  • CouchDB has to process more data server-side before it can output an attachment.

  • CloudFront (and CDNs in general) are optimized for the fastest possible response time with the closest server.

  • S3 is only storage; CloudFront uses that storage and distributes it across many servers that serve the content based upon which one is closer to the user requesting that content.

  • Yes, you have to choose between Cloudant or the CDN; one stores them in the filesystem verbatim, the other stores them in the filesystem within the database.

I don't know the answer to some of these, eg, how CouchDB actually handles attachment storage at a low level, nor its best practices, however, this should give you enough of an idea to at least start thinking about which suits your needs best.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文