This section covers two additional storage and content delivery services that are important for a Solutions Architect to understand: Amazon CloudFront and AWS Storage Gateway.
Amazon CloudFront Amazon CloudFront is a global Content Delivery Network (CDN) service. It integrates with other AWS products to give developers and businesses an easy way to distribute content to end users with low latency, high data transfer speeds, and no minimum usage commitments.
Overview A Content Delivery Network (CDN) is a globally distributed network of caching servers that speed up the downloading of web pages and other content. CDNs use Domain Name System (DNS) geo-location to determine the geographic location of each request for a web page or other content, then they serve that content from edge caching servers closest to that location instead of the original web server.
A CDN allows you to increase the scalability of a website or mobile application easily in response to peak traffic spikes. In most cases, using a CDN is completely transparent-end users simply experience better website performance, while the load on your original website is reduced. Amazon CloudFront is AWS CDN. It can be used to deliver your web content using Amazon’s global network of edge locations.
Finally, Amazon CloudFront supports media streaming, using both HTTP and RTMP.
Distributions To use Amazon CloudFront, you start by creating a distribution, which is identified by a DNS domain name such as
To serve files from Amazon CloudFront, you simply use the distribution domain name in place of your website’s domain name; the rest of the file paths stay unchanged. You can use the Amazon CloudFront distribution domain name as-is, or you can create a user-friendly DNS name in your own domain by creating a CNAME record in Amazon Route 53 or another DNS service. The CNAME is automatically redirected to your Amazon CloudFront distribution domain name. Origins When you create a distribution, you must specify the DNS domain name of the origin-the Amazon S3 bucket or HTTP server-from which you want Amazon CloudFront to get the definitive version of your objects (web files). For example: Amazon 83 bucket: myawsbucket.s3.amazonaws.com
Amazon EC2 instance: ec2-203-0-113-25.compute-1.amazonaws.com Elastic Load Balancing load balancer: my-load-balancer-1234567890.uswest- 2.elb.amazonaws.com Website URL: mywebserver.mycompanydomain.com Cache Control Once requested and served from an edge location, objects stay in the cache until they expire or are evicted to make room for more frequently requested content. By default, objects expire from the cache after 24 hours.
Once an object expires, the next request results in Amazon CloudFront forwarding the request to the origin to verify that the object is unchanged or to fetch a new version if it has changed. Optionally, you can control how long objects stay in an Amazon CloudFront cache before expiring. To do this, you can choose to use Cache-Control headers set by your origin server or you can set the minimum, maximum, and default Time to Live (TTL) for objects in your Amazon CloudFront distribution. You can also remove copies of an object from all Amazon CloudFront edge locations at any time by calling the invalidation Application Program Interface (API).
This feature removes the object from every Amazon CloudFront edge location regardless of the expiration period you set for that object on your origin server. The invalidation feature is designed to be used in unexpected circumstances, such as to correct an error or to make an unanticipated update to a website, not as part of your everyday workflow. Instead of invalidating objects manually or programmatically, it is a best practice to use a version identifier as part of the object (file) path name.