Architecture - Amazon CloudFront for Media

Architecture

CloudFront uses a global network of Points of Presence (PoPs) and Regional Edge Caches (RECs), providing global access for your viewers. AWS continues to extend CloudFront based on growth and anticipated customer needs. Availability is one of the high-priority design tenets of CloudFront. Metropolitan areas have the highest concentration of traffic, and CloudFront provides multiple edge locations for scale and performance. These locations are deployed in different facilities to provide a high degree of resilience. A cluster of edge locations in a single area gives CloudFront the ability to route viewers quickly to another location in close proximity without noticeable performance impact.

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, which connects AWS Regions and edge locations.

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. This allows you to scale further without a corresponding increase in load at the origin, and to maintain a high cache hit ratio. This mid-tier layer is known as a Regional Edge Cache (REC). Upon a cache miss, an edge location will initiate a request to its associated REC before going to the origin. The REC adds a layer of content consolidation where the volume of requests going to the origin is reduced as requests for the same content from different edge locations can be retrieved from the same REC. RECs can increase a video streaming object's retention time due to its larger cache storage and this provides another advantage of using CloudFront for large VOD video catalogs.

Reference architecture diagram for Amazon CloudFront for media delivery

Figure 2 – Amazon CloudFront architecture

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: