SlideShare ist ein Scribd-Unternehmen logo
1 von 13
System Design For Video
Streaming Service
ZoneLB
LBLBLB
Zone2Zone3Zone1
M2M3M1M3M2M1M3M2M1
CDN Object
Storage
Video
Transcoding
Video Upload
Library
DB
(NoSQL)
In-Memory
DB
Auth/User
DB (SQL)
Billing DB
(SQL)
API
Gateway
Queue
M2M1
R2R1
MapReduce
mp4
1080p
mp4
720p
mov
1080p
Hadoop Cluster
Recommendation
Engine
OAuth
…..
ZoneLB
LBLBLB
Zone2Zone3Zone1
• Request arrives at the zone level load balancer
• The zone load balancer is responsible for routing the requests to the
correct zones
• The zone load balancer would use geolocation-based routing policy
• Using Geolocation based routing policy allows for
⁻ Low latency
⁻ Region based distribution/availability of content and/or features
• In addition to using geolocation-based routing, the system will also use
health checks to determine the health of a zone and re-route traffic to
another zone in case the geo-location based chosen zone is unhealthy
• Using a multi-value routing policy enables the system to continue to be
highly available at the cost of some performance even during zone
outages
• Routing traffic to a non-preferred zone would still need to be constrained
since connecting to any zone could result in issues with region based
content delivery
Zone Load Balancer
• Once the request is routed to a zone, each zone has a set of load balancers
• These load balancers are responsible to route the traffic to the servers
• The routing policy for these 2nd level load balancers would be round-robin
• Choosing round robin as the routing policy ensures that no server/instance
is overused leading to failures
• This load balancer also checks for the health of their instances/servers in
order to not route the request to a server in a bad state
Regular Load Balancer
LBLBLB
Zone2Zone3Zone1
M2M3M1M3M2M1M3M2M1…..
• Once the request reaches the instance, it is first greeted by the API Gateway.
• When using AWS, we could use the API Gateway service provided by AWS
but for flexibility purposes, we chose to have a 3rd party/ home grown API
gateway in this case
• The API Gateway can then route the request based on the endpoint to either
services hosted on other instances or micro-services or even present as logic
in the instance itself
• In this particular architecture we are choosing to have the business logic / API
endpoint functions within the instance. For example, logic for authentication
or billing or the logic for fetching the recommendations / watch history from
the in-memory database
• This could be extended to instead use micro-services for each of the logic /
API endpoint functions too.
• These instances are configured to be dynamically scalable
₋ Horizontal scaling for AWS/Azure
₋ Combination of Horizontal and Vertical Scaling if using custom cloud
Instances / Servers
Auth DB
(SQL)
Billing DB
(SQL)
APIGateway
API call
Login
API call Get
Library
API call Set
Watched
API call
Get Info
• The main database architecture is designed to be fast and reliable with a combination of NoSQL and in-memory database
• The Library DB as seen in the architecture diagram is used to store data such as
⁻ Names and metadata of video titles ( such as movies and tv-series )
⁻ Each users watch and search history
⁻ Other metadata for each user which can be used in analytics such as watch times, which titles the user engaged more
with, etc
⁻ Some of this metadata is written / updated with user actions ( such as adding a title to the users watch history as soon
as they play the title for x seconds/minutes, while some are updated by services such as recommendation engine (
example, adding titles to the recommended field/key after running through the algorithm for recommendation )
Database
Library
DB
(NoSQL)
In-Memory
DB
• This database is chosen to be NoSQL since there are some key characteristics about the data stored :
⁻ The number of writes to this database is not very high due to the nature of the data
⁻ NoSQL will allow us to shard the data better in order to be able to scale horizontally in the database cluster
⁻ Data for each user can be consolidated within one document and fetched with 1 call instead of having multiple tables
and/or performing joins etc as in relational dbs
⁻ Similar case applies for data about each title. All metadata can be consolidated within one document
• In addition to the NoSQL database, we have added an in-memory database ( such as Redis ) to allow for faster read times
• This will allow us to not only deliver initial content quickly to the client, but also help with features such as fast search, etc
• The In-Memory database can be configured to persist data at either regular intervals or at every write. In case of this
architecture though, regular interval updating makes more sense because none of the data we are storing is time-critical.
For example, if we are writing the time stamp for when the user/client paused a video. In this case, if the data in memory is
lost for some reason, and the pause time stamp is not updated in persistent storage, it still does not affect the usability of
the system. By making this decision we are prioritizing performance over consistency for non time-critical data
• For enabling fast searches, we can use custom Redis solutions that enable representing a prefix-tree / trie in the Redis key-
value format. Prefix trees allow for quick string searches. Prefixy is an implementation that allows for such a Redis mapped
prefix tree along with ranks for searches based on popularity.
Database
• When a new title needs to be uploaded to be served via the video streaming platform, we go through a series of steps to
make sure of seamless delivery of the content
• A newly uploaded title first goes through the process of transcoding ( converting the video into multiple formats and
resolutions )
• The processed videos are pushed to an object storage for persistent storage
• In order to facilitate fast and reliable streaming though, these videos/titles are then pushed to CDN servers around the
world to enable availability as close as possible to a client
New Content onboarding and delivery
CDN Object
Storage
Video
Transcoding
Video Upload
• Video transcoding is the process of converting a video into multiple formats
and multiple resolutions for each format
• This is required in order for providing seamless service even at low
performing internet speeds at the client side
• In our system the transcoding process is done with a Hadoop cluster
• When a title is uploaded, it gets queued in HDFS to be processed
• The title is broken down into multiple chunks to be processed by the
mappers
Video Transcoding
Queue
M2M1
R2R1
MapReduce
mp4
1080p
mp4
720p
mov
1080p
Hadoop Cluster
• Mappers convert the chunks of video into different video formats and resolutions
• These chunks are then re-stitched into a single title with the reducers and then written out along with extra meta-data
• The converted titles are then pushed to an object storage for persistent storage as mentioned before
• The recommendation system in our services uses AI/ML for recommendation
• The recommendation system uses 2 types of ML techniques
‾ Content Based
‾ Collaborative Based
• In the content-based system, the recommendations are calculated based on
each user’s watch and search history
• In the collaborative-based system, the recommendations are calculated based
on the results of multiple users and various trends
Recommendation Engine
Recommendation
Engine
• The recommendation system in our service would also take into consideration the times of the day, week or year, etc
• For example, which type shows are usually more viewed on weekends ( drama vs family show ) or during different times of
year ( Halloween time vs Christmas )
• The recommendation system then updates the in-memory database which holds the “landing page” for each user with the
personalized recommendations at regular intervals
• Client side : React JS / React Native
• Authorization : OAuth 2.0
• Authentication : OpenID connect
• Load Balancer : HAProxy+GeoIP / AWS ELB / Azure LB
• Backend : Python
• Databases :
₋ MySQL for billing and user/auth database
₋ NoSQL database like MongoDB / DynamoDB ( AWS )
₋ Redis for in-memory database
• Video Transcoding : Hadoop Map-Reduce
• Video Storage : Object Storage ( S3 : AWS / Azure : Blob )
• CDN : Akamai / AWS CloudFront / Azure CDN
• Recommendation Engine : Custom python implementation / AWS Personalize / Azure ML service
Technologies
• Prefixy : https://prefixy.github.io/
• HAProxy as LB : https://www.linode.com/docs/uptime/loadbalancing/how-to-use-haproxy-for-load-balancing/
• GeoIP with HAProxy : https://www.haproxy.com/blog/use-geoip-database-within-haproxy/
• CDN : https://www.akamai.com/us/en/resources/cdn-video-streaming.jsp
• Netflix System Design :
https://medium.com/@narengowda/netflix-system-design-dbec30fede8d
https://www.youtube.com/channel/UCn1XnDWhsLS5URXTi5wtFTA
• Redis for landing page ( similar to twitter timelines ) :
https://blog.twitter.com/engineering/en_us/topics/infrastructure/2017/the-infrastructure-behind-twitter-scale.html
• OAuth 2.0 and OpenID Connect : https://www.youtube.com/watch?v=996OiexHze0&feature=youtu.be
• Hadoop for Video Transcoding :
https://content.pivotal.io/blog/using-hadoop-mapreduce-for-distributed-video-transcoding
https://pdfs.semanticscholar.org/43b9/bab9b801f0e548e97462ccc94089dd13b2c6.pdf
References
Thank You!

Weitere ähnliche Inhalte

Was ist angesagt?

Stream Processing with Apache Kafka and .NET
Stream Processing with Apache Kafka and .NETStream Processing with Apache Kafka and .NET
Stream Processing with Apache Kafka and .NETconfluent
 
Building Microservices with Apache Kafka
Building Microservices with Apache KafkaBuilding Microservices with Apache Kafka
Building Microservices with Apache Kafkaconfluent
 
Uber: Kafka Consumer Proxy
Uber: Kafka Consumer ProxyUber: Kafka Consumer Proxy
Uber: Kafka Consumer Proxyconfluent
 
Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - KafkaMayank Bansal
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafkaconfluent
 
[백서 요약] Building a Real-Time Bidding Platform on AWS
[백서 요약] Building a Real-Time Bidding Platform on AWS[백서 요약] Building a Real-Time Bidding Platform on AWS
[백서 요약] Building a Real-Time Bidding Platform on AWSAmazon Web Services Korea
 
An Introduction to Apache Kafka
An Introduction to Apache KafkaAn Introduction to Apache Kafka
An Introduction to Apache KafkaAmir Sedighi
 
Introduction to Kafka Streams
Introduction to Kafka StreamsIntroduction to Kafka Streams
Introduction to Kafka StreamsGuozhang Wang
 
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...confluent
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using KafkaKnoldus Inc.
 
Considerations for Data Access in the Lakehouse
Considerations for Data Access in the LakehouseConsiderations for Data Access in the Lakehouse
Considerations for Data Access in the LakehouseDatabricks
 
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...Flink Forward
 
Streaming data for real time analysis
Streaming data for real time analysisStreaming data for real time analysis
Streaming data for real time analysisAmazon Web Services
 
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Simplify CDC Pipeline with Spark Streaming SQL and Delta LakeSimplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Simplify CDC Pipeline with Spark Streaming SQL and Delta LakeDatabricks
 
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021StreamNative
 
Amazon EMR 고급 활용 기법 - AWS Summit Seoul 2017
Amazon EMR 고급 활용 기법 - AWS Summit Seoul 2017Amazon EMR 고급 활용 기법 - AWS Summit Seoul 2017
Amazon EMR 고급 활용 기법 - AWS Summit Seoul 2017Amazon Web Services Korea
 
MelOn 빅데이터 플랫폼과 Tajo 이야기
MelOn 빅데이터 플랫폼과 Tajo 이야기MelOn 빅데이터 플랫폼과 Tajo 이야기
MelOn 빅데이터 플랫폼과 Tajo 이야기Gruter
 
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022HostedbyConfluent
 

Was ist angesagt? (20)

Stream Processing with Apache Kafka and .NET
Stream Processing with Apache Kafka and .NETStream Processing with Apache Kafka and .NET
Stream Processing with Apache Kafka and .NET
 
Building Microservices with Apache Kafka
Building Microservices with Apache KafkaBuilding Microservices with Apache Kafka
Building Microservices with Apache Kafka
 
Uber: Kafka Consumer Proxy
Uber: Kafka Consumer ProxyUber: Kafka Consumer Proxy
Uber: Kafka Consumer Proxy
 
Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - Kafka
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafka
 
[백서 요약] Building a Real-Time Bidding Platform on AWS
[백서 요약] Building a Real-Time Bidding Platform on AWS[백서 요약] Building a Real-Time Bidding Platform on AWS
[백서 요약] Building a Real-Time Bidding Platform on AWS
 
AWS glue technical enablement training
AWS glue technical enablement trainingAWS glue technical enablement training
AWS glue technical enablement training
 
An Introduction to Apache Kafka
An Introduction to Apache KafkaAn Introduction to Apache Kafka
An Introduction to Apache Kafka
 
Introduction to Kafka Streams
Introduction to Kafka StreamsIntroduction to Kafka Streams
Introduction to Kafka Streams
 
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
 
Considerations for Data Access in the Lakehouse
Considerations for Data Access in the LakehouseConsiderations for Data Access in the Lakehouse
Considerations for Data Access in the Lakehouse
 
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
 
Streaming data for real time analysis
Streaming data for real time analysisStreaming data for real time analysis
Streaming data for real time analysis
 
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Simplify CDC Pipeline with Spark Streaming SQL and Delta LakeSimplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
 
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
 
Amazon EMR 고급 활용 기법 - AWS Summit Seoul 2017
Amazon EMR 고급 활용 기법 - AWS Summit Seoul 2017Amazon EMR 고급 활용 기법 - AWS Summit Seoul 2017
Amazon EMR 고급 활용 기법 - AWS Summit Seoul 2017
 
MelOn 빅데이터 플랫폼과 Tajo 이야기
MelOn 빅데이터 플랫폼과 Tajo 이야기MelOn 빅데이터 플랫폼과 Tajo 이야기
MelOn 빅데이터 플랫폼과 Tajo 이야기
 
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022
 

Ähnlich wie System design for video streaming service

Nuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloudNuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloudDavid Veksler
 
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Amazon Web Services
 
Amazon Web Services - Relational Database Service Meetup
Amazon Web Services - Relational Database Service MeetupAmazon Web Services - Relational Database Service Meetup
Amazon Web Services - Relational Database Service Meetupcyrilkhairallah
 
Should I move my database to the cloud?
Should I move my database to the cloud?Should I move my database to the cloud?
Should I move my database to the cloud?James Serra
 
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...Ram G Athreya
 
Red Hat Storage Day LA - Persistent Storage for Linux Containers
Red Hat Storage Day LA - Persistent Storage for Linux Containers Red Hat Storage Day LA - Persistent Storage for Linux Containers
Red Hat Storage Day LA - Persistent Storage for Linux Containers Red_Hat_Storage
 
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Antonios Chatzipavlis
 
Oracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra PasalapudiOracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra Pasalapudipasalapudi123
 
Data warehousing in the era of Big Data: Deep Dive into Amazon Redshift
Data warehousing in the era of Big Data: Deep Dive into Amazon RedshiftData warehousing in the era of Big Data: Deep Dive into Amazon Redshift
Data warehousing in the era of Big Data: Deep Dive into Amazon RedshiftAmazon Web Services
 
Building Real World Application with Azure
Building Real World Application with AzureBuilding Real World Application with Azure
Building Real World Application with Azuredivyapisces
 
Clash of Technologies Google Cloud vs Microsoft Azure
Clash of Technologies Google Cloud vs Microsoft AzureClash of Technologies Google Cloud vs Microsoft Azure
Clash of Technologies Google Cloud vs Microsoft AzureMihail Mateev
 
Red Hat Storage Day Atlanta - Persistent Storage for Linux Containers
Red Hat Storage Day Atlanta - Persistent Storage for Linux Containers Red Hat Storage Day Atlanta - Persistent Storage for Linux Containers
Red Hat Storage Day Atlanta - Persistent Storage for Linux Containers Red_Hat_Storage
 
AWS Public Cloud solution for ABC Corporation
AWS Public Cloud solution for ABC CorporationAWS Public Cloud solution for ABC Corporation
AWS Public Cloud solution for ABC CorporationManpreet Sidhu
 
Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS Tom Laszewski
 
Migration Recipes for Success - AWS Summit Cape Town 2017
Migration Recipes for Success - AWS Summit Cape Town 2017 Migration Recipes for Success - AWS Summit Cape Town 2017
Migration Recipes for Success - AWS Summit Cape Town 2017 Amazon Web Services
 
Sql Start! 2020 - SQL Server Lift & Shift su Azure
Sql Start! 2020 - SQL Server Lift & Shift su AzureSql Start! 2020 - SQL Server Lift & Shift su Azure
Sql Start! 2020 - SQL Server Lift & Shift su AzureMarco Obinu
 
Optimize Your Reporting In Less Than 10 Minutes
Optimize Your Reporting In Less Than 10 MinutesOptimize Your Reporting In Less Than 10 Minutes
Optimize Your Reporting In Less Than 10 MinutesAlexandra Sasha Blumenfeld
 
Choosing the Right Data Storage Solution
Choosing the Right Data Storage SolutionChoosing the Right Data Storage Solution
Choosing the Right Data Storage SolutionAmazon Web Services
 

Ähnlich wie System design for video streaming service (20)

Azure data platform overview
Azure data platform overviewAzure data platform overview
Azure data platform overview
 
Nuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloudNuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloud
 
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
 
Amazon Web Services - Relational Database Service Meetup
Amazon Web Services - Relational Database Service MeetupAmazon Web Services - Relational Database Service Meetup
Amazon Web Services - Relational Database Service Meetup
 
Should I move my database to the cloud?
Should I move my database to the cloud?Should I move my database to the cloud?
Should I move my database to the cloud?
 
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
 
Red Hat Storage Day LA - Persistent Storage for Linux Containers
Red Hat Storage Day LA - Persistent Storage for Linux Containers Red Hat Storage Day LA - Persistent Storage for Linux Containers
Red Hat Storage Day LA - Persistent Storage for Linux Containers
 
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
 
Oracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra PasalapudiOracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra Pasalapudi
 
Data warehousing in the era of Big Data: Deep Dive into Amazon Redshift
Data warehousing in the era of Big Data: Deep Dive into Amazon RedshiftData warehousing in the era of Big Data: Deep Dive into Amazon Redshift
Data warehousing in the era of Big Data: Deep Dive into Amazon Redshift
 
Building Real World Application with Azure
Building Real World Application with AzureBuilding Real World Application with Azure
Building Real World Application with Azure
 
Clash of Technologies Google Cloud vs Microsoft Azure
Clash of Technologies Google Cloud vs Microsoft AzureClash of Technologies Google Cloud vs Microsoft Azure
Clash of Technologies Google Cloud vs Microsoft Azure
 
Red Hat Storage Day Atlanta - Persistent Storage for Linux Containers
Red Hat Storage Day Atlanta - Persistent Storage for Linux Containers Red Hat Storage Day Atlanta - Persistent Storage for Linux Containers
Red Hat Storage Day Atlanta - Persistent Storage for Linux Containers
 
Create cloud service on AWS
Create cloud service on AWSCreate cloud service on AWS
Create cloud service on AWS
 
AWS Public Cloud solution for ABC Corporation
AWS Public Cloud solution for ABC CorporationAWS Public Cloud solution for ABC Corporation
AWS Public Cloud solution for ABC Corporation
 
Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS
 
Migration Recipes for Success - AWS Summit Cape Town 2017
Migration Recipes for Success - AWS Summit Cape Town 2017 Migration Recipes for Success - AWS Summit Cape Town 2017
Migration Recipes for Success - AWS Summit Cape Town 2017
 
Sql Start! 2020 - SQL Server Lift & Shift su Azure
Sql Start! 2020 - SQL Server Lift & Shift su AzureSql Start! 2020 - SQL Server Lift & Shift su Azure
Sql Start! 2020 - SQL Server Lift & Shift su Azure
 
Optimize Your Reporting In Less Than 10 Minutes
Optimize Your Reporting In Less Than 10 MinutesOptimize Your Reporting In Less Than 10 Minutes
Optimize Your Reporting In Less Than 10 Minutes
 
Choosing the Right Data Storage Solution
Choosing the Right Data Storage SolutionChoosing the Right Data Storage Solution
Choosing the Right Data Storage Solution
 

Kürzlich hochgeladen

All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607dollysharma2066
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...sonatiwari757
 

Kürzlich hochgeladen (20)

All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Call Girls In Noida 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Noida 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In Noida 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Noida 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
Call Girls in Mayur Vihar ✔️ 9711199171 ✔️ Delhi ✔️ Enjoy Call Girls With Our...
 

System design for video streaming service

  • 1. System Design For Video Streaming Service
  • 2. ZoneLB LBLBLB Zone2Zone3Zone1 M2M3M1M3M2M1M3M2M1 CDN Object Storage Video Transcoding Video Upload Library DB (NoSQL) In-Memory DB Auth/User DB (SQL) Billing DB (SQL) API Gateway Queue M2M1 R2R1 MapReduce mp4 1080p mp4 720p mov 1080p Hadoop Cluster Recommendation Engine OAuth …..
  • 3. ZoneLB LBLBLB Zone2Zone3Zone1 • Request arrives at the zone level load balancer • The zone load balancer is responsible for routing the requests to the correct zones • The zone load balancer would use geolocation-based routing policy • Using Geolocation based routing policy allows for ⁻ Low latency ⁻ Region based distribution/availability of content and/or features • In addition to using geolocation-based routing, the system will also use health checks to determine the health of a zone and re-route traffic to another zone in case the geo-location based chosen zone is unhealthy • Using a multi-value routing policy enables the system to continue to be highly available at the cost of some performance even during zone outages • Routing traffic to a non-preferred zone would still need to be constrained since connecting to any zone could result in issues with region based content delivery Zone Load Balancer
  • 4. • Once the request is routed to a zone, each zone has a set of load balancers • These load balancers are responsible to route the traffic to the servers • The routing policy for these 2nd level load balancers would be round-robin • Choosing round robin as the routing policy ensures that no server/instance is overused leading to failures • This load balancer also checks for the health of their instances/servers in order to not route the request to a server in a bad state Regular Load Balancer LBLBLB Zone2Zone3Zone1 M2M3M1M3M2M1M3M2M1…..
  • 5. • Once the request reaches the instance, it is first greeted by the API Gateway. • When using AWS, we could use the API Gateway service provided by AWS but for flexibility purposes, we chose to have a 3rd party/ home grown API gateway in this case • The API Gateway can then route the request based on the endpoint to either services hosted on other instances or micro-services or even present as logic in the instance itself • In this particular architecture we are choosing to have the business logic / API endpoint functions within the instance. For example, logic for authentication or billing or the logic for fetching the recommendations / watch history from the in-memory database • This could be extended to instead use micro-services for each of the logic / API endpoint functions too. • These instances are configured to be dynamically scalable ₋ Horizontal scaling for AWS/Azure ₋ Combination of Horizontal and Vertical Scaling if using custom cloud Instances / Servers Auth DB (SQL) Billing DB (SQL) APIGateway API call Login API call Get Library API call Set Watched API call Get Info
  • 6. • The main database architecture is designed to be fast and reliable with a combination of NoSQL and in-memory database • The Library DB as seen in the architecture diagram is used to store data such as ⁻ Names and metadata of video titles ( such as movies and tv-series ) ⁻ Each users watch and search history ⁻ Other metadata for each user which can be used in analytics such as watch times, which titles the user engaged more with, etc ⁻ Some of this metadata is written / updated with user actions ( such as adding a title to the users watch history as soon as they play the title for x seconds/minutes, while some are updated by services such as recommendation engine ( example, adding titles to the recommended field/key after running through the algorithm for recommendation ) Database Library DB (NoSQL) In-Memory DB
  • 7. • This database is chosen to be NoSQL since there are some key characteristics about the data stored : ⁻ The number of writes to this database is not very high due to the nature of the data ⁻ NoSQL will allow us to shard the data better in order to be able to scale horizontally in the database cluster ⁻ Data for each user can be consolidated within one document and fetched with 1 call instead of having multiple tables and/or performing joins etc as in relational dbs ⁻ Similar case applies for data about each title. All metadata can be consolidated within one document • In addition to the NoSQL database, we have added an in-memory database ( such as Redis ) to allow for faster read times • This will allow us to not only deliver initial content quickly to the client, but also help with features such as fast search, etc • The In-Memory database can be configured to persist data at either regular intervals or at every write. In case of this architecture though, regular interval updating makes more sense because none of the data we are storing is time-critical. For example, if we are writing the time stamp for when the user/client paused a video. In this case, if the data in memory is lost for some reason, and the pause time stamp is not updated in persistent storage, it still does not affect the usability of the system. By making this decision we are prioritizing performance over consistency for non time-critical data • For enabling fast searches, we can use custom Redis solutions that enable representing a prefix-tree / trie in the Redis key- value format. Prefix trees allow for quick string searches. Prefixy is an implementation that allows for such a Redis mapped prefix tree along with ranks for searches based on popularity. Database
  • 8. • When a new title needs to be uploaded to be served via the video streaming platform, we go through a series of steps to make sure of seamless delivery of the content • A newly uploaded title first goes through the process of transcoding ( converting the video into multiple formats and resolutions ) • The processed videos are pushed to an object storage for persistent storage • In order to facilitate fast and reliable streaming though, these videos/titles are then pushed to CDN servers around the world to enable availability as close as possible to a client New Content onboarding and delivery CDN Object Storage Video Transcoding Video Upload
  • 9. • Video transcoding is the process of converting a video into multiple formats and multiple resolutions for each format • This is required in order for providing seamless service even at low performing internet speeds at the client side • In our system the transcoding process is done with a Hadoop cluster • When a title is uploaded, it gets queued in HDFS to be processed • The title is broken down into multiple chunks to be processed by the mappers Video Transcoding Queue M2M1 R2R1 MapReduce mp4 1080p mp4 720p mov 1080p Hadoop Cluster • Mappers convert the chunks of video into different video formats and resolutions • These chunks are then re-stitched into a single title with the reducers and then written out along with extra meta-data • The converted titles are then pushed to an object storage for persistent storage as mentioned before
  • 10. • The recommendation system in our services uses AI/ML for recommendation • The recommendation system uses 2 types of ML techniques ‾ Content Based ‾ Collaborative Based • In the content-based system, the recommendations are calculated based on each user’s watch and search history • In the collaborative-based system, the recommendations are calculated based on the results of multiple users and various trends Recommendation Engine Recommendation Engine • The recommendation system in our service would also take into consideration the times of the day, week or year, etc • For example, which type shows are usually more viewed on weekends ( drama vs family show ) or during different times of year ( Halloween time vs Christmas ) • The recommendation system then updates the in-memory database which holds the “landing page” for each user with the personalized recommendations at regular intervals
  • 11. • Client side : React JS / React Native • Authorization : OAuth 2.0 • Authentication : OpenID connect • Load Balancer : HAProxy+GeoIP / AWS ELB / Azure LB • Backend : Python • Databases : ₋ MySQL for billing and user/auth database ₋ NoSQL database like MongoDB / DynamoDB ( AWS ) ₋ Redis for in-memory database • Video Transcoding : Hadoop Map-Reduce • Video Storage : Object Storage ( S3 : AWS / Azure : Blob ) • CDN : Akamai / AWS CloudFront / Azure CDN • Recommendation Engine : Custom python implementation / AWS Personalize / Azure ML service Technologies
  • 12. • Prefixy : https://prefixy.github.io/ • HAProxy as LB : https://www.linode.com/docs/uptime/loadbalancing/how-to-use-haproxy-for-load-balancing/ • GeoIP with HAProxy : https://www.haproxy.com/blog/use-geoip-database-within-haproxy/ • CDN : https://www.akamai.com/us/en/resources/cdn-video-streaming.jsp • Netflix System Design : https://medium.com/@narengowda/netflix-system-design-dbec30fede8d https://www.youtube.com/channel/UCn1XnDWhsLS5URXTi5wtFTA • Redis for landing page ( similar to twitter timelines ) : https://blog.twitter.com/engineering/en_us/topics/infrastructure/2017/the-infrastructure-behind-twitter-scale.html • OAuth 2.0 and OpenID Connect : https://www.youtube.com/watch?v=996OiexHze0&feature=youtu.be • Hadoop for Video Transcoding : https://content.pivotal.io/blog/using-hadoop-mapreduce-for-distributed-video-transcoding https://pdfs.semanticscholar.org/43b9/bab9b801f0e548e97462ccc94089dd13b2c6.pdf References