This document discusses options for developing a scalable WebRTC media infrastructure, including using a third-party Platform as a Service (PaaS) provider or building your own infrastructure. It describes how to build your own API PaaS using components like Kurento Media Server and cloud services from AWS. The document provides cost comparisons and examples of configuring ElasticRTC, an open-source tool for deploying a scalable and elastic Kurento media server cluster on AWS.
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
How to have your own WebRTC cloud scaling to billions in minutes
1. How to have your own WebRTC cloud
scaling to the billions in minutes
Luis Lopez
lulop@kurento.org
2. Developing a WebRTC
service?
http://www.kurento.org - lulop@kurento.org
2
2
Media control
WebRTC
Signaling server
WebRTC
media infrastructure
Recording
Transcoding
Routing
Mixing
etc.
Media
Traffic
Multimedia Clients
Application Signaling
3. Your options
http://www.kurento.org - lulop@kurento.org
Initialinvestment
Control on your technology and business model
Third party
API PaaS
Platform as a Service
Built from
modules
Built from
scratch
Open source
or commercial
Do it yourself
Requires owning your
own infrastructure
4. Third party
PaaS provider
http://www.kurento.org - lulop@kurento.org
4
Media control
WebRTC
Signaling server
WebRTC
media infrastructure
Recording
Transcoding
Routing
Mixing
etc.
Media
Traffic
Application Signaling
Client SDK
Owned by the API PaaS Provider
Application code
Owned by you
You cannot
touch here
5. http://www.kurento.org - lulop@kurento.org
5
Media control
WebRTC
Signaling server
WebRTC
media infrastructure
Recording
Transcoding
Routing
Mixing
etc.
Media
Traffic
Application Signaling
Owned by You
Client SDK
Application code
Your own
infrastructure
Interoperate
with your IT
systems
Interoperate
with your IT
systems
6. Pros & cons.
Third party API PaaS
• Advantages
– Development Costs
• Efficient
• Time-to-market (short)
• No maintenance
• Drawbacks
– Operation Cost
• PaaS provider margin
– Lack of flexibility
– Lack of control
Owned infrastructure
• Advantages
– Operation Cost
• No margins to pay
– Full flexibility
– Full control
• Drawbacks
– Development Costs
• Complex
• Time-to-market (long)
• Maintenance
http://www.kurento.org - lulop@kurento.org 6
7. Pros & costs: costs
http://www.kurento.org - lulop@kurento.org
Totalcosts=Development+operation
Scale
Operation
costs
Operation costs +
Margin of PaaS
Provider
To the left:
External PaaS is
Cheaper
To the right:
Your own
infrastructure
Is cheaper
Initial
developmentcosts
8. Pros & costs: costs
http://www.kurento.org - lulop@kurento.org
Totalcosts=Development+operation
Scale
Operation
costs
Operation costs +
Margin of PaaS
Provider
To the left:
External PaaS is
Cheaper
To the right:
Your own
infrastructure
Is cheaper
Initial
developmentcosts
10. Some numbers
API PaaS Costs*
• API PaaS dependent
– Min around 0.1$
– Average around 0.3$
– Max around 3$
Your own infrastructure*
• Cloud provider dependent
– Around 0.01$ per video hour
http://www.kurento.org -
lulop@kurento.org
10
* Costs are calculated in hourly basis, costs assume video 500Kbps video streams
11. Cooking a scalable WebRTC media
infrastructure with AWS: Ingredients
http://www.kurento.org - lulop@kurento.org
11
ELBS3
CloudWatch
Route 53
EC2
CloudFormation
Template
VPC
Internet
Gateway
Kurento
Media
Server
Kurento
Cluster
Components
Cloud
Orchestration
Templates
Cloud
provider
services
12. Multimedia
Application logic
(developers’ code)
http://www.kurento.org - lulop@kurento.org
12
ELB
Media
Server
Instance
Media
Server
Instance
Media
Server
Instance
Media
Server
Instance
Media
Server
Instance
Media
Server
Instance
Scale out
Scale in
Multimedia Clients
Application Signaling
ELB
Cluster
Controller
Cluster
Controller
Cluster
Controller
CloudWatch
Internet
Gateway
Cluster
Controller
VPC
Route 53
Multimedia
Application logic
(developers’ code)
Multimedia
Application logic
(developers’ code)
13. http://www.kurento.org - lulop@kurento.org
13
Elastic scalable version of Kurento Media Server
– Same API as Kurento Media Server
– Leverages the cloud capabilities of AWS
– Enhanced cloud features
• Autoscaling
• Self-provisioning
– Enhanced media features
• Simulcast
• Multistream support
• Unified plan support (almost ready)
• S3 recording
– Enhanced development features
• Runtime inspector
14. Using elasticRTC
http://www.kurento.org - lulop@kurento.org
14
1. Open an AWS
account
• Get your AWS
credentials
2. Execute the
elasticRTC script
• Provide your AWS
credentials
3. Enjoy
• Develop with the same
Kurento API
• Transparent autoscaling
$ ./elasticrtc create
--region eu-west-1
--stack-name mycluster
https://github.com/ElasticRTC/elasticrtc-toolsTry it!