Amazon CloudFront: A brief introduction to the problem of optimizing web content delivery…and the AWS’s solution.
We’re going to learn about Amazon CloudFront and how to make it work for you. First, since CloudFront is a kind of content delivery network (CDN), it’s probably worthwhile spending a bit of time discussing exactly how CDNs work, and what they do.
Brief introduction to CDNs
The idea of a content delivery network (sometimes called a content distribution network) is nothing new. It’s really nothing more than a set of servers distributed across the Internet to serve highly available, high performance content to end-users.
The primary goal of a CDN is delivering content from providers (like media companies) to their audiences as quickly and reliably as possible. The model works by delivering content from the CDN server closest to the users who will consume it, thereby eliminating as many network hops as possible.
Among other advantages, a CDN can:
- Offload traffic served directly from the content provider’s origin infrastructure.
- Help manage denial-of-service attacks by absorbing some of the traffic.
- Offer higher availability, lower network latency, and lower packet loss.
- Sometimes reduce your hosting costs.
- Handle increased numbers of concurrent users.
If there are advantages, there will be some negatives too:
- Lock-in dependency on a single CDN provider for support availability.
- Lock-in dependency on a single CDN provider for infrastructure availability.
- Not all CDN providers will have data centers in exactly the geographic locations you need them for each of your projects.
The CDN market has many active providers, including CloudFare, Akamai Technologies, and Limelight Networks.
So we’ve described CDNs and some of the major players. But there’s someone really obvious we’ve left out.
As the cloud continues to dominate application and content delivery, Amazon Web Services continues to dominate the cloud. There can’t be many providers who haven’t at least considered moving their operations to the AWS cloud. At the same time, AWS works hard to understand its customers’ requirements and wants to be able to provide an environment that addresses all their needs. Since distributed content delivery is a common need, it only makes sense that AWS would offer CloudFront: a fully integrated solution.
To achieve the low latency connections providers need, CloudFront uses a global network of edge locations:
How Amazon CloudFront works
Getting started with Amazon CloudFront is quick and simple. Let’s see what has to be done to configure CloudFront.
- The first step is to decide on an origin server. Like all CDN providers, CloudFront requires you to define the server hosting the content you want CloudFront to deliver across the distributed network. The origin server can be an S3 bucket or an HTTP server (either based in Amazon’s EC2 or locally in your own datacenter).
- Next, you will upload your content to the origin server. Anything that can be served over HTTP or a supported version of Adobe RTMP can be used. Typically, the content consists of web pages, images, and media files (video and audio).
- The next step is the most important one. You will need to create a distribution. There are two kinds of distribution that you can create: web distributions for HTTP/HTTPS, and RTMP Distributions for RTMP and its variants. Distributions are the way you tell CloudFront what content to use and what to do with it.
- If you want your content to be delivered over either HTTP or HTTPS, select a Web distribution, but if your deployment involves real-time data using RTMP protocols, then you should choose an RTMP distribution.
- You can create URL-matching rules for your distributions. For example, you could decide that any request that includes the string “/books/*” should fetch data from your HTTP server, but a request containing “/author/*” should go to S3.
- Finally, use the domain name endpoint that CloudFront gives you as URLs through which your users can access your content.
Note: You can fine-tune your distribution by setting values like the expiration time for files to remain in cache before they are refreshed, and which groups of CloudFront edge locations you’d like to use (i.e., US only, US and Europe, or all locations).
Once the setup is ready, your Amazon CloudFront distribution is ready to serve requests. Your DNS service will route a request from your end user to the CloudFront endpoint URL, and CloudFront will send it to the edge location that can best serve the user’s request. CloudFront first checks its cache for the requested files, if it’s there it’s all good. But if it’s not found in the cache, it checks your distribution configuration and forwards the request to the origin server.
This diagram can help to visualize the process:
Important Amazon CloudFront features
Besides the more obvious features we’ve already seen, with Amazon CloudFront, you can also:
- Enable AWS WAF (Web Application Firewall) which can help secure your content.
- Engage in many e-commerce activities, since CloudFront is PCI DSS Compliant.
- Configure the default TTL & Max TTL values (to control how long CloudFront will hold items in cache).
- Invalidate Multiple Objects.
- Add signed cookies for private content.
- Add support for advanced SSL features: Perfect Forward Secrecy, OCSP Stapling, and Session Tickets.
- Use CloudFront as part of the AWS Free Usage Tier.
I hope this blog was able to satisfy at least your initial curiosity about Amazon CloudFront. This is an exciting and useful area and I strongly encourage you to investigate the free 7-day trial subscription from Cloud Academy. They offer multiple learning products on this very topic:
- Video Course: Working with Amazon CloudFront features
- Multiple Quizzes: Various Difficulty Levels of AWS CloudFront Quiz
- Hands-on Labs: Serve Your Files Using The CloudFront CDN
I’ve tried to inspire your desire for greater learning. I haven’t attempted a deep dive because that must requires greater time and space than this blog offers. What I’d like you to take away from reading this post is a familiarization with the way that AWS handles the problem of fast and efficient content delivery. Maybe you are motivated to dig deeper with Cloud Academy’s labs, video courses or quizzes. Cloud Academy labs let learners work in a real AWS environment without setting up an AWS account. So take the trial and see what you think.
Feedback is critical to us, so let me know what you think and where we can do better.
AWS Certified Solutions Architect Associate: A Study Guide
The AWS Solutions Architect - Associate Certification (or Sol Arch Associate for short) offers some clear benefits: Increases marketability to employers Provides solid credentials in a growing industry (with projected growth of as much as 70 percent in five years) Market anal...
Moving Data to S3 with Apache NiFi
Moving data to the cloud is one of the cornerstones of any cloud migration. Apache NiFi is an open source tool that enables you to easily move and process data using a graphical user interface (GUI). In this blog post, we will examine a simple way to move data to the cloud using NiFi c...
Amazon DynamoDB: 10 Things You Should Know
Amazon DynamoDB is a managed NoSQL service with strong consistency and predictable performance that shields users from the complexities of manual setup.Whether or not you've actually used a NoSQL data store yourself, it's probably a good idea to make sure you fully understand the key ...
The 11 AWS Certifications: Which is Right for You and Your Team?
As companies increasingly shift workloads to the public cloud, cloud computing has moved from a nice-to-have to a core competency in the enterprise. This shift requires a new set of skills to design, deploy, and manage applications in cloud computing.As the market leader and most ma...
Aviatrix Integration of a NextGen Firewall in AWS Transit Gateway
Learn how Aviatrix’s intelligent orchestration and control eliminates unwanted tradeoffs encountered when deploying Palo Alto Networks VM-Series Firewalls with AWS Transit Gateway.Deploying any next generation firewall in a public cloud environment is challenging, not because of the f...
AWS Config Best Practices for Compliance
Use AWS Config the Right Way for Successful ComplianceIt’s well-known that AWS Config is a powerful service for monitoring all changes across your resources. As AWS Config has constantly evolved and improved over the years, it has transformed into a true powerhouse for monitoring your...
Cloud Academy is Coming to the AWS Summits in Atlanta, London, and Chicago
Cloud Academy is a proud sponsor of the 2019 AWS Summits in Atlanta, London, and Chicago. We hope you plan to attend these free events that bring the cloud computing community together to connect, collaborate, and learn about AWS. These events are all about learning. You can learn how t...
How to Monitor Your AWS Infrastructure
The AWS cloud platform has made it easier than ever to be flexible, efficient, and cost-effective. However, monitoring your AWS infrastructure is the key to getting all of these benefits. Realizing these benefits requires that you follow AWS best practices which constantly change as AWS...
AWS EC2 Instance Types Explained
Amazon Web Services’ resource offerings are constantly changing, and staying on top of their evolution can be a challenge. Elastic Cloud Compute (EC2) instances are one of their core resource offerings, and they form the backbone of most cloud deployments. EC2 instances provide you with...
How DNS Works – the Domain Name System (Part One)
Before migrating domains to Amazon's Route53, we should first make sure we properly understand how DNS worksWhile we'll get to AWS's Route53 Domain Name System (DNS) service in the second part of this series, I thought it would be helpful to first make sure that we properly understand...
Multiple AWS Account Management using AWS Organizations
As businesses expand their footprint on AWS and utilize more services to build and deploy their applications, it becomes apparent that multiple AWS accounts are required to manage the environment and infrastructure. A multi-account strategy is beneficial for a number of reasons as ...
WaitCondition Controls the Pace of AWS CloudFormation Templates
AWS's WaitCondition can be used with CloudFormation templates to ensure required resources are running.As you may already be aware, AWS CloudFormation is used for infrastructure automation by allowing you to write JSON templates to automatically install, configure, and bootstrap your ...