简体   繁体   English

Amazon S3 跨区域复制和 Cloudfront 之间的区别

[英]Difference between Amazon S3 cross region replication and Cloudfront

After reading some AWS documentations, I am wondering what's the difference between these different use cases if I want to delivery (js, css, images and api request) content in Asia (including China), US, and EU.在阅读了一些 AWS 文档后,我想知道如果我想在亚洲(包括中国)、美国和欧盟交付(js、css、图像和 api 请求)内容,这些不同的用例之间有什么区别。

  1. Store my images and static files on S3 US region and setup EU and Asia(Japan or Singapore) cross region replication to sync with US region S3.将我的图像和静态文件存储在 S3 美国区域并设置欧洲和亚洲(日本或新加坡)跨区域复制以与美国区域 S3 同步。

  2. Store my images and static files on S3 US region and setup cloudfront CDN to cache my content in different locations after initial request.将我的图像和静态文件存储在 S3 美国区域并设置 cloudfront CDN 以在初始请求后将我的内容缓存在不同位置。

  3. Do both above (if there is significant performance improvement).执行以上两项操作(如果有显着的性能改进)。

What is the most cost effective solution if I need to achieve global deployment?如果我需要实现全球部署,什么是最具成本效益的解决方案? And how to make request from China consistent and stable (I tried cloudfront+s3(us-west), it's fast but the performance is not consistent)?以及如何使来自中国的请求保持一致和稳定(我尝试了 cloudfront+s3(us-west),速度快但性能不一致)?

PS.附注。 In early stage, I don't expect too many user requests, but users spread globally and I want them to have similar experience.早期,我不期望太多的用户请求,但用户遍布全球,我希望他们有类似的体验。 The majority of my content are panorama images which I'd expect to load ~30MB (10 high res images) data sequentially in each visit.我的大部分内容是全景图像,我希望在每次访问时按顺序加载 ~30MB(10 个高分辨率图像)数据。

Cross region replication will copy everything in a bucket in one region to a different bucket in another region.跨区域复制会将一个区域的存储桶中的所有内容复制到另一个区域的不同存储桶中。 This is really only for extra backup/redundancy in case an entire AWS region goes down.这实际上只是为了在整个 AWS 区域出现故障时提供额外的备份/冗余。 It has nothing to do with performance.它与性能无关。 Note that it replicates to a different bucket , so you would need to use different URLs to access the files in each bucket.请注意,它会复制到不同的存储桶,因此您需要使用不同的 URL 来访问每个存储桶中的文件。

CloudFront is a Content Delivery Network. CloudFront 是一个内容交付网络。 S3 is simply a file storage service. S3 只是一个文件存储服务。 Serving a file directly from S3 can have performance issues, which is why it is a good idea to put a CDN in front of S3.直接从 S3 提供文件可能会出现性能问题,这就是为什么将 CDN 放在 S3 前面是个好主意的原因。 It sounds like you definitely need a CDN, and it sounds like you have tested CloudFront and are unimpressed.听起来您肯定需要 CDN,而且您已经测试了 CloudFront 并且不为所动。 It also sounds like you need a CDN with a larger presence in China.听起来您还需要一个在中国有更大影响力的 CDN。

There is no reason you have to chose CloudFront as your CDN just because you are using other AWS services.没有理由仅仅因为您正在使用其他 AWS 服务就必须选择 CloudFront 作为您的 CDN。 You should look at other CDN services and see what their edge networks looks like.您应该查看其他 CDN 服务,看看它们的边缘网络是什么样的。 Given your requirements I would highly recommend you take a look at CloudFlare .鉴于您的要求,我强烈建议您查看CloudFlare They have quite a few edge network locations in China.他们在中国有不少边缘网络位置

Another option might be to use a CDN that you can actually push your files to.另一种选择可能是使用您可以实际将文件推送到的 CDN。 I've used this feature in the past with MaxCDN .我过去曾在MaxCDN 中使用过此功能。 You would push your files to the CDN via FTP, and the files would automatically be pushed to all edge network locations and cached until you push an update.您可以通过 FTP 将文件推送到 CDN,文件将自动推送到所有边缘网络位置并缓存,直到您推送更新。 For your use case of large image downloads, this might provide a more performant caching mechanism.对于大型图像下载的用例,这可能会提供更高效的缓存机制。 MaxCDN doesn't appear to have a large China presence though, and the bandwidth charges would be more expensive than CloudFlare.不过,MaxCDN 在中国似乎没有很大的影响力,而且带宽费用会比 CloudFlare 贵。

If you want to serve your files in S3 buckets to all around the world, then I believe you may consider using S3 Transfer acceleration.如果您想将 S3 存储桶中的文件提供给全世界,那么我相信您可以考虑使用 S3 传输加速。 It can be used in cases where you either upload to or download from your S3 bucket .它可用于上传到 S3 存储桶或从 S3 存储桶下载的情况。 Or you may also try AWS Global Accelerator或者您也可以尝试 AWS Global Accelerator

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM