Are there any difference between amazon cloudfront and amazon s3 transfer acceleration? - amazon-web-services

I have read documents about them, but I don't know their difference exactly.
could you let me know what's the difference?

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.
However, (a) creating a CloudFront distribution with an origin pointing to your S3 bucket and (b) enabling S3 Transfer acceleration for your bucket - are two different things serving two different purposes.
When you create a CloudFront distribution with an origin pointing to your S3 bucket, you enable caching on Edge locations. Consequent requests to the same objects will be served from the Edge cache which is faster for the end user and also reduces the load on your origin. CloudFront is primarily used as a content delivery service.
When you enable S3 Transfer Acceleration for your S3 bucket and use <bucket>.s3-accelerate.amazonaws.com instead of the default S3 endpoint, the transfers are performed via the same Edge locations, but the network path is optimized for long-distance large-object uploads. Extra resources and optimizations are used to achieve higher throughput. No caching on Edge locations.
More inromation:
https://aws.amazon.com/blogs/aws/aws-storage-update-amazon-s3-transfer-acceleration-larger-snowballs-in-more-regions/
http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration-examples.html
https://aws.amazon.com/about-aws/whats-new/2016/04/transfer-files-into-amazon-s3-up-to-300-percent-faster/

If you are interested in the difference between these two options pertaining to uploading content to S3 you may be interested in the following from Amazon's FAQ for S3:
Q. How should I choose between Transfer Acceleration and Amazon
CloudFront’s PUT/POST? Transfer Acceleration optimizes the TCP
protocol and adds additional intelligence between the client and the
S3 bucket, making Transfer Acceleration a better choice if a higher
throughput is desired. If you have objects that are smaller than 1GB
or if the data set is less than 1GB in size, you should consider using
Amazon CloudFront's PUT/POST commands for optimal performance.
As the FAQ answer states, transfer acceleration should be used if you need higher throughput.

Per the FAQs:
Q: How should I choose between S3 Transfer Acceleration and Amazon CloudFront’s PUT/POST?
S3 Transfer Acceleration optimizes the TCP protocol and adds additional intelligence between the client and the S3 bucket, making S3 Transfer Acceleration a better choice if a higher throughput is desired. If you have objects that are smaller than 1GB or if the data set is less than 1GB in size, you should consider using Amazon CloudFront's PUT/POST commands for optimal performance.
https://aws.amazon.com/s3/faqs/#s3ta

both Amazon cloudfront and amazon S3 are very different. Here is what these are for:
Amazon S3 provides a storage service on the internet while Amazon CloudFront is a web service for content delivery. Amazon S3 uses its own global network of websites while Amazon CloudFront delivers your content through a worldwide network of edge locations. Major differences in the features of both these services are mentioned Here.
And if you want to know about the S3 transfer accelerators, it actually takes advantage of Amazon CloudFront’s globally distributed edge locations to deliver/transfer fast, easy, and secure way of files over long distances between your client and an S3 bucket. Want to read more about S3 transfer accelerator, click here.

CloudFront is download direction only, so it is not offering a performant upload to the origin. Whereas S3 with Transfer Acceleration, it will utilize Edge locations like CloudFront both for upload and download.

Related

Does AWS CloudFront bill for the cache hit?

I know that AWS CloudFront bills Data Transfer Out (and there's 1 TB of free in the free tier). But I was wondering what CloudFront counts as Data Transfer. Is any data transferred to the Internet (CloudFront cached data aka cache hit, data that is transferred from EC2/S3) billed?
For instance, let's say the origin server (EC2) returned 1 Gb of data to the Internet and CloudFront cached it, and eventually cached data got requested & transferred 4 times to the Internet. Will AWS bill me for 5 Gb of Data Transfer Out or only for 1 Gb (and the other 4 Gb won't be billed since it's cached)
Just for context: I have an EC2 application that returns images (that are stored in S3) and now I'm getting more and more requests and therefore more and more costs for the Data Transfer Out of EC2. I was looking for the option to cache images for some time in order to reduce Data Transfer costs. Two options that I found are Cloudflare & CloudFront. Cloudflare seems like a good option and allows to implement caching but in the meantime, I am trying to figure out how CloudFront works (since I'm using AWS ecosystem).
If that CloudFront bills every data transfer (even that is cached) then I suppose it won't reduce the Data Transfer cost.
Here's what the docs say.
On Origin server to Amazon CloudFront (origin fetches)
If you are using an AWS service as the origin for your content, data transferred from origin to edge locations (Amazon CloudFront origin fetches) are free of charge. This applies to data transfer from all AWS regions to all global CloudFront edge locations. Data transfer out from AWS services for all non-origin fetch traffic (such as multi-CDN traffic) to CloudFront will incur their respective regional data transfer out charges.
Free data Transfer between AWS cloud services and Amazon CloudFront for origin fetches
If AWS origins such as Amazon S3, Amazon EC2 or Elastic Load Balancing are used, there is no charge incurred for data transferred from origins to CloudFront Edge locations (this type of data transfer is known as origin fetch).
Here's detailed information on CloudFront Pricing along with a Price Calculator.

Use Amazon CloudFront together with Amazon S3 Transfer Acceleration?

I read this and understand the difference between CloudFront and S3 Transfer Acceleration. Since both can improve the download speed(though S3 Transfer Acceleration is mainly for uploading, it also improving download), can I use them together? Based on my test, it seems to be impossible as CloudFront will always take the S3 bucket URL like xxx.s3.amazonaws.com/ as the source. It cannot take xxx.s3-accelerate.amazonaws.com as the source.
Amazon CloudFront caches content in 225+ Points of Presence.
The first user who requests a piece of content in a particular location will trigger the edge location to 'pull' the content from the origin. Future requests for that content will be served from the cache. It is an excellent way to reduce latency for users spread around the world.
Amazon S3 Transfer Acceleration always makes a request back to the source bucket. This is good for uploading, but does not reduce latency for users spread around the world since all of their requests would need to go to the source bucket.
You might be able to have CloudFront in front of S3 Transfer Acceleration, but CloudFront uses the AWS network to reach origin buckets, so it is unlikely to make any difference. If you do experiment with this, let us know your findings!

why aws s3 transfer acceleration is not working?

I have to upload some files that are between 3 and 7Gb to s3. The default upload speed when using the AWS Console is about 1.3 Mbs. I read about transfer acceleration here:
https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration-examples.html#transfer-acceleration-examples-aws-cli
So I followed the steps:
Turn on transfer acceleration on the bucket, in the console. Then...
aws s3api put-bucket-accelerate-configuration --bucket [bucket name] --accelerate-configuration Status=Enabled
aws configure set default.s3.use_accelerate_endpoint true
aws s3 cp some_file.txt s3://[bucket]/some_file.txt --region us-east-1 --endpoint-ur http://[bucket].s3-accelerate.amazonaws.com
It uploads still at the same 1.3 Mbs. I am WFH so subject to Wifi, but still I wish it could be better. Is there anything else? Do I need to use Python boto3? I was hoping this would be quicker.
From Amazon S3 Transfer Acceleration - Amazon Simple Storage Service:
Amazon S3 Transfer Acceleration enables fast, easy, and secure transfers of files over long distances between your client and an S3 bucket. Transfer Acceleration takes advantage of Amazon CloudFront’s globally distributed edge locations. As the data arrives at an edge location, data is routed to Amazon S3 over an optimized network path.
Basically, instead of traversing the Internet to get to the AWS endpoint, traffic is directed to the closest Edge Location and then goes across the Amazon network to the desired region.
If your closest Edge Location is in the same location as an AWS Region, then you will gain no benefit from using Amazon S3 Transfer Acceleration. This is because the traffic will follow exactly the same path.
You can use the Amazon S3 Transfer Acceleration Speed Comparison tool to test whether it provides additional speed.
You might check your maximum upstream bandwidth with a speed-tester like google's. That'll set an upper bound for the maximum upload speed you can expect.

How does Amazon S3 Transfer Acceleration accelerate S3 file transfers?

I'm not clear how Amazon S3 Transfer Acceleration accelerates S3 file transfers.
I've been using https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html to refer to.
Supposing there is fileA in us-east-1, a user A in the UK, and there's a link to that fileA S3 endpoint.
Here's my understanding of how it works:
Before enabling Amazon S3 Transfer Acceleration user A would click on that link to fileA and it might take 10 seconds.
After enabling Amazon S3 Transfer Acceleration user A would click on that link to fileA and it might take 7 seconds.
I'm not clear how Amazon would achieve that reduction in time. It still has to get from the bucket to the user and goes over the public internet.
Or does Amazon intercept the link, move the file to a local CDN server in the meantime, then return a 302 to the new file location?
Under Amazon S3 Transfer Acceleration, the user is directed to the closest AWS endpoint and the request travels across the AWS network, which would have less hops and less traffic than the normal Internet.
Content is not cached.
From Amazon S3 Transfer Acceleration - Amazon Simple Storage Service:
Amazon S3 Transfer Acceleration enables fast, easy, and secure transfers of files over long distances between your client and an S3 bucket. Transfer Acceleration takes advantage of Amazon CloudFront’s globally distributed edge locations. As the data arrives at an edge location, data is routed to Amazon S3 over an optimized network path.
According the the Amazon S3 FAQ, Amazon S3 Transfer Acceleration leverages Amazon CloudFront’s globally distributed AWS Edge Locations. As data arrives at an AWS Edge Location, data is routed to your Amazon S3 bucket over an optimized network path.
However, this will not always lead to an increase in transfer speed. Each time you use S3 Transfer Acceleration to upload an object, AWS will check whether S3 Transfer Acceleration is likely to be faster than a regular Amazon S3 transfer. If AWS determines that S3 Transfer Acceleration is not likely to be faster than a regular Amazon S3 transfer of the same object to the same destination AWS Region, they will not charge for the use of S3 Transfer Acceleration for that transfer, and may bypass the S3 Transfer Acceleration system for that upload.

S3 Transfer Acceleration Semantics

I have a rather simple question which I cannot find an explicit answer to, but anyone using the subject should be able to answer.
Does S3 Transfer Acceleration follow an eventual model i.e. clients upload to a CF edge location, get the response back and then the data is eventually moved to a bucket OR is the performance (speed) gain is simply because of the AWS internal network usage and upon the request completion the data is always 100% IN the S3 bucket?
If it's the former is there any SLA regarding how fast this eventual process is?
S3 Transfer Acceleration uses CloudFront and CloudFront doesn't cache POST/PUT request which means the data gets uploaded to the S3 at the same time. CloudFront doesn't buffer it, it simply saves your RTT (round trip time) by letting you connect to the nearest edge location compare to when you connect to S3 endpoint situated far from you.
And, since transfer between CloudFront and S3 is in AWS Network, it should be faster.
(buffer in the sense you can consider Acceleration endpoint as proxy).
S3 Transfer Acceleration uses portions of the CloudFront infrastructure to provide low-latency, performance-optimized connectivity from browser to edge to bucket.
It does not use any storage or caching components of CloudFront.
The acceleration is only TLS and transport (buffer and routing) related; all HTTP interactions are ultimately end-to-end with the actual S3 bucket, with CloudFront edge servers providing termination for the browser-facing TLS session and a reverse-proxy function.
Nothing stored outside the bucket, so S3's standard consistency model applies.