CC Unit - 3
CC Unit - 3
Jane is a developer, and she is working on a software project for a client who is planning to host the project with one of
the cloud computing service providers. So, Jane needs advice on the considerations for cloud applications. Her friend
Teresa, a specialist in the cloud computing environment, is trying to help her.
''Let's start from a simple but essential matter, that is, access to the machine resources in the application. You should be
considering the type of service you are renting from the provider when designing your application. Take a look at Figure-
1 which shows a comparison of the control level over resources for local, Infrastructure as a Service (IaaS), and Platform
as a Service (PaaS) environments. You can see that if you go for a PaaS environment, you will not be able to access the
file system of the machine your application is running on! So, if the client is planning for PaaS, then you should expect to
use a storage service for the files your application generates or uses.''
When designing applications for the cloud, irrespective of the chosen platform, I have often found it useful to consider
four specific topics during my initial discussions; scalability, availability, manageability and feasibility.
It is important to remember that the items presented under each topic within this article are not an exhaustive list and are
aimed only at presenting a starting point for a series of long and detailed conversations with the stakeholders of your
project, always the most important part of the design of any application. The aim of these conversations should be to
produce an initial high-level design and architecture. This is achieved by considering these four key elements holistically
within the domain of the customers project requirements, always remembering to consider the side-effects and trade-offs
of any design decision (i.e. what we gain vs. what we lose, or what we make more difficult).
SCALABILITY
Conversations about scalability should focus on any requirement to add additional capacity to the application and related
services to handle increases in load and demand. It is particularly important to consider each application tier when
designing for scalability, how they should scale individually and how we can avoid contention issues and bottlenecks.
Key areas to consider include:
C APACITY
Will we need to scale individual application layers and, if so, how can we achieve this without affecting availability?
How quickly will we need to scale individual services?
How do we add additional capacity to the application or any part of it?
Will the application need to run at scale 24x7, or can we scale-down outside business hours or at weekends for
example?
LOAD
How can we improve the design to avoid contention issues and bottlenecks? For example, can we use queues or a
service bus between services in a co-operating producer, competing consumer pattern?
Which operations could be handled asynchronously to help balance load at peak times?
How could we use the platform features for rate-leveling (e.g. Azure Queues, Service Bus, etc.)?
How could we use the platform features for load-balancing (e.g. Azure Traffic Manager, Load Balancer, etc.)?
AVAILABILITY
Availability describes the ability of the solution to operate in a manner useful to the consumer in spite of transient and
enduring faults in the application and underlying operating system, network and hardware dependencies. In reality, there
is often some crossover between items useful for availability and scalability. Conversations should cover at least the
following items:
UPTIME GUARANTEES
What Service Level Agreements (SLA’s) are the products required to meet?
Can these SLA’s be met? Do the different cloud services we are planning to use all conform to the levels required?
Remember that SLA’s are composite.
DISASTER RECOVERY
In the event of a catastrophic failure, how do we rebuild the system?
How much data, if any, is it acceptable to lose in a disaster recovery scenario?
How are we handling backups? Do we have a need for backups in addition to data-replication?
How do we handle “in-flight” messages and queues in the event of a failure?
Are we idempotent? Can we replay messages?
Where are we storing our VM images? Do we have a backup?
P ERFORMANCE
What are the acceptable levels of performance? How can we measure that? What happens if we drop below this
level?
Can we make any parts of the system asynchronous as an aid to performance?
Which parts of the system are the mostly highly contended, and therefore more likely to cause performance issues?
Are we likely to hit traffic spikes which may cause performance issues? Can we auto-scale or use queue-centric
design to cover for this?
MANAGEABILITY
This topic of conversation covers our ability to understand the health and performance of the live system and manage site
operations. Some useful cloud specific considerations include:
MONITORING
How are we planning to monitor the application?
Are we going to use off-the-shelf monitoring services or write our own?
Where will the monitoring/metrics data be physically stored? Is this in line with data protection policies?
How much data will our plans for monitoring produce?
How will we access metrics data and logs? Do we have a plan to make this data useable as volumes increase?
Is there a requirement for auditing as well as logging?
Can we afford to lose some metrics/logging/audit data (i.e. can we use an asynchronous design to “fire and forget” to
help aid performance)?
Will we need to alter the level of monitoring at runtime?
Do we need automated exception reporting?
DEPLOYMENT
How do we automate the deployment?
How do we patch and/or redeploy without disrupting the live system? Can we still meet the SLA’s?
How do we check that a deployment was successful?
How do we roll-back an unsuccessful deployment?
How many environments will we need (e.g. development, test, staging, production) and how will deploy to each of
them?
Will each environment need separate data storage?
Will each environment need to be available 24x7?
FEASIBILITY
When discussing feasibility we consider the ability to deliver and maintain the system, within budgetary and time
constraints. Items worth investigating include:
Can the SLA’s ever be met (i.e. is there a cloud service provider that can give the uptime guarantees that we need to
provide to our customer)?
Do we have the necessary skills and experience in-house to design and build cloud applications?
Can we build the application to the design we have within budgetary constraints and a timeframe that makes sense to
the business?
How much will we need to spend on operational costs (cloud providers often have very complex pricing structures)?
What can we sensibly reduce (scope, SLAs, resilience)?
What trade-offs are we willing to accept?
T HE CLOUD COMPOSITION
''I know the cloud is based on virtualization technology, but do I have to understand how the technology works in detail?''
Jane asks.
Teresa responds, ''No, you don't have to. However, it is necessary to have a basic idea of the virtualization technology
and rapid elasticity since they enable auto-scaling and dynamically networking resources as the four directions in Figure-
2 demonstrate. Scaling out/in is about increasing/decreasing the number of resources while scaling up/down is about
enhancing/degrading the specs of a resource.''
Before digging into the definition of the Cloud Reference Architecture (CRA) and its benefits, it is better to look at how
things can go wrong without having one. You will quickly realize that it is better to spend some time before migration to
plan your cloud migration journey with security and governance in mind. Doing that will not only save you time and
money but will help you meet your security and governance needs. So let’s get started.
When organizations start planning their cloud migration, and like anything else new, they start by trying and testing some
capabilities. Perhaps they start hosting their development environment in the cloud while keeping their production one
on-premises.
It is also common to see small and isolated applications being migrated first, perhaps because of their size, low criticality
and to give the cloud a chance to prove it is trust worthy. After all, migration to the cloud is a journey and doesn’t happen
overnight.
Then the benefits of cloud solutions became apparent and companies started to migrate multiple large-scale workloads.
As more and more workloads move to the cloud, many organizations find themselves dealing with workload islands that
are managed separately with different security models and independent data flows.
Managing cost of running workloads in the cloud becomes also challenge. There is no clear governance and
accountability model which leads to a lot of management overhead and security concerns.
The lack of governance, automation, naming convention and security models are also even hard to achieve afterwards. In
fact, it is nightmare to look at a poorly managed cloud infrastructure and then trying to apply security and governance
afterword because these need to be planned a head before even deploying any cloud resources.
Even worse, data can be hosted in geographies that violates corporate’s compliance requirements, which is a big concern
for most organizations. I remember once asking one of my customers if they knew where their cloud data is hosted, and
most of them just don’t know.
T HE B ENEFITS OF C LOUD R EFERENCE A RCHITECTURE (CRA)
Simply put, the Cloud Reference Architecture (CRA) helps organizations address the need for detailed, modular and
current architecture guidance for building solutions in the cloud.
The Cloud Reference Architecture (CRA) serves as a collection of design guidance and design patterns to support
structured approach to deploy services and applications in the cloud. This means that every workload is deployed with
security, governance and compliance in mind from day one.
The Cloud Reference Architecture (CRA) Deployment View provides a framework to be used for all cloud deployment
projects, which reduces the effort during design and provides an upfront guidance for a deployment aligned to
architecture, security and compliance.
You can think of the Cloud Reference Architecture (CRA) Deployment View as the blueprint for all cloud projects.
What you get from this blueprint, the end goal if you are wondering, is to help you quickly develop and implement cloud-
based solutions, while reducing complexity and risk.
Therefore, having a foundation architecture not only helps you ensure security, manageability and compliance but also
consistency for deploying resources. It includes network, security, management infrastructure, naming convention,
hybrid connectivity and more.
I know what you might be thinking right now, how does one blueprint fit the need for organizations with different sizes?
Since not all organizations are the same, the Cloud Reference Architecture (CRA) Deployment View does not outline a
single design that fits all sizes. Rather, it provides a framework for decisions based on core cloud services, features and
capabilities.
It is a design methodology which has been introduced to manage cloud-based or software as a Service (SaaS) apps. Some
of the key features or applications of this design methodology are as follows:
Use declarative formats for setup automation, to minimize time and cost for new developers joining the project
Have a clean contract with the underlying operating system, offering maximum portability between execution
environments
Are suitable for deployment on modern cloud platforms (Google cloud, Heroku, AWS etc..), obviating the need
for servers and systems administration
Minimize divergence between development and production, enabling continuous deployment for maximum
agility and can scale up without significant changes to tooling, architecture, or development practices
If we simplify this term further, 12 Factor App design methodology is nothing but a collection of 12 factors which act as
building blocks for deploying or developing an app in the cloud.
Listed below are the 12 Factors:
1. Codebase: A 12 Factor App is always tracked in a version control system such as Git or Apache Subversion
(SVN) in the form of code repository. This will essentially help you to build your code on top of one codebase,
fully backed up with many deployments and revision control. As there is a one to one relationship between a 12
factor app and the codebase repository, so in case of multiple repositories, there is always a need to consider this
relationship as a distributed system consisting of multiple 12 factored apps. Deployments should be automatic,
so everything can run in different environments without
2. Dependencies: As the app is standalone and needs to install dependencies, it is important to explicitly declare
and isolate dependencies. Moreover, it is always recommended to keep your development, production and QA
identical to 12 Factor apps. This will help you to build applications in order to scale web and other such
applications that do not have any room for error. As a solution to this, you can use a dependency isolation tool
such as ex VirtualEnv for Python uniformly to remove several explicit dependency specifications to both
production and development phases and environments.
3. Config: This factor manages the configuration information for the app. Here you store your configuration files
in the environment. This factor focuses on how you store your data – the database Uniform Resource Identifier
(URI) will be different in development, QA and production.
5. Build, Run, Release: It is important to run separately all the build and run stages making sure everything has
the right libraries. For this, you can make use of required automation and tools to generate build and release
packages with proper tags. This is further backed up by running the app in the execution environment while
using proper release management tools like Capistrano for ensuring timely rollback.
6. Stateless Processes: This factor is about making sure the app is executed in the execution environment as one or
more processes. In other words, you want to make sure that all your data is stored in a backing store, which
gives you the right to scale out anything and do what you need to do. During stateless processes, you do not
want to have a state that you need to pass along as you scale up and out.
7. Port Binding: Twelve factor apps are self-contained and do not rely on runtime injection of a web server into
the execution environment to create a web-facing service. With the help of port binding, you can directly access
your app via a port to know if it’s your app or any other point in the stack that is not working properly.
8. Concurrency: This factor looks into the best practices for scaling the app. These practices are used to manage
each process in the app independently i.e. start/stop, clone to different machines etc. The factor also deals with
breaking your app into much smaller pieces and then look for services out there that you either have to write or
can consume.
9. Disposability: Your app might have different multiple processes handling different tasks. So, the ninth factor
looks into the robustness of the app with fast startup and shutdown methods. Disposability is about making sure
your app can startup and takes down fast and can handle any crash anytime. You can use some high quality
robust queuing backend (Beanstalk, RabbitMQ etc.) that would help return unfinished jobs back to the queue in
the case of a failure.
10. Dev/Prod Parity: Development, staging and production should be as similar as possible. In case of continuous
deployment, you need to have continuous integration based on matching environments to limit deviation and
errors
The cloud storage system stores multiple copies of data on multiple servers, at multiple locations. If one system fails,
then it is required only to change the pointer to the location, where the object is stored.
To aggregate the storage assets into cloud storage systems, the cloud provider can use storage virtualization software
known as StorageGRID. It creates a virtualization layer that fetches storage from different storage devices into a single
management system. It can also manage data from CIFS and NFS file systems over the Internet. The following diagram
shows how StorageGRID virtualizes the storage into storage clouds:
CHALLENGES
Storing the data in cloud is not that simple task. Apart from its flexibility and convenience, it also has several challenges
faced by the customers. The customers must be able to:
Get provision for additional storage on-demand.
Know and restrict the physical location of the stored data.
Verify how data was erased.
Have access to a documented process for disposing of data storage hardware.
Have administrator access control over data.
Type-1 :
Block-Based Storage System –
Hard drives are block-based storage systems. Your operating system like Windows or Linux actually sees a hard
disk drive. So, it sees a drive on which you can create a volume, and then you can partition that volume and
format them.
For example, If a system has 1000 GB of volume, then we can partition it into 800 GB and 200 GB for local C
and local D drive respectively.
Remember with a block-based storage system, your computer would see a drive, and then you can create
volumes and partitions
Type-2 :
File-Based Storage System –
In this, you are actually connecting through a Network Interface Card (NIC) . You are going over a network, and
then you can access the network-attached storage server (NAS). NAS devices are file-based storage systems.
Multimedia Introduction:
Multimedia:
Multimedia is usually recorded and played, displayed, or accessed by information content processing devices, such
as computerized and electronic devices, but can also be part of a live performance. Multimedia devices are electronic
media devices used to store and experience multimedia content.
Streaming Media:
Streaming media is multimedia that is constantly received by and presented to an end-user while being delivered by a
provider.
Its verb form, "to stream", refers to the process of delivering media in this manner; the term refers to the
delivery method of the medium rather than the medium itself .
Live Streaming refers to content delivered live over the Internet, requires a camera for the media, an encoder to digitize
the content, a media publisher, and a content delivery network to distribute and deliver the content. In streaming video
and audio, the traveling information is a stream of data from a server.
The decoder is a stand-alone player or a plugin that works as part of a Web browser. The server, information stream
and decoder work together to let people watch live or prerecorded broadcasts.
Most streaming videos don't fill the whole screen on a computer. Instead, they play in a smaller frame or window.
If you stretch many streaming videos to fill your screen, you'll see a drop in quality. For this reason, streaming video and
audio use protocols that allow the transfer of data in real time.
They break files into very small pieces and send them to a specific location in a
Users expect powerful and stable functions for multimedia videos stability is of greatest importance.
To provide appropriate multimedia files for diversified terminal units.
In the transcoding mode, multimedia files are transcoded dynamically, in order to be applicable to the device side
according to the terminal environment.
This mode needs to consider the real-time problem, especially for H.264/SVC coding, as the time required for
transcoding causes difficulties for real-time streaming. Although SVC is applicable to varying bandwidth networks due to
its multilayer architecture, how to provide a multimedia hierarchy that is suitable for dynamic environment variations
according to the terminal unit is an interesting research project.
Transmission profile is responsible for monitoring the dynamic condition of the transmission channel, such as
effective channel bandwidth, channel error rate, etc.
Device profile describes the capability of the device, such as screen size, processing power, etc.
Here the svc transcoding controller transcodes the appropriate video file according to
the mobile device parameters.
based on cloud computing introduces the new concept that uses map reduce to separate the video content into different
clips.
The losses in bandwidth can be reduced by this approach. svc plays an important role in this method and
also provides the different formats of the video files with the cloud environment to simulate the overall network
environment.
In this schema user wants to download a particular file from the cloud server first the user should register with cloud
server, if already exists the device profile then directly get the appropriate video file according
to the parameters of the mobile device.
Any mobile device using this service for the first time the cloud will not provide such a profile. so there should be an
additional profile examination to provide the necessary information about the mobile device.
A. Parameter Calculation For parameter calculation we can send the mobile device in formation in the form XML
manifest file. In this we can set the network parameters according to the device.
There are three types of bandwidths namely existing, average and standard deviation values to calculate the current
bandwidth. This type of parameter form is maintained then we can send the device parameters to the network
estimation module and device aware Bayesian prediction module for relevant prediction. Here in the xml manifest
file we can set the mobile network parameters and the send to the Cloud server then it detects by the server and send
the appropriate Video file to the mobile device according to the parameters of the mobile device
B. Cloud Service
In this module we can maintain different video formats of the single video file then we can store on to the cloud
database. Whenever the mobile device sends the parameters to the cloud server the server can detect the user
profiles of the particular mobile device and can send the required video file to the mobile device. The use highly
scalable, reliable, secure, fast and inexpensive infrastructure.
This service mainly aims to maximize the benefits of the user. The video file was stored according to
the bitrates, resolution and frame rate, bandwidth of the width, height, and standard deviation, decoding and
encoding formats.
C. Bandwidth Settings
In this module we can estimate the video process according to the frame rate, bit rate and resolution. To decode or
encode the video file according to the parameters of the mobile device. Device feature can find by power
consumption, device model, device network in order to conform to the real time requirements of the mobile device.
In order to conform to the real time requirements of the mobile multimedia, this study adopted Bayesian theory to
infer weather the video features are conformed to the decoding action. the inference module was based on the
following two conditions: the LCD brightness does not always change this hypothesis aims at a hardware energy
evaluation. The literature states that the TFT LCD energy consumption accounts for about 20%-45% of the total
power consumption for different terminal hardware environments. Although the overall power can be reduced
effectively by adjusting the LCD, with multimedia services, users are sensitive to brightness; they dislike
video brightness that repeatedly changes.
D. Transcoding
In this module the transcoding work can be done by the cloud server efficiently according to the bandwidth and
E. Adaptive Streaming
A good dynamic communication mechanism can reduce the bandwidth needs and the power consumption of the
device resulting from excessive packet transmission, and transmission frequency can be determined according to the
bandwidth based on such dynamic decision making when the network bandwidth difference exceeds a triple standard
deviation, this indicates the present network is unstable. The overall communication frequency shall incline to
frequency to avoid errors; however, when the network bandwidth difference is less than a triple standard
deviation, the current network is still in a stable state, and the influence on bandwidth difference can be corrected
gradually. Ultimately we will get the service very effectively in this method.
Case Study: Live Video Streaming App,
A proof of concept (POC) is an early product version between the design and main development phases. POC has
become a common way for startups and established businesses to test whether the idea they have is actually going to
work since POC demonstrates that the project can be done. A proof of concept also creates a starting point for the
development of the project as a whole.
Businesses need a proof of concept when there is no guarantee that the technical result is achievable due to the leverage
of complex architecture and new technologies, what's relevant to video streaming mobile applications. Thus, by
developing a POC, developers, and stakeholders get evidence that the project is viable.
OUR CHALLENGE
Develop the proof of concept of a video streaming application with the basic functionality of a social media application.
To achieve this goal, we needed to:
Implement the following mobile screens and use cases:
Sign up / Sign in. Users can sign up/sign in to the system.
View profile. Users can view their and other users’ profile data.
Edit profile. Users can edit their profile data, such as name, avatar, and bio.
Search. Users can search for other users by name and follow them.
Start streaming. Users can start real-time video streaming.
View streamings list. Users can view the list of active streams.
Join the stream. Users can participate in the streaming of another user as a viewer.
Integrate several authorization methods, such as:
Google authorization
Facebook authorization
Sign-in/Sign-up via email and password, Facebook, Google, and Apple ID.
User Profile
CONTRIBUTORS
iOS developer Vitalii Pryidun
Backend developer Ihor Kopaniev
DevOps support Vasily Lebediev
Main services
Keychain for saving JWT and Apple sign-in credentials.
Network, AuthorizedNetwork, TokenProvider, APIErrorParser for executing network requests. All requests have
to conform to APIRequestProtocol or APIAuthorizedRequestProtocol for requests that include a token
into headers.
TokenProvider for fetching a token from the keychain and refreshing it via Firebase if needed. If your app has to
refresh a token using a backend request, go to Core/Networking/TokenProvider and rewrite this service to
restore the token manually.
FirebaseManager for authentication using email+password, verification ID, social media, password reset, logout,
etc.
FirebaseDatabaseManager for obtaining followers list, fetching users, etc.
FirebaseStorage for setting and fetching an avatar.
AuthService is just a stub for validating Firebase JWT tokens. If your back-end requires JWT verification, insert
a validation request into the validate method.
SearchService for fetching users with input from the search field.
FollowService for following/unfollowing the user fetched with SearchService.
UserService for updating user profile (name etc.).
StreamService for fetching a token to join agora channel, notifying back-end about start/end of the channel,
subscribing to user reactions, sending reactions, etc.
OUR RESULTS
The development of the video streaming app proof of concept gave us the following expertise:
We integrated video streaming functionality to the POC using Agora.IO SaaS.
We implemented the authentication and authorization by Firebase Authentication.
We worked with Firebase Realtime Database, which supports direct connectivity with end-users applications
(like mobile, web, etc.) server-side applications.
We optimized the development process by applying ready-to-use Firebase functionality.
As a result, we showcased our expertise in video streaming app development.
The seven layers — which include physical, data link, network, transport, session, presentation, and application — were
defined by the International Organization for Standardization’s (IS0’s) Open Systems Interconnection model, as depicted
above.
WHAT IS A STREAMING PROTOCOL?
Each time you watch a live stream or video on demand, video streaming protocols are used to deliver data over the
internet. These can sit in the application, presentation, and session layers.
Online video delivery uses both streaming protocols and HTTP-based protocols. Streaming protocols like Real-Time
Messaging Protocol (RTMP) transport video using dedicated streaming servers, whereas HTTP-based protocols rely on
regular web servers to optimize the viewing experience and quickly scale. Finally, emerging HTTP-based
technologies like Apple’s Low-Latency HLS seek to deliver the best of both options by supporting low-latency streaming
at scale.
TRADITIONAL VIDEO STREAMING PROTOCOLS
Traditional streaming protocols, such as RTSP and RTMP, support low-latency streaming. But they aren’t natively
supported on most endpoints (e.g., browsers, mobile devices, computers, and televisions). Today, these streaming formats
work best for transporting video between and IP camera or encoder and a dedicated media server.
RTMP Explained
RTSP/RTP
Like RTMP, RTSP/RTP describes an old-school technology used for video contribution. RTSP and RTP are often used
interchangeably. But to be clear: RTSP is a presentation-layer protocol that lets end users command media servers via
pause and play capabilities, whereas RTP is the transport protocol used to move said data.
Android and iOS devices don’t have RTSP-compatible players out of the box, making this another protocol that’s rarely
used for playback. That said, RTSP remains standard in many surveillance and closed-circuit television (CCTV)
architectures. Why? The reason is simple. RTSP support is still ubiquitous in IP cameras.
RTSP Explained
ADAPTIVE HTTP-BASED STREAMING PROTOCOLS
Streams deployed over HTTP are not technically “streams.” Rather, they’re progressive downloads sent via regular web
servers. Using adaptive bitrate streaming, HTTP-based protocols deliver the best video quality and viewer experience
possible — no matter the connection, software, or device. Some of the most common HTTP-based protocols include
MPEG-DASH and Apple’s HLS.
APPLE HLS
Since Apple is a major player in the world of internet-connected devices, it follows that Apple’s HLS protocol rules the
digital video landscape. For one, the protocol supports adaptive bitrate streaming, which is key to viewer experience.
More importantly, a stream delivered via HLS will play back on the majority of devices — thereby ensuring accessibility
to a large audience.
HLS support was initially limited to iOS devices such as iPhones and iPads, but native support has since been added to a
wide range of platforms. All Google Chrome browsers, as well as Android, Linux, Microsoft, and MacOS devices, can
play streams delivered using HLS.
HLS Explained
LOW-LATENCY HLS
Low-Latency HLS (LL-HLS) is the latest and greatest technology when it comes to low-latency streaming. The
proprietary protocol promises to deliver sub-three-second streams globally. It also offers backward compatibility to
existing clients.
In other words, it’s designed to deliver the same simplicity, scalability, and quality as HLS — while significantly
shrinking the latency. At Wowza, we call this combination the streaming trifecta.
Even so, successful deployments of Low-Latency HLS require integration from vendors across the video delivery
ecosystem. Support is still lacking, and large-scale deployments of Low-Latency HLS are few and far between.
Playback Compatibility: Any players that aren’t optimized for Low-Latency HLS can fall back to standard
(higher-latency) HLS behavior
HLS-compatible devices include MacOS, Microsoft, Android, and Linux devices; all Google Chrome
browsers; several set-top boxes, smart TVs, and other players
Benefits: Low latency, scalability, and high quality… Oh, and did we mention backward compatibility?
Drawbacks: As an emerging spec, vendors are still implementing support
Latency: 2 seconds or less
Video Codecs: Codec-agnostic
Audio Codecs: Codec-agnostic
Playback Compatibility: Good (All Android devices; most post-2012 Samsung, Philips, Panasonic, and Sony
TVs; Chrome, Safari, and Firefox browsers)
Benefits: Vendor-independent, international standard for adaptive bitrate
Drawbacks: Not supported by iOS or Apple TV
Latency: 6-30 seconds (lower latency only possible when tuned)
Variant Formats: MPEG-DASH CENC (Common Encryption)
Playback Compatibility: Any players that aren’t optimized for low-latency CMAF for DASH can fall back to
standard (higher-latency) DASH behavior
Benefits: Low latency meets HTTP-based streaming
Drawbacks: As an emerging spec, vendors are still implementing support
Latency: 3 seconds or less
CMAF Explained
MICROSOFT SMOOTH STREAMING
Microsoft developed Microsoft Smooth Streaming in 2008 for use with Silverlight player applications. It enables
adaptive delivery to all Microsoft devices. The protocol can’t compete with other HTTP-based formats and is falling out
of use. In fact, in our 2021 Video Streaming Latency Report, only 5 percent of respondents were using Smooth
Streaming.
Which streaming formats are you currently using?
ADOBE HDS
HDS was developed for use with Flash Player as the first adaptive bitrate protocol. Because Flash is no more, it’s also
slowly dying. Don’t believe us? Just take a look at the graph above.
Video Codecs: Codec-agnostic
Audio Codecs: Codec-agnostic
Playback Compatibility: Limited (VLC Media Player, FFPlay, Haivision Play Pro, Haivision Play, Larix
Player, Brightcove)
Benefits: High-quality, low-latency video over suboptimal networks
Drawbacks: Not widely supported for video playback
Latency: 3 seconds or less, tunable based on how much latency you want to trade for packet loss
SRT Explained
WEBRTC
As the speediest technology available, WebRTC delivers near-instantaneous voice and video streaming to and from any
major browser. It can also be used end-to-end and thus competes with ingest and delivery protocols. The framework was
designed for pure chat-based applications, but it’s now finding its way into more diverse use cases.
Scalability remains a challenge with WebRTC, though, so you’ll need to use a solution like Wowza’s Real-Time
Streaming at Scale feature to overcome this. The solution deploys WebRTC across a custom CDN to provide near-
limitless scale. This allows broadcasters to reach a million viewers with sub-500 ms delivery — a once impossible feat.
Workflow: Real-Time Streaming at Scale for Wowza Video
By prioritizing the above considerations, it’s easy to narrow down what’s best for you.
CONTRIBUTION VS. D ELIVERY
RTMP and SRT are great bets for first-mile contribution, while both DASH and HLS lead the way when it comes
to playback. On the flip side, RTMP has fallen entirely out of favor for delivery, and HLS isn’t an ideal ingest format.
That’s why most content distributors rely on a media server or cloud-based video platform to transcode their content from
one protocol to another.
P LAYBACK SUPPORT
What’s the point of distributing a stream if viewers can’t access it? Lacking playback support is the reason RTMP no
longer plays a role in delivery to end users. And ubiquitous playback support is the reason why HLS is the most popular
protocol today.
E NCODER S UPPORT
The inverse of playback support is encoder support. RTMP maintains a stronghold despite its many flaws due to the
prevalence of RTMP encoders already out there. Similarly, RTSP has stayed relevant in the surveillance industry because
it’s the protocol of choice for IP cameras.
WebRTC is unique in that it can be used for browser-based publishing and playback without any additional technologies,
enabling simple streaming for use cases that don’t require production-quality encoders and cameras.
S CALABILITY
HLS is synonymous with scalability. The widely-supported HTTP-based protocol leverages web servers to reach any
device worth reaching today. But what it delivers in scalability, it lacks in terms of latency. That’s because latency and
scalability have traditionally been at odds with one another. New technologies like Real-Time Streaming at Scale,
however, resolve this polarity.
VIDEO FILE?
To discuss the problems surrounding compatibility and bandwidth, we must first explain what a video file is.
When a video is first recorded by a phone or camera, the raw video data is too large to store locally, much less send over
the web. For example, an hour of 1080p 60fps uncompressed video is around 1.3 terabytes.
To bring the size of this raw data down to a more manageable size, the data must be compressed. The software that is
used to compress this data is called a codec (a combination of the words coder and decoder). A codec applies an
algorithm to compress video data, encoding it so that it can be easily stored and sent. Once compressed, the data is
packaged into a file format, called a container. Containers have extensions you may have seen, like .mp4 or .mov.
When playing a video this process is reversed. A media player opens the container, and the same codec is used
to decode the video data and display it on the device.
Encoded videos are decoded with the same codec for playback
Usually this decision will be made based on the characteristics of the codec and the types of devices or media players that
a business expects their users to have. Once they have made this decision, they need to convert any video files they have
using the codec and container they have decided on.
Consider for instance, the difference in download speed that will be available to a user on a fiber internet connection in
their office, and a user on 3G mobile connection going through a subway tunnel as they both attempt to download the
same video. The person in their office will have a smooth experience, whereas the person in the tunnel may have a
choppy experience, if their video plays at all.
For this reason, businesses will usually create multiple versions of the same video at different rates of compression, and
thus different file sizes. Modern media players detect users’ bandwidth, and deliver the video file most appropriate for
speed of their connection. Smaller, more compressed videos will be delivered to users with less available bandwidth,
while users with stronger connections will be served higher quality videos.
To recap, businesses that deliver video will use a codec to convert their videos into a single container format,
compressed to multiple file sizes.
Some businesses choose to build their own video transcoding farm in-house. In this case, a development team is needed
to build custom transcoding pipeline and deploy it to bare metal servers or cloud infrastructure (e.g. Amazon EC2, Digital
Ocean Droplet).
Once deployed, this option is cheaper than third-party software, and it provides businesses with maximum control over
what formats, codecs, and video settings they support, as well as any additional transformations they want to make to
their videos.
This option requires a high amount of technical expertise both to develop and scale effectively: video transcoding can be
both slow and error prone without significant engineering attention. As we’ll see later, provisioning servers for video
transcoding can also result in periods wherein compute power is going unused.
Building a custom transcoding farm is best-suited for video platforms such as Netflix and YouTube. Companies that
ingest and stream millions of hours of video each week can build their own engineering operations around this task to
minimize the trade-offs.
Commercial software
A second solution is to use commercial video transcoding software. Services such as Amazon MediaConvert and
Zencoder offer powerful cloud-based transcoding.
Solutions compared
Let’s briefly review the options outlined above.
Custom pipelines provide the highest level of control over inputs and outputs. The bottleneck is technical expertise - to
really get the best performance and cost from this model, a business needs to build a dedicated software engineering team
around video transcoding.
By contrast, businesses can outsource their video transcoding to third-party services. These services provide the benefits
of speed and control, but at a higher cost.
These options are sufficient for some businesses, but the Bento team saw an opportunity here. Is it possible to build a
fast, low-cost transcoding pipeline, suited for businesses that don’t have video expertise and won’t need a plethora of
video options?
We felt that the answer was yes, and that the solution might lie in serverless technology.