Architecture
CloudFront uses a
global
network of Points of Presence (PoPs) and Regional Edge
Caches
CloudFront edge locations have multiple connections to local
Internet Service Providers (ISPs) and global carriers through
internet exchanges and direct private fiber connections. This
minimizes video delivery latency, reduces probability of
congestion and traffic loss, and provides high availability. Edge
locations also leverage the
AWS global
network
The AWS global network provides high bandwidth, resilience and redundancy at scale. This gives you consistent performance, high availability and shields your viewers from internet instabilities and changing conditions.
The quality of the connection from the origin to the edge location is just as important as the proximity of the edge location to the viewer, providing low latency and avoiding re-buffering, which is a factor in reducing viewer churn. AWS works closely with our customers to understand their current and future traffic patterns to guide further expansion with new edge locations and scaling of existing locations. This can be particularly relevant when planning the launch of your video platform in a new geographic region or anticipating high peak events.
The CloudFront architecture includes a
mid-tier
caching layer between your origin and the edge locations
CDN requirements for media delivery often extend beyond performant and scalable delivery to the viewers. Media applications often adapt the content for different viewers or device platforms, provide security controls for paywall content, or add other customizations based on the request from the viewer.
You can write your own code to further customize the processing of HTTP requests and responses by associating an edge function with your CloudFront distribution. To minimize latency, edge functions will run close to your viewers. You can select from two different types of edge functions based on your use case:
-
For complex, compute-heavy use cases, Lambda@Edge
gives you the ability to run JavaScript or Python code in a regional edge cache, usually in the AWS Region closest to the CloudFront edge location that received the viewer request. Examples of using Lambda@Edge in media delivery include filtering live streaming renditions by device type at the Edge and on-the-fly video conversion from MP4 to HLS . For additional examples, see Lambda@Edge example functions in the CloudFront Developer Guide. -
For lightweight, latency-sensitive use cases, CloudFront Functions can be used to execute lightweight JavaScript code at CloudFront edge locations
at approximately one-sixth of the price of Lambda@Edge. Some common use cases for CloudFront Functions are cache-key manipulations and normalization, URL rewrites and redirects, HTTP Header manipulation, and access authorization. For more examples, see Example code for CloudFront Functions.