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.
New Content: AWS Terraform, Java Programming Lab Challenges, Azure DP-900 & DP-300 Certification Exam Prep, Plus Plenty More Amazon, Google, Microsoft, and Big Data Courses
This month our Content Team continues building the catalog of courses for everyone learning about AWS, GCP, and Microsoft Azure. In addition, this month’s updates include several Java programming lab challenges and a couple of courses on big data. In total, we released five new learning...
Where Should You Be Focusing Your AWS Security Efforts?
Another day, another re:Invent session! This time I listened to Stephen Schmidt’s session, “AWS Security: Where we've been, where we're going.” Amongst covering the highlights of AWS security during 2020, a number of newly added AWS features/services were discussed, including: AWS Audit...
AWS re:Invent: 2020 Keynote Top Highlights and More
We’ve gotten through the first five days of the special all-virtual 2020 edition of AWS re:Invent. It’s always a really exciting time for practitioners in the field to see what features and services AWS has cooked up for the year ahead. This year’s conference is a marathon and not a...
WARNING: Great Cloud Content Ahead
At Cloud Academy, content is at the heart of what we do. We work with the world’s leading cloud and operations teams to develop video courses and learning paths that accelerate teams and drive digital transformation. First and foremost, we listen to our customers’ needs and we stay ahea...
Excelling in AWS, Azure, and Beyond – How Danut Prisacaru Prepares for the Future
Meet Danut Prisacaru. Danut has been a Software Architect for the past 10 years and has been involved in Software Engineering for 30 years. He’s passionate about software and learning, and jokes that coding is basically the only thing he can do well (!). We think his enthusiasm shines t...
New Content: AWS Data Analytics – Specialty Certification, Azure AI-900 Certification, Plus New Learning Paths, Courses, Labs, and More
This month our Content Team released two big certification Learning Paths: the AWS Certified Data Analytics - Speciality, and the Azure AI Fundamentals AI-900. In total, we released four new Learning Paths, 16 courses, 24 assessments, and 11 labs. New content on Cloud Academy At any ...
New Content: Azure DP-100 Certification, Alibaba Cloud Certified Associate Prep, 13 Security Labs, and Much More
This past month our Content Team served up a heaping spoonful of new and updated content. Not only did our experts release the brand new Azure DP-100 Certification Learning Path, but they also created 18 new hands-on labs — and so much more! New content on Cloud Academy At any time, y...
AWS Certification Practice Exam: What to Expect from Test Questions
If you’re building applications on the AWS cloud or looking to get started in cloud computing, certification is a way to build deep knowledge in key services unique to the AWS platform. AWS currently offers 12 certifications that cover major cloud roles including Solutions Architect, De...
Overcoming Unprecedented Business Challenges with AWS
From auto-scaling applications with high availability to video conferencing that’s used by everyone, every day — cloud technology has never been more popular or in-demand. But what does this mean for experienced cloud professionals and the challenges they face as they carve out a new p...
Constant Content: Cloud Academy’s Q3 2020 Roadmap
Hello — Andy Larkin here, VP of Content at Cloud Academy. I am pleased to release our roadmap for the next three months of 2020 — August through October. Let me walk you through the content we have planned for you and how this content can help you gain skills, get certified, and...
New Content: Alibaba, Azure AZ-303 and AZ-304, Site Reliability Engineering (SRE) Foundation, Python 3 Programming, 16 Hands-on Labs, and Much More
This month our Content Team did an amazing job at publishing and updating a ton of new content. Not only did our experts release the brand new AZ-303 and AZ-304 Certification Learning Paths, but they also created 16 new hands-on labs — and so much more! New content on Cloud Academy At...
Blog Digest: Which Certifications Should I Get?, The 12 Microsoft Azure Certifications, 6 Ways to Prevent a Data Breach, and More
This month, we were excited to announce that Cloud Academy was recognized in the G2 Summer 2020 reports! These reports highlight the top-rated solutions in the industry, as chosen by the source that matters most: customers. We're grateful to have been nominated as a High Performer in se...