Learn about Amazon CloudFront (CDN)

Tram Ho

1. Content Delivery Network (CDN)

A Content Delivery Network (CDN) or content delivery network is a group of servers located in different left locations to support content spread across different geographic locations.

CDN is also called “distribution networks”. The idea is to create multiple points of access (Point of Presence (PoPs) outside the original server. This helps the website better manage traffic by faster processing of customer requests, increasing user experience.

The content here is the text and image elements of the website: text, images, audio files, videos, …

There are 2 types of content: dynamic and static. Static content is the original content (input) is also the last content others see (output). It doesn’t change over time because of user influence. The server will transmit the same data to everyone. The process is that the user requests file A from the web server, and the server will return file A.

Dynamic content is content that will change based on input data. It is personalized on each page, depending on the user’s input. An example of dynamic content is the product page containing the product name, product description, and price, including images. Another example is a web display that interacts directly with the user in order to send the user relevant information.

2. Amazon CloudFront

CloudFront is an ultra-high-speed CDN service that Amazon provides to distribute data, videos, applications, APIs at a global level while ensuring security.

Amazon CloudFront supports both IPv4 and IPv6

2.1 Egde Location

CloudFront stores and distributes data through data centers around the world, known as Edge locations. These Edge Locations are where End-Users can access the AWS service.

Amazon currently places Edge Locations in 65 cities in over 29 countries, specifically with around 155 edge locations, acting as a long-term cache for the system’s servers.

=>

  • Reduce the latency when requesting and receiving data
  • High data transfer rate

Edge Locations are connected through Amazon Backbone Network with 99.9% SLA (Service-level agreement)

2.2 Resources

Resources supported by CloudFront include:

  • Images
  • Style Sheet
  • Javascript Files
  • Installations, patches are downloaded
  • Video Streaming: Live and In- Demand
  • API: Moblile and Desktop
  • Application

2.3 Confidentiality

CloudFront provides a number of security mechanisms as follows:

  • AWS Shield, AWS Web Application Firewal (WAF)
  • Supports https and SSL / TLS
  • Field-level encryption: Pack a number of fields and encrypt them until the request reaches an authorized service in your application.
  • Geo Restriction: Allows to prevent requests coming from a certain geographical area
  • Invalidiation API: Allow to remove some Objects from Request (Note: Can’t invalid objects of RTMP distribution (Real-Time Messaging Protocol)

2.4 Some services are often combined with CloudFront

Some other AWS services can be combined with CloudFront

Combining with services will help you optimize the quality of the system and save costs.

In addition, [email protected] is a service that uses Lambda functions to manually customize content at Egde Location based on attributes in the request. This helps you to take advantage of the data, at each different Edge Location and also customize the responses.

Like other CDN services, CloudFront also supports activity statistics and reports:

  • Request & data tranfer trends
  • Error Rate
  • Cache statistics
  • Access logs

There are 3 features of CloudFront that can assist you in the system’s business through these reports

  • Popular Objects: The most used resources
  • Viewer: Location statistics, browser / OS, device (Desktop, mobile, …)
  • Referrer: Where does the traffic on the system come from?

2.5 How it works

First use CloudFront to specify the Origin Server, this is the place to store content, for example S3 or your own Server. This will be where CloudFront takes the data and then distributes it to Edge Locations around the world.

When a request arrives, Edge Locations will return the data as long as the necessary data is being cached on that Edge Locations. If not, CloudFront will request to Origin Server to get that data, save it in Edge Location’s cache and return the request data.

These Origin Servers can also indicate Origin Server backups (one or more). CloudFront will automatically Scales based on usage of that Content, helping to reduce the load for an origin server to increase user experience.

CloudFront will automatically route requests to the most appropriate location based on the request’s starting location to deliver the fastest performance possible.

Reference source:

https://app.pluralsight.com/library/courses/aws-network-design-getting-started

https://aws.amazon.com/cloudfront/

https://www.hostinger.vn/huong-dan/cdn-la-gi/

http://hanhtranglaptrinh.vn6.vn/toi-uu-amazon-s3-voi-amazon-cloudfront/

https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_Origin.html

Share the news now

Source : Viblo