在 CouchDB/Cloudant 与 CDN (CloudFront) 中存储文件(视频/图像/音乐)?
我是 CouchDB/Cloudant 和 CDN (CloudFront) 的新手。
我即将使用 CouchDB 作为数据库构建一个应用程序。
该网络应用程序将处理大量文件。
我知道CouchDB可以将文件作为附件存储在数据库中。但后来我听说利用 CDN 在世界各地存储和分发文件。
我的问题:
- 与 CDN (CloudFront) 相比,在 CouchDB 中存储文件如何?
- Cloudant 的服务与 CDN (CloudFront) 相比如何?
- Google 存储也是 CDN 吗?
- Amazon CloudFront 和 S3 有什么区别?
- 我是否必须选择将文件存储在 CouchDB/Cloudant 或 CDN 中,还是可以/应该将它们结合起来?
- 使用 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:
- How is storing files in CouchDB compared to CDN (CloudFront)?
- How is Cloudant's service compared to CDN (CloudFront)?
- Is Google storage also a CDN?
- What is the difference between Amazon CloudFront and S3?
- Do I have to choose to store files either in CouchDB/Cloudant or CDN, or could/should I actually combine them?
- What are best practices for storing files when using CouchDB?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其中一些问题基于您的具体实施,但这里有一个概括(不按任何特定顺序):
除非他们在世界各地的众多服务器上镜像了 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.