Introduction:
🚀 Welcome to Day 18 of our exhilarating 30 Days of AWS series! Today, we’re about to embark on an exciting journey into the cloud, as we delve deep into the AWS CloudFront service. 🌐✨ Get ready to unravel the magic behind Content Delivery Networks (CDN) and discover how CloudFront plays a pivotal role in delivering content at lightning speed around the globe! 🚀
💡 Buckle up as we explore key points, uncover features, and demystify the mechanisms that make AWS CloudFront a game-changer in the world of cloud computing. Let’s make your applications faster, more secure, and seamlessly distributed worldwide! 🌍🔐 #AWS #CloudFront #CDNExploration #30DaysOfAWS 🚀
Agenda:
- Introduction
- What is CDN
What is CDN?
CDN stands for the Content Delivery Network. A CDN is a network of interconnected servers that speed up webpage loading for data-heavy applications.
Now there is the question in your mind why do we need the CDN??
Why?
Let’s understand by one scenario- Imagine you have a website with lots of content like images, videos, and documents and you host in Mumbai,
Now one user from Europe is accessing your website then he gets high latency in accessing your content because your server is deployed in the Mumbai region and Europe is away from Mumbai so it takes time to load data to reduce the latency we use the CDN.
In short, CDN is used for Reducing the Latency.
Here is one Image from this you can understand.
How does it work?
A CDN is like a network of servers spread across various locations worldwide. These servers store a copy of your website content when a user requests your website the content is delivered from the server's closet to the users, making it super fast! It is like having a local store for your website content everywhere in the world.
AWS Cloud Front:
- Cloud Front is a global service.
- Amazon Cloud Front is a web service that speeds up the distribution of your static and dynamic web content, such as HTML CSS js and image files to users.
- Cloud Front delivers your content through a worldwide network of data centres called Edge Location.
- When you request content served with CloudFront, you are automatically routed to the edge location that provides the lowest latency, ensuring that your content is delivered with optimal performance.
- If the content is already in the Edge location with the lowest latency, Cloud Front delivers it immediately.
- This dramatically reduces the number of networks that your user’s request must pass through which improves performance.
- if not Cloud Front retrieves it from an Amazon S3 bucket or an HTTP/ Web Server that you have identified as the source for the definitive version of your content.
- Cloud Front also keeps persistent connections with origin Servers so files are fetched from the origins as quickly as possible.
Ways to Access Cloud Front:
- AWS Management Console
- AWS SDK’s
- Cloud Front API
- AWS Command Line Interface
Edge Location:
- Edge locations are not tied to availability zones.
- CloudFront utilizes a global network of servers known as “Edge Locations” to cache and distribute content closer to the end-users, thereby reducing latency and improving overall performance.
- These are the points of presence strategically located around the world. They serve as caching servers that store copies of your content. When a user requests content, CloudFront delivers it from the nearest edge location, optimizing speed and reducing latency.
- Amazon Cloud Front has 216 points of presence (205 Edge locations and 11 Regional Edge Cache ) in 84 cities across 42 countries.
Regional Edge Cache:
Regional Edge Cache refers to a type of content delivery network (CDN) architecture that stores cached content at the edge of the network, closer to end users, to improve content delivery performance. It involves deploying cache servers in various regions around the world, allowing for faster content delivery to users within those regions.
How AWS Cloud Front Works:
Let this be understood by one example:
Suppose you deployed one website to the Mumbai server and it is properly working after some days one client from the UK accessing that website and that client gets high latency while accessing.
So what we will do we will use the AWS cloud front service
First, we deployed our website using the AWS Cloud front, Cloud front has 205 edge locations across the world, now if a person accesses the website then it goes first to the nearest edge location and provides the response and it stores this content in it for 24 hours. After that in 24 hours there is no request for that content then it automatically deletes from the Egde location and transfers to the Regional Edge Cache.
Let’s Do practical for this one:
- Go to the AWS Management console and Navigate to Cloud Front Service
- Before that let’s build one S3 bucket because we need one source for accessing the content.
- Navigate to the S3 bucket and Create one Bucket.
- Here you will see this type of interface now click on the Create Bucket.
- Here give the name of your bucket.
- Last but not least click on the bucket.
- Congrats our first step is completed.
- Now Click on that bucket and upload one picture or any HTML file for accessing
- Note: Remember that file name.
- Here I am uploading one image for access.
- Click on the upload button,click on the add file and upload it.
- Now Navigate to the Cloud front service.
- Click on the Create a Cloud Front Distribution.
- In the origin domain select your S3 bucket that you recently created.
- Now select the Origin Access Control Settting
- Click on the Create Control Setting.
- Click on the Create
- Leave other as deagult
- Click on the Create Distribution
- Now You will see this type of interface.
- Copy policy and click on the Go to S3 bucke permission to update policy
- In the bucket policy paste the policy that you copyied.
- And save changes.
- Here you can see our Cloud Front Status is in Deploying wait for some seconds.
- Now copy the distribution domain and paste to the web browser.
- After pasting your domain name write your file name that you upload to the S3 bucket.
- You can access your file.
- That all from my side.
Thanks for reading this blog.It help you then share with your friends.
Happy Learning:))
Github Profile:
[PurushotamSharma - Overview
Purusing MCA from Charusat University. PurushotamSharma has 39 repositories available. Follow their code on GitHub.github.com](https://github.com/PurushotamSharma "github.com/PurushotamSharma")
Github Repo for 30 Days of AWS
https://github.com/PurushotamSharma/30-Days-of-AWS-Adventure-