Amazon Cloudfront For Media
Amazon Cloudfront For Media
November 2020
Notices
Customers are responsible for making their own independent assessment of the
information in this document. This document: (a) is for informational purposes only, (b)
represents current AWS product offerings and practices, which are subject to change
without notice, and (c) does not create any commitments or assurances from AWS and
its affiliates, suppliers or licensors. AWS products or services are provided “as is”
without warranties, representations, or conditions of any kind, whether express or
implied. The responsibilities and liabilities of AWS to its customers are controlled by
AWS agreements, and this document is not part of, nor does it modify, any agreement
between AWS and its customers.
© 2020 Amazon Web Services, Inc. or its affiliates. All rights reserved.
Contents
Introduction ..........................................................................................................................1
Streaming techniques for media .........................................................................................1
Common elements of streaming technologies ................................................................2
Architecture of media workflows .........................................................................................4
Encoding and packaging..................................................................................................6
The origin ..........................................................................................................................6
The content delivery network ...........................................................................................7
Reference solutions .........................................................................................................7
CDN features for media delivery .........................................................................................8
Architecture ......................................................................................................................8
Request handling and protocol optimizations .................................................................9
CloudFront configuration best practices ........................................................................13
Cost optimization ............................................................................................................16
CloudFront Origin Shield................................................................................................16
Security ..............................................................................................................................17
Geographical restriction .................................................................................................17
Access control through CloudFront ...............................................................................18
Session uniqueness .......................................................................................................21
Multi-CDN considerations..................................................................................................21
Operational monitoring and reporting ...............................................................................23
Best practices for events and service launches ...............................................................25
Conclusion .........................................................................................................................26
Contributors .......................................................................................................................27
Document revisions ...........................................................................................................27
Abstract
This whitepaper is for media organizations interested in delivering streaming media
content to their viewers using Amazon CloudFront. Media delivery has a unique set of
characteristics requiring low latency, high reliability, and high scalability. This
whitepaper discusses live streaming and video on-demand workflows, as well as
streaming techniques, content delivery networks (CDNs), and why CDNs are important
for media delivery. It also includes best practices for end-to-end system design using
Amazon CloudFront and AWS Media Services.
Amazon Web Services Amazon CloudFront for Media
Introduction
This whitepaper is a guide for using Amazon CloudFront to successfully deliver high-
quality media experiences at scale. It is intended for media architects, streaming
architects, network architects, and CDN operations teams.
Delivering media content over the internet at scale poses a unique set of challenges for
architects and platform operators. End customers expect the highest-quality experience
with reliable delivery, low startup latency, and the ability to choose from a wide range of
content. Live streaming magnifies the challenges of maintaining consistent low latency
and reliable delivery, with sharp peaks in demand for popular content. Media operators
also need to ensure that content is secure in order to protect rights holders as well as
their own revenue and reputation.
Amazon CloudFront is a CDN platform that securely delivers video, data, applications,
and API operations to customers globally with low latency, high transfer speeds, and
with a developer-friendly environment. CloudFront is integrated with AWS services and
physical locations that are directly connected to the AWS Global Infrastructure. Media
workloads in this context include live streaming and video on demand (VOD) content
delivered over the internet.
In both scenarios, media platforms use streaming protocols to allow end customers to
view the media without having to download the content in its entirety. Within live
streaming, we include events and 24/7 channels. Delivery for linear TV platforms, or
closed networks, have slightly different considerations. But share some similarity with
the media architectures described in this whitepaper. To discuss how AWS enables
these types of solutions, contact an Amazon Web Services sales representative.
1
Amazon Web Services Amazon CloudFront for Media
The ABR experience is superior to delivering a static video file at a single bitrate. This is
because the video stream can be switched midstream to be as good as the available
network bandwidth allows. This ability to switch avoids buffering or interruption in
playback that can happen when client’s network speed can’t support a particular bitrate.
All streaming techniques divide a video stream into a series of smaller segments. This
allows a player to begin video playback as soon as possible after receiving data.
Streaming techniques for the internet differ from streaming over closed networks
because there is no guaranteed bitrate available at the client, and they must be able
cope with changes in the available bitrate as seen by the viewer.
All of the different streaming techniques use Hypertext Transfer Protocol (HTTP) to
distribute content. However, there are many differences in when and how these
technologies might be used based on the viewers devices. There is often a need to use
one or more of these streaming techniques based on delivery to variety of different
devices including smart TVs, set-top boxes (STBs), personal computers (PCs), and
handheld devices, such as tablets and smartphones.
• Video on demand (VOD) – In this workflow, the media assets are stored as
encoded video files and played on request. The media assets are stored in
multiple different formats and bitrates for playout, or packaged at the time of
requesting, using just-in-time packaging (JIT), for different client devices.
• Live streaming – This workflow describes source content for TV channels and
live events, such as sport, concerts, news, or any other live broadcast events.
This content is packaged in real time, in multiple different formats for different
client devices.
Video on demand and live streaming can both be delivered using one or more different
streaming technologies. The major advantage of streaming for VOD applications is that
a viewer does have to download the whole file before starting to play it.
• HTTP is used for video and signaling to provide compatibility with networks,
firewalls, caches and end clients.
2
Amazon Web Services Amazon CloudFront for Media
• Each video stream is divided into a series of files, each containing a few seconds
of video.
• The client starts with the first stream in the list, downloads the first segment, and
starts to play when downloaded.
• The client continually downloads the next segment while the current one is
playing, giving the appearance of a continuous video stream.
• The client chooses which video stream to use for the next segment, allowing it to
adapt to immediate network conditions on a segment-by-segment basis.
A key difference between CMAF and HLS or DASH is that segments are further
subdivided into fragments. For example, a segment of eight seconds would be divided
into four fragments of two seconds each. With CMAF, a client can be playing a fragment
while still downloading other fragments from the same segment. This ability allows for a
3
Amazon Web Services Amazon CloudFront for Media
CMAF is defined by ISO Standard ISO/IEC 23000-193 and its application for HLS4 is
defined in Apple documentation. The application of CMAF for achieving low latency is
described in more depth in the AWS Media Blog post, Lower latency with AWS
Elemental MediaStore chunked object transfer.
• Streaming origin
4
Amazon Web Services Amazon CloudFront for Media
Live workflows typically include a live source from a studio, venue or other location, and
24/7 channels with a mix of live and recorded content. Some 24/7 channels use entirely
file-based assets played out on a schedule. VOD content is prepared in advanced using
a transcoder, such as AWS Elemental MediaConvert.
A key factor in user experience is the available bandwidth on the viewer’s internet
connection. Insufficient bandwidth, or sudden network congestion, can cause stuttering
and delays while the player is buffering. Viewers report that this is the biggest negative
impact on their perception of the quality of a video service. For the system architect, the
available network bandwidth provides the key constraint on the overall architecture,
including both provider networks and mobile or wireless connections.
One solution is to reduce or vary the video bitrate, but even this has challenges. The
bigger the display, the higher the resolution required to provide the same user
experience. And the higher the resolution, the higher the bitrate required to sustain it.
This is why streaming technologies provide a set of video streams and the ability to
switch between them dynamically.
5
Amazon Web Services Amazon CloudFront for Media
Once the video has been encoded into multiple resolutions it is packaged into one or
more streaming protocols. This is the point where the video encoding and packaging
process is complete and the video can be requested by a client from the origin.
Packaging and storing video files can be a complex management challenge. The
packaging function can be provided by the video encoder, as part of the VOD content
preparation process or by the origin. Many services use just-in-time packaging, where
client demand drives the packaging process in real time. Ad insertion will usually take
place in this stage, and is known as server-side ad insertion (SSAI). Because of the 1:1
relationship between video streams and viewers, many platforms insert personalized
ads into the video stream, providing relevant content for viewers and targeted
advertising opportunities for advertisers.
Another key factor in video encoding configuration for live streams is latency. Viewers
want to see the content with the lowest delay from the source, while maintaining the
highest picture quality.
From a system perspective, the solutions architect will work backwards from the
population of client devices and select a set of streaming technologies, video
resolutions, and bitrates to meet their needs.
The origin
The origin is the endpoint where viewer requests are received and where streaming
video files are served for both live and on-demand workflows. You have several
different origin options to choose from or you build a custom implementation to meet
your specific needs.
• Amazon S3 is a great place to start as an origin for VOD content. It only requires
that the content is packaged and stored in advance.
• AWS Elemental MediaStore is optimized for large-scale live video events and low
latency with content packaged in advance.
6
Amazon Web Services Amazon CloudFront for Media
• AWS Elemental MediaPackage provides just-in-time (JIT) packaging for both live
and VOD workflows. MediaPackage provides the most flexible option for
streaming in multiple formats.
The answer is to add a scalable distributed caching layer between the origin and the
viewers, cache the video segment files when they are first requested, and then serve
the cached files for subsequent requests. In this way, a provider can support a
constantly increasing number of viewers without scaling the streaming platform itself,
while maintaining a consistent low latency, even where the viewer is in a different
geographic Region to the origin. The technology solution that provides this caching
platform is the content delivery network (CDN).
CDNs work very efficiently for live and on-demand video streams. In CloudFront, you
create a CloudFront distribution, with a caching configuration, dedicated entry point
domain name, and a specified origin for streaming video. You can create different
CloudFront distributions for different applications.
Reference solutions
The AWS Solutions Library provides reference implementations for media workflows.
The Live Streaming on AWS and Video On Demand on AWS solutions allow you to get
started quickly with AWS Media Services using an AWS CloudFormation template and
a deployment guide. You can deploy these solutions in your AWS account and use
them right away, adapting the templates for your own needs or using them as a
reference for designing your own applications.
7
Amazon Web Services Amazon CloudFront for Media
Architecture
CloudFront has a global footprint with more than 200 edge locations in over 40
countries across five continents, 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 also 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 the existing locations. This can be
particularly relevant when planning the launch of your video platform in a new Region or
anticipating high peak events.
CloudFront’s 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
8
Amazon Web Services Amazon CloudFront for Media
to its associated REC instead of 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.
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. Lambda@Edge gives you the
ability to run code close to the customer in order to inspect or modify viewer requests.
Lambda@Edge is a low-latency serverless compute service integrated with CloudFront.
For information about using Lambda@Edge in media delivery, see How to filter live
streaming renditions by device type at the Edge.
9
Amazon Web Services Amazon CloudFront for Media
connections before any data can be sent. The perceived quality of video streaming is
impacted by how quickly the player receives requested video segments and the stability
of the connection during the playback session. How the CDN handles connections on
the viewer and origin side, as well as how it processes incoming requests and
responses, has a direct impact on the perceived quality of the video stream.
10
Amazon Web Services Amazon CloudFront for Media
Byte streaming
A common mode of operations for caching proxies is to fetch the entire object from the
origin before sending it back to the viewer. This store-and-forward approach introduces
an extra delay in delivery of new segments to the audience. This is undesirable,
especially in live streaming where minimizing latency is important. CloudFront uses a
pass-through approach when forwarding the newly retrieved objects from the origin to
11
Amazon Web Services Amazon CloudFront for Media
minimize latency. This means that as soon the first byte from the origin reaches
CloudFront, it will be immediately forwarded to the viewer. This is referred to as byte
streaming.
Request collapsing
During a live event, or a release of any type of highly popular content, a large set of
viewers will request the same video objects at the same time. If the video segment is
not yet present in the cache, CloudFront retrieves it from the origin. If multiple requests
for the same object are received before the object is cached, CloudFront sends a single
request to the origin for the segment when first request comes in and uses that object to
service all viewers. This removes the need to send multiple identical requests to the
origin. This provides an additional performance benefit in that all requests after the first
will experience lower latency. This is because the CloudFront cache is already in the
process of retrieving the video segment from the origin.
12
Amazon Web Services Amazon CloudFront for Media
Persistent connections
Video delivery at scale requires a CDN to continuously populate its cache layer with the
video objects requested by the viewers with as few interruptions as possible. In
situations where a cache server needs to frequently re-establish connection to the
origin, this holds back all the viewers waiting for the next video segment from the origin.
To avoid this, CloudFront maintains persistent connections to the origin with a
configured timeout while idle. You can configure the keep-alive timeout in the
CloudFront to align with a timeout value set on your origin server.
You can optimize the CHR by following the recommendations in the Amazon
CloudFront Developer Guide. These recommendations include:
13
Amazon Web Services Amazon CloudFront for Media
• Reduce the number of parameters added to the cache key. For example,
avoid forwarding CORS headers simply to allow all incoming requests from
different site domains. Instead, send it statically from the origin or add it
dynamically using Lambda@Edge within an origin response event. If the origin is
Amazon S3, MediaStore, or MediaPackage, you can trigger them to send the
Access-Control-Allow-Origin:* header by overriding an Origin header sent to your
origin through CloudFront Origin Custom Headers.
Long tail content can still benefit from same CloudFront acceleration as dynamic
content. You can optimize your architecture for long tail content by replicating the origin
to multiple Regions and then routing requests to the nearest Region. This can be done
in different ways according to the origin type:
14
Amazon Web Services Amazon CloudFront for Media
• For Amazon S3 origins, you can use Lambda@Edge to process origin requests
to detect in which Region it's being executed, and route the request to the
nearest Region based on a static mapping table.
• For non-Amazon S3 origins, you can configure a domain name in Amazon Route
53 with a latency policy pointing to different Regions. Then you can configure an
origin in CloudFront with this domain name.
Enabling CloudFront Origin Shield can extend cache retention for long tail content for
any origin type. If you choose a multi-CDN strategy, you can improve the cache-hit ratio
by serving similar requests from the same cache, either by reducing the number of
CDNs for long tail content, or by implementing content-based sharding across CDNs,
where each CDN serves a different subset of the VOD library.
Playback errors
During playback, the player can encounter various issues that are critical enough to
interrupt the process and have the player throw an error. The reasons for playback
errors can differ. They can be caused by poor network conditions, temporary issues at
the origin, or badly tuned player and CDN configuration. Whatever the reason, an error
results in bad viewer experience. Viewers most likely have to reload the application
upon receiving such an error. You can review your architecture and make configuration
improvements to reduce playback errors by the following:
• Offer lower bitrate versions of the stream to the player so it can maintain the
playback state on during temporary periods of poor network conditions.
By knowing possible error codes and the origin returns, you can reduce this time
setting appropriately.
15
Amazon Web Services Amazon CloudFront for Media
Include the certificate of root certificate authority (CA) in the certificate chain associated
with the domain name used for media delivery. For HTTPS-based delivery, some viewer
device platforms can fail, setting up TLS connection when the root CA is missing. Note
that you need to supply a certificate chain when importing a certificate into AWS
Certificate Manger (ACM). Public certificates generated through ACM have root CA
certificate included in the certificate chain.
Cost optimization
CloudFront is a global CDN. However, if your customers are within a limited geographic
Region, you can leverage CloudFront price classes. By default, Amazon CloudFront
minimizes end-user latency by delivering content from its entire global network of edge
locations. Price classes let you reduce your delivery prices by excluding CloudFront’s
more expensive edge locations from your CloudFront distribution.
For example, if your customer only expects an audience in Europe or North America,
you can change the price class to eliminate the cache misses from viewers in the rest of
the world, and route requests to edge locations in Europe or North America. This does
limit where requests are accepted from. For more information, see Geographical
restriction and Amazon CloudFront Pricing.
16
Amazon Web Services Amazon CloudFront for Media
Origin Shield can be enabled for individual origins within CloudFront distributions, and
also supports origins outside AWS. Cache hits from Origin Shield are identified in the
CloudFront access logs.
Security
Video content is valuable and your business model might depend on publishing content
only to authorized users. Many video streaming platforms use a subscription-based
business model, where content protection mechanisms are vital. This is an important
factor when selecting a CDN.
Content protection can guard against piracy activities, such as link sharing, and might
also be required under the terms of content rights or licensing agreements. Licensing
terms might require you to restrict delivery to specific countries, or to integrate specific
security controls in the media delivery workflow such as digital rights management
(DRM) solutions
Geographical restriction
Amazon CloudFront allows you to configure geographical restrictions to prevent users in
certain countries from accessing your content. You can enforce this by either specifying
a list of countries where requests will be allowed or by specifying countries where
17
Amazon Web Services Amazon CloudFront for Media
18
Amazon Web Services Amazon CloudFront for Media
Use cases that require an access control approach can leverage CloudFront’s signed
URLs or signed cookies features. Both features work by generating a policy that defines
access conditions for the requested resource. This policy and resource URL are
cryptographically-signed with a private key provided in a CloudFront key pair. When the
viewer requests a restricted resource, CloudFront validates the policy and signature. If
the validation process fails, a 403 Forbidden HTTP status code is generated in
response. This type of access control in which requests are validated through
cryptographically signed information is commonly referred as tokenization.
In order to retrieve content from CloudFront, the player has to provide three pieces of
information that will be used by CloudFront to validate the request:
19
Amazon Web Services Amazon CloudFront for Media
• Signature
Before making a request, the viewer authenticates and obtains these three items from
your website. The viewer has two options for including this information in the HTTP
request: either by HTTP cookies (signed cookies) or query string parameters (signed
URLs).
CloudFront’s access control mechanism gives you flexibility on how you can leverage it:
You can enforce access control with signed URLs or cookies on all the objects required
for media playback: manifest and video segments, or just one of them. Using signed
cookies is a straightforward way to apply access control for all the relevant resources.
Signed URLs require that you must append query string parameters to the objects
referenced in the manifest files. This imposes additional requirement of rewriting
manifest files either at the origin or by inserting this logic in the CDN’s workflow. For that
purpose, you can use Lambda@Edge.
It is important to verify how the different platforms’ devices handle cookies, query string
parameters, and any limits. Some players might not support cookies at all, while others
only support URLs up to a certain length.
You need to consider the duration the content will be available for to ensure a signed
URL or signed cookie does not expire before the content is requested. This is achieved
by managing the Expires timestamp appropriately
For a playback session of known duration, you can set the expires value to match the
streaming event’s expected end time. In the scenario where playback session length is
not known in advance, more consideration is needed to manage the expiry attribute:
• For signed cookies, inspect the cookies and if expiry is getting close you can
generate a new cookie with a new expiration time. For more information about
using signed cookies, see the blog series, Protecting your video stream with
Amazon CloudFront and serverless technologies.
• For signed URLs, note that a common player behavior is to retrieve the manifest
URL only once. Therefore, to ensure an uninterrupted playback for the
authorized viewer, the expiry timestamp related to the manifest URL should be
prolonged for an extended time period.
20
Amazon Web Services Amazon CloudFront for Media
Session uniqueness
Tokenization as a method of access control works on the basis of viewers presenting
cryptographically-signed information as proof that they have been authorized to watch
the content. This creates a risk of link-sharing, where an authorized user who receives
the signature in a legitimate way, can share it with unauthorized viewers.
To address that risk, you can refine the process of generating and validating the
signature to include some attributes specific to a single, authorized user. A signature
generated on a set of attributes unique to a single user provides a session uniqueness
such that any other user attempting to use the same signature would fail at the
validation stage. An unauthorized user might still attempt to circumvent this by falsifying
the attributes in order to match them with a legitimate user’s details. But if the signing
attributes are difficult to retrieve and modify, then the risk of link sharing is reduced.
Signed URLs and signed cookies allow you to incorporate source IP in the custom
policy statement used to generate the signature. If the requests including such a
signature originates from source IP that doesn’t fall within the specified IP address
range in the policy, CloudFront denies access to the requested object. This largely
reduces the risk of link-sharing in TCP-based connections, overriding source IP address
to match the one specified in the token and receiving the response can’t be done easily.
Multi-CDN considerations
As you develop and scale your architecture for media streaming, a multi-CDN approach
might seem appealing. The driver for this is often a desire for more aggregate capacity,
wider coverage in different geographies, or improving resilience and performance.
Before making a decision, it is important to consider some of the disadvantages of a
multi-CDN approach:
• Increased load on the origin – Because each CDN platform has to populate
their caches independently, each one would make the request to your origin for
original object. This effectively multiplies incoming traffic by the factor of number
of CDN platforms. To alleviate this, you might consider using AWS Origin Shield,
which creates common caching layer for all the CDNs, located in front of your
origin.
21
Amazon Web Services Amazon CloudFront for Media
If you do decide that a multi-CDN architecture is right for you, a metric-based traffic
allocation process will help you make data-driven decisions in the proof-of-concept and
operational phases.
In order to make a data-driven decision, you will need to define and collect a set of
metrics. Preferably, you would synthesize data points coming from your application,
producing first-hand comparison of the performance and availability marks between
used CDNs. Alternatively, you can rely on the metrics sourced by third-party user
experience and monitoring platforms.
Once the metrics for each CDN platform have been collected, the next step is to derive
a score figure that will determine the split of traffic across the CDNs. The overall score
is built from aggregated metrics and you should be able to apply different weighting for
each metric in calculating overall score, depending on which aspects of the playback
you consider to be the most important one for your use case.
In operation, your viewers’ requests must be routed between the CDNs in accordance
to allocation decision. When each CDN vendor provides you with a dedicated DNS
hostname, you can control traffic allocation between them by returning the right CNAME
22
Amazon Web Services Amazon CloudFront for Media
in response to DNS queries for your original domain name. Route 53 with routing
policies helps accomplish that. However, the precision of determining viewer's location
and source network might be limited in this approach. Rather than relying on DNS
another possibility is to set up an API endpoint, which will return URL pointing to specific
CDN when viewer requests the playback URL.
In general, the greater the precision, control, and automation you need in managing
traffic across multiple CDNs, the more effort is required to develop each of the
elements. For a simple solution, such as allocating traffic on a country level, you can
think of a simple load-balancing solution, where it is acceptable to have limited accuracy
in terms of split share, and allocation changes can be done manually. Such a solution
could take advantage of community-based measurements of generic test objects for
CDN’s performance overview, used for deciding on the split per each country in which
you operate.
DNS-based traffic splitting can be achieved using Route 53 traffic policies to combine
geolocation and weighted rules. For a more automated approach with more fine-grained
control for allocating traffic, you will either need to develop a custom solution that allows
you to align exactly to your use case or consider a more advanced third-party solution
from a specialized vendor. For more information about multiple CDNs, see Using
multiple content delivery networks for video streaming.
In addition to default metrics provided at no additional costs, you can enable additional
metrics, giving more visibility into performance of CloudFront traffic. The additional
metrics include information on cache hit rate and origin latency, defined as the total time
spent from when CloudFront receives a request to when it starts providing a response
to the network, for requests that are served from the origin upon cache miss. The
following image shows CloudWatch graphs for both metrics.
23
Amazon Web Services Amazon CloudFront for Media
Because CloudWatch metrics are emitted in the matter of minutes, you can constantly
monitor relevant metrics and respond quickly to observed anomaly, which is an
indication of performance drop, transitional issues, and misconfiguration.
For more detailed inspection of traffic to the level of individual request, CloudFront
provides access logs that are consolidated from all of the edge locations and delivered
within minutes to an Amazon S3 bucket. Each request to CloudFront has an associated
unique request ID, included in X-Amz-Cf-Id header that you can find in the logs, as well
as in the response headers and request headers which reach your origin.
If you need to open a ticket to CloudFront support, engineers can retrace exactly what
happened for a specific request using the Request ID. This eliminates the need to wait
for the issue to occur again to capture it and analyze it. You can inspect the logs in fine-
grained detail with Amazon Athena, which is a serverless query service that allows you
to make ad hoc SQL queries. CloudFront supports real-time access logs and standard
access logs. Standard access logs apply for all the traffic associated with distributions
and are published in a destined Amazon S3 bucket in minutes. Real-time access logs
log entries are fed into Kinesis Data Stream in the matter of seconds and can be
consumed immediately. CloudFront real-time logs are configurable, allowing you to
choose:
• The sampling rate for your real-time logs – that is, the percentage of requests for
which you want to receive real-time log records.
• The specific fields that you want to receive in the log records
• The specific cache behaviors (path patterns) that you want to receive real-time
logs for
You can use CloudFront access logs to monitor, analyze, and take action based on
content delivery performance. For information about a dashboard for real-time logs, see
Creating realtime dashboards using Amazon CloudFront logs.
24
Amazon Web Services Amazon CloudFront for Media
You can also build your own dashboards based on the logs using AWS services like
Elasticsearch or QuickSight. APN Partner solutions like Sumologic and Datadog also
provide dashboards for CloudFront. Some common reports are also summarized in the
CloudFront Reports & analytics dashboard in the AWS Management Console:
You can engage while in the planning phase for a major service launch. Some global
customers have started months in advance while their service was still in development.
You might already be familiar with AWS Infrastructure Event Management (IEM). This is
a structured program that assists you in strategic planning for large-scale events, as
well as real-time support during the most critical moments. AWS also offers AWS
Elemental Media Event Management (MEM), a guided support program tailored
specifically for the unique requirements of video events, such as marquee sporting
events or video service launches. MEM is available for events with Amazon CloudFront
and AWS Media Services.
25
Amazon Web Services Amazon CloudFront for Media
• Planning
• Event support
• Retrospective
Planning starts well ahead of your launch date or event. The first step is to assign a
team of specialists who will assist you through the four phases. The team will review
your proposed event workflow, the expected audience, your requirements and success
criteria, then document the end to end media delivery chain. The planning phase
includes Risk Assessment and Mitigation Planning (RAMP) and an Operational
Readiness Review (ORR) to ensure your workflow is well architected.
The AWS Well-Architected Framework has been developed to help cloud architects
build secure, high-performing, resilient, and efficient infrastructure for their applications.
This framework provides a consistent approach to evaluate architectures. It has been
used in tens of thousands of workload reviews conducted by the AWS solutions
architecture team, customers, and partners.
The second phase focuses on monitoring and actioning the risk mitigation steps. The
team will make operational runbook recommendations and run at least one Game Day
to simulate your unique event.
During the event week, the MEM team will work closely with your team to support the
live event and proactively respond as the event progresses. The MEM team might be
collocated with your own teams during this phase, and may have other AWS experts on
call for the duration of your event.
The MEM service concludes with a post-event analysis where feedback from the launch
is used to update operational playbooks, update configuration, and to inform future
event planning.
Conclusion
This whitepaper has detailed best practices and key system considerations for media
delivery with Amazon CloudFront. We described how CloudFront is part of the end-to-
end media architecture. We learned about important features and optimizations for
performance and security. We learned about how to monitor operational performance
and how to plan for major events and service launches.
26
Amazon Web Services Amazon CloudFront for Media
For more resources on media delivery with Amazon CloudFront, see Amazon
CloudFront for Media & Entertainment. For more information about running media
workloads on AWS, see Media & Entertainment on AWS.
Contributors
Contributors to this document include:
Document revisions
Date Description
November 2020 First publication
Notes
1 HLS Specification [Link]
2 DASH Specification [Link]
3
CMAF Specification [Link]
4 CMAF with HLS
[Link]
media_application_format_with_http_live_streaming
5 Microsoft Smooth Streaming [MS-SSTR] [Link]
us/openspecs/windows_protocols/ms-sstr/8383f27f-7efe-4c60-832a-387274457251
27