Are there use cases that lend themselves better to Amazon cloudfront over s3 or the other way around? I'm trying to understand the difference between the 2 through examples.
Amazon-web-services – When to use Amazon Cloudfront or S3
amazon s3amazon-cloudfrontamazon-web-services
Related Topic
- Amazon-web-services – Amazon SimpleDB vs Amazon DynamoDB
- Correct S3 + Cloudfront CORS Configuration
- Amazon CloudFront Doesn’t Respect My S3 Website Bucket’s index.html Rules
- R – What are common Windows service design patterns
- Amazon-web-services – How to set a default root object for subdirectories for a statically hosted website on Cloudfront
Best Answer
Amazon S3 is designed for large-capacity, low-cost file storage in one specific geographical region.* The storage and bandwidth costs are quite low.
Amazon CloudFront is a Content Delivery Network (CDN) which proxies and caches web data at edge locations as close to users as possible.
The data served by CloudFront may or may not come from S3. Since it is more optimized for delivery speed, the bandwidth costs a little more.
If your user base is localized, you won't see too much difference working with S3 or CloudFront (but you have to choose the right location for your S3 bucket: US, EU, APAC). If your user base is spread globally and speed is important, CloudFront may be a better option.
Both S3 and CloudFront allow domain aliases, however CloudFront allows multiple aliases so that
d1.mystatics.com
,d2.mystatics.com
andd3.mystatics.com
could all point to the same location increasing the capacity for parallel downloads (this used to be recommended by Google but with the introduction of SPDY and HTTP/2 is of lesser importance).CloudFront also supports CORS as of 2014 (thanks sergiopantoja).
* Note: S3 can now automatically replicate to additional regions as of 2015.