Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

  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.

  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.

  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)?

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.

like image 327
Egoist_sx Avatar asked Nov 21 '15 00:11

Egoist_sx


People also ask

What are the differences between CloudFront and S3 Cross-region replication?

CloudFront is a Content Delivery Network. S3 is simply a file storage service. 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.

What is the difference between S3 and CloudFront?

Amazon S3 is a Simple Storage Service, this can be used large amount of information i.e. Videos, Images, PDF etc. CloudFront is a Content Delivery Network, which is closer to the end user and is used to make the information available on Amazon S3 in the least possible time. A sample use case is Video on Demand.

What is S3 Cross-region replication?

S3 Cross-Region Replication (CRR) is used to copy objects across Amazon S3 buckets in different AWS Regions.

When should I use S3 acceleration vs CloudFront?

TL;DR: CloudFront is for content delivery. S3 Transfer Acceleration is for faster transfers and higher throughput to S3 buckets (mainly uploads). Amazon S3 Transfer Acceleration is an S3 feature that accelerates uploads to S3 buckets using AWS Edge locations - the same Edge locations as in AWS CloudFront service.


2 Answers

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. 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.

CloudFront is a Content Delivery Network. S3 is simply a file storage service. 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. It sounds like you definitely need a CDN, and it sounds like you have tested CloudFront and are unimpressed. It also sounds like you need a CDN with a larger presence in China.

There is no reason you have to chose CloudFront as your CDN just because you are using other AWS services. You should look at other CDN services and see what their edge networks looks like. Given your requirements I would highly recommend you take a look at 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. I've used this feature in the past with 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. 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.

like image 146
Mark B Avatar answered Sep 30 '22 15:09

Mark B


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. It can be used in cases where you either upload to or download from your S3 bucket . Or you may also try AWS Global Accelerator

like image 20
KorhanE Avatar answered Sep 30 '22 15:09

KorhanE