DEV Community

System Design of YouTube: A Detailed Deep Dive into the Video Giant

Harshit Singh on October 27, 2024

πŸ— High-Level Design (HLD) of YouTube The high-level design of YouTube is a distributed, large-scale architecture that supports several b...
Collapse
 
sachdeva_2303 profile image
Chhavi Sachdeva

Can you share some insight about the actual architecture of YouTube, I found multiple architectures and that too with slight variation over the placement of CDNs.
Also does YouTube follow monolithic or microservices or hybrid architecture?
(A slight confusion over this)

Collapse
 
wittedtech-by-harshit profile image
Harshit Singh

Indeed there are several different system design posts over the internet and all of them are saying something of their own and that can be confusing but the reason behind that is because the system is getting upgraded regularly to catch up with daily increase of users and match the latest technology for better user experience. However as the answer of your question; "YouTube primarily follows a microservices architecture, although it has evolved from a more monolithic structure in its earlier days. The microservices model allows for independent scaling, development, and deployment of individual components (e.g., user management, video encoding, content recommendations)."
"Some aspects may seem hybrid because certain legacy or tightly integrated systems might still resemble monolithic behavior. This mix helps facilitate the migration and maintenance of core services."
For the answer related to use of CDN :- "YouTube uses Google's global CDN, part of their extensive edge network. This network caches content closer to users, reducing latency and improving load times. The placement of CDNs ensures that videos are distributed efficiently, handling requests through the nearest edge location to the user."
"Typically, CDNs are positioned at strategic locations across different regions, serving as intermediaries between the user and YouTube's primary data centers. These CDNs cache popular and frequently accessed videos to minimize the load on origin servers."
"While static video content is cached in CDNs, dynamic aspects like live streaming still route through the main servers before being cached at the edge for subsequent viewers."

For DATA MANAGEMENT : "Google Bigtable and Spanner are utilized for their high-throughput and globally consistent data management capabilities, handling everything from user data to video metadata and recommendations."
"The architecture uses Maglev, Google's load balancer, which helps distribute traffic efficiently across global data centers."
For MICROSERVICES COMMUNICATION: "gRPC and REST APIs are used."
For COMMUNICATION PROTOCOL: "QUIC and HTTP/2 are often used for faster, more reliable video transmission."

Hope this will clear your doubts. If You still have any question/query, feel free to ask or connect with me in any social media platform. I will try my best to explain everything as per my knowledge. @sachdeva_2303

Collapse
 
sachdeva_2303 profile image
Chhavi Sachdeva

Really grateful for this response.

Collapse
 
wittedtech-by-harshit profile image
Harshit Singh

Do Share Your Feedbacks.

Collapse
 
techben profile image
Aryan Pro

Thanks for sharing this. Well written.
Somehow you managed to say about everything, but still there are lot of leftovers.
Lot of new terms were unknown. But we cannot explain or read everything. Wondering how they manage to handle this dataflow and design implementation.

Collapse
 
wittedtech-by-harshit profile image
Harshit Singh

I tried to provide an detailed overview; still if anything particular, you would like to know about. Do mention the topic/question, i'll try to explain it in the next post.

Collapse
 
niteshnkj profile image
Nitesh-nkj

How does YouTube live streaming works?

Collapse
 
wittedtech-by-harshit profile image
Harshit Singh

I have posted an article with the explanation "How Youtube's Live Streaming and Content Delivery Works". You can check it out : dev.to/wittedtech-by-harshit/unvei...

Collapse
 
zidan_ba82bf8632fb0c70223 profile image
Zidan

How about their frontend, it's seems to be a mix of SSR and SPA to me. Can you shed some light onto it?

Collapse
 
wittedtech-by-harshit profile image
Harshit Singh

@zidan_ba82bf8632fb0c70223 || You're absolutely correct! YouTube's frontend is indeed a hybrid approach that combines both Server-Side Rendering (SSR) and Single Page Application (SPA) characteristics. This blend provides YouTube with a fast and interactive user experience, optimized for both SEO and performance. || I think you'll find this article of mine useful - dev.to/wittedtech-by-harshit/insid...

Collapse
 
sasikumar_pallekonda_0fa7 profile image
Sasikumar Pallekonda

Well written, best part I liked was the choices at each component.

Collapse
 
wittedtech-by-harshit profile image
Harshit Singh

Thanks for the feedback sir.😊