Grokking the System Design Interview
Vote

0% completed

​

Designing Youtube or Netflix

Why YouTube?

Try it yourself

Sketch it here

Designing YouTube (video)

Step 1: Clarify the Requirements

Step 2: Estimate the Scale

Step 3: Define the API

Step 4: Define the Data Model

Step 5: Draw the High-Level Design

Step 6: Go Deep

Where are the videos stored?

How should we manage read traffic?

Where are thumbnails stored?

Video uploads

Video encoding

Metadata sharding

Video deduplication

Load balancing

Cache

Content Delivery Network (CDN)

How playback works

Step 7: Bottlenecks and Failure Points

Where AI Fits in This Design

Every case study in this chapter follows the same seven steps from System Design Interviews: A step by step guide, and builds its design from the components in the System Design Master Template. Keep both open beside you, and try each problem yourself before reading the solution.

Why YouTube?

YouTube is one of the most popular video sharing services in the world. Users can upload, view, share, and rate videos. They can also report videos and add comments. A video-on-demand service like Netflix shares most of this design.

Try it yourself

Before reading the solution, try designing it. Aim to produce four things: the requirements, a rough load estimate, the API, and a first drawing of the components.

Sketch it here

Designing YouTube (video)

Here is a video discussing how to design YouTube:

Designing YouTube or Netflix: Read-Heavy Scale Estimates, Upload Processing Queues, Object Storage, and Serving Video Through a CDN (Video)

Step 1: Clarify the Requirements

💡 Always clarify requirements at the beginning of the interview. Ask questions until you know the exact scope of the system the interviewer has in mind.

We will design a simpler version of YouTube.

Functional requirements

  1. Users can upload videos.
  2. Users can share and view videos.
  3. Users can search for videos by title.
  4. The service records stats for each video, like likes, dislikes, and total views.
  5. Users can add and view comments on videos.

Non-functional requirements

  1. High reliability. Any video that is uploaded must never be lost.
  2. High availability. To keep the service available, we accept weaker consistency. If a user does not see a new video for a short time, that is fine.
  3. Low latency on playback. Watching a video should feel real time, with no lag.

Out of scope: video recommendations, most popular videos, channels, subscriptions, watch later, and favorites.

Requirement 2 gives up immediate consistency to keep the service available, so some reads return stale data, meaning data that is out of date. Step 6 shows exactly where that staleness appears.

Step 2: Estimate the Scale

Ask the interviewer for the size of the user base and the ratio of uploads to views. Assume 1.5 billion total users, of whom 800 million are daily active users. Assume an average user views five videos per day.

800M x 5 / 86,400 seconds       = ~46K video views per second

Assume an upload:view ratio of 1:200. For every video uploaded, 200 videos are viewed.

46K / 200                       = ~230 videos uploaded per second

Storage. Assume 500 hours of video are uploaded every minute. Assume one minute of video needs 50 MB of storage. That figure is high because we store each video in multiple formats.

500 hours x 60 mins x 50MB      = 1,500 GB per minute (25 GB per second)

These estimates ignore video compression and replication, which would change the real numbers.

Bandwidth. 500 hours per minute is 30,000 minutes of video per minute. Assume that uploading one minute of video sends about 10 MB over the network.

500 hours x 60 mins x 10MB      = 300 GB per minute (5 GB per second) incoming

Every uploaded byte is sent out again once per view. With a 1:200 ratio, outgoing traffic is 200 times incoming traffic. This calculation assumes that a viewer streams a whole video at the same bitrate as the upload, where bitrate is the number of bits used for each second of video. This is a simplification, and it is worth stating out loud.

5 GB/s x 200                    = 1 TB per second outgoing

These numbers contain one hidden assumption, and an interviewer may well find it. Two of the estimates were made independently: 500 hours of video a minute, and 230 uploads a second. The first is 30,000 minutes of video per minute, and the second is 13,800 uploads per minute. Divide the first by the second, and the average video is about two minutes long. Every storage and bandwidth figure above depends on that average. If you assume a longer average video, then either the upload count falls or the storage rises.

Three of these numbers change the design:

  • 46K views against 230 uploads per second. The system is read heavy, meaning it serves far more reads than writes. So every expensive improvement should go to the read path, the parts of the system that serve views.
  • 25 GB of new video per second. No single machine can hold this, so video storage must be distributed from the start.
  • 1 TB per second outgoing. One data center cannot serve this, which is why step 6 adds a CDN (content delivery network), a set of servers placed close to viewers.

Step 3: Define the API

💡 Defining the API early makes you state exactly what the system does, and it usually reveals a requirement that nobody has stated yet.

We can expose the service through REST APIs. Three calls cover the core product: upload, search, and stream.

uploadVideo(api_dev_key, video_title, video_description, tags[], category_id, default_language, recording_details, video_contents)

api_dev_key is the API developer key of a registered account. We use it, among other things, to throttle users based on their allocated quota. Throttling means limiting how many requests each user can make. The next parameters describe the video: a title, an optional description and tags, and a category_id like Film or Song. Then come the default language and the recording location. video_contents is the video stream itself.

Returns: a successful upload returns HTTP 202 (request accepted). Encoding runs later in the background. When encoding completes, the user gets an email with a link to the video. We can also expose an API that the client can query for the current status of an uploaded video.

searchVideo(api_dev_key, search_query, user_location, maximum_videos_to_return, page_token)

search_query holds the search terms, and user_location is the optional location of the searching user. maximum_videos_to_return limits the number of results in one request, and page_token identifies which page of the result set to return.

Returns: a JSON list of the video resources that match the query. Each resource has a video title, a thumbnail, a creation date, and a view count.

streamVideo(api_dev_key, video_id, offset, codec, resolution)

video_id identifies the video. offset is a time in seconds from the beginning of the video. We store the offset on the server, so a user can pause on one device and continue on another from the same point. The client also sends codec and resolution. A codec is the format used to compress and decompress video. A TV and a phone use different codecs and resolutions, so both values are needed to resume playback across devices.

Returns: a media stream (one video chunk) that starts at the given offset. Step 6 shows how the player requests these chunks one after another.

Step 4: Define the Data Model

The system stores two very different kinds of data. Video files are large binary objects, and they never go into a database. Step 6 shows where they are stored. Metadata is the data that describes a video, such as its title and view count. Metadata rows are small and structured, and they go into a SQL database.

The entities, meaning the kinds of things we store records for, come directly from the requirements. Users upload videos, and users comment on videos. That gives three tables: Video, Comment, and User. The video files are kept in a separate file store, and each Video row stores the path of its file there.

Video metadata storage (MySQL). Store the following with each video:

  • VideoID
  • Title
  • Description
  • Size
  • Thumbnail
  • Uploader/User
  • Total number of likes
  • Total number of dislikes
  • Total number of views

For each video comment, store:

  • CommentID
  • VideoID
  • UserID
  • Comment
  • TimeOfCreation

User data storage (MySQL). UserID, name, email, address, age, and registration details.

The schema below shows the three tables, their keys, and the file store that the video rows point to:

Database schema for YouTube
Database schema for YouTube

Video holds one row per video, keyed by VideoID, which means that this ID identifies each row. It is the same ID that streamVideo takes as a parameter. Title, Description, and Size describe the upload, and search by title reads the Title column. Thumbnail points to the video's thumbnail files. Uploader/User holds the UserID of the uploading account, so one user maps to many videos. The row never holds the video file itself, only the path of that file in the file store.

The last three columns are the totals of likes, dislikes, and views. Requirement 4 asked for exactly these stats. They are the only Video columns that keep changing after the upload. Step 6 places a cache in front of the hot rows, meaning the rows that are read most often, but a cache helps only reads. At 46K views per second, adding one to the row on every view would overload the rows of popular videos. So a view is never written to the row directly. Each view is appended as an event to a log, which is a queue that keeps events in arrival order. A stream job, a program that processes events continuously as they arrive, reads the log and adds up the events for each video in memory. Every few seconds, the job writes the new totals to the Video row in one update. Likes and dislikes are counted the same way. The displayed count is therefore a few seconds behind, and requirement 2 already accepts that kind of staleness.

Comment holds one row per comment, keyed by CommentID. VideoID names the video the comment belongs to, so one video maps to many comments. UserID names the author, and TimeOfCreation lets us show comments in time order. These five fields are the whole record. We store no location with a comment. The user_location in the search API is a request parameter, not a stored field.

User holds one row per account, keyed by UserID. Both other tables refer to it: a Video row names its uploader, and a Comment row names its author. This table grows only when someone registers.

One piece of data that step 3 needs is not stored anywhere yet. streamVideo resumes playback from an offset held on the server, and none of the three tables stores one. An offset belongs to a user and a video together, so it needs its own record, called WatchPosition. The record is keyed by UserID and VideoID, and it holds the offset in seconds and the time it was last written. Keep the offset out of the Video row. For every viewer, the offset is rewritten at regular intervals during playback, which is a much heavier write load than the video's own metadata receives. A key-value store, a database that reads and writes one value by its key, suits this record better than MySQL.

Where does each record live? All three tables live in MySQL. The video and thumbnail files live in the separate file store, shown as the cylinder. Step 6 chooses object storage for the file store, with HDFS as the alternative, and then gives thumbnails their own store.

The Video and Comment tables grow with traffic. Step 2 estimated 230 video uploads per second, so Video gains about 230 new rows per second. Comment grows with every comment users write. A metadata row is tiny compared with the video file it describes. The files take 25 GB of new storage every second, according to step 2. Even so, the metadata soon becomes too large for one database server. Step 6 shards it, meaning it splits the rows across many machines, by UserID or by VideoID.

Why a SQL database? These rows have fixed fields and clear relationships, like a comment belonging to a video. Relational databases are built for exactly this kind of data. A wide-column store, a NoSQL database whose rows can hold many flexible columns, becomes worth considering only at extreme scale, and step 6 handles scale by sharding instead.

Step 5: Draw the High-Level Design

At a high level, we need the following parts:

  1. Processing queue: The raw upload is written to object storage first. A task that points to that stored file is then added to a processing queue. The video itself never enters the queue. Tasks wait there to be de-queued for encoding, thumbnail generation, and storage of the finished files. The queue separates the upload itself from that heavy background work.
  2. Encoder: Encodes each uploaded video into multiple formats.
  3. Thumbnails generator: Creates a few thumbnails for each video.
  4. Video and thumbnail storage: Stores the video and thumbnail files in distributed storage.
  5. User database: Stores user information, like name, email, and address.
  6. Video metadata storage: Stores everything about a video: title, file path in the system, uploading user, total views, likes, and dislikes. It also stores all the video comments.

The diagram below shows how these parts connect.

High-level design of YouTube
High-level design of YouTube

Step 6: Go Deep

The service is read heavy. The read:write ratio is 200:1, meaning for every video upload there are 200 video views. So we focus on making the system retrieve videos quickly.

Where are the videos stored?

A video file is written once and read many times. After encoding, the file is never changed. Two kinds of storage fit that pattern.

Object storage, like Amazon S3, is the standard answer today. An object store keeps files as named blobs (binary large objects) and serves them over HTTP. It replicates every object automatically, which means it keeps copies on several machines. Our reliability requirement needs exactly that replication. Object storage is also easy to connect to a CDN, which we add later in this step.

A distributed file system, like HDFS or GlusterFS, also works. HDFS is built for batch jobs that scan very large files. It favors total throughput, meaning the amount of data processed per second, over the latency (delay) of one request. With HDFS, you must also operate the replication and the name servers yourself. Choose it when heavy analytics jobs must also read the same files. For serving videos to viewers, object storage is the simpler and cheaper choice.

How should we manage read traffic?

Separate the read traffic from the write traffic. We keep multiple copies of each video, so video reads can spread across many servers.

For metadata, use a primary-secondary configuration. Writes go to the primary first and are then applied to all the secondaries. The secondaries serve reads. This setup adds read capacity, but some reads now return stale data. A new video's metadata reaches the primary first. A secondary that has not applied that write yet returns stale results. Here the staleness is usually milliseconds, so the user sees the new video after a very short delay. Do not promise that the delay is always that short. Replication lag, the delay before a secondary applies a write, grows with write load and with distance, and a secondary in another region can be seconds behind. We already accepted this trade-off in the non-functional requirements.

Where are thumbnails stored?

There will be far more thumbnails than videos. Assume every video has five thumbnails. Two facts decide the storage choice:

  1. Thumbnails are small files, say a maximum of 5 KB each.
  2. Their read traffic is huge compared to videos. A user watches one video at a time but sees a page with 20 thumbnails of other videos. We can estimate that traffic. Step 2 estimated 46K video views per second. If each view also loads a page of 20 thumbnails, that is about 900K thumbnail reads per second, which is twenty times the video read rate. Each read returns few bytes, but the request rate is the highest in the system.

First, consider storing every thumbnail as an ordinary file on disk. With billions of small files, reading them means many seeks to different disk locations. A seek is the physical movement of a disk head to a new position. Many scattered seeks are inefficient and produce higher latencies.

Bigtable is a reasonable choice instead. It combines multiple files into one block on disk, and it is also very efficient at reading small amounts of data. Those are exactly our two requirements. Keep hot thumbnails in an in-memory cache as well. Thumbnail files are small, so the cache can hold a large number of them.

Video uploads

Videos can be huge. If the connection drops during an upload, the service should let the upload resume from the same point. The user should never have to restart a large upload from the beginning.

Resuming needs a mechanism, so describe it. The client splits the file into fixed-size chunks and uploads them one at a time, each labeled with its offset in the file. When the upload starts, the server returns an upload ID, and it records under that ID which chunks have arrived. When the connection is restored, the client asks the server for the offset the upload reached and continues from there. No task is added to the processing queue until every chunk has arrived.

Video encoding

A newly uploaded video is stored first, and a task is added to the processing queue. The encoder de-queues the task and encodes the video into multiple formats. Once all the encoding completes, the uploader is notified. The video then becomes available for viewing and sharing.

The diagram below shows the detailed component design, with all of these parts in place.

Detailed component design of YouTube
Detailed component design of YouTube

Metadata sharding

Millions of new videos arrive every day, and the read load is extremely high. One database server cannot handle both, so we distribute the metadata across many machines. There is more than one way to split it.

Sharding based on UserID. Pass the UserID through a hash function. The result identifies the server that stores all metadata for that user's videos. To read one user's videos, hash the UserID again and query that one server. Searching by title is harder, because videos with a matching title can belong to any user. We must query every server, and each server returns a set of videos. A centralized server then aggregates and ranks these results before returning them to the user.

This approach has two problems:

  1. What if a user becomes popular? The server holding that user receives a large share of the queries. That one server becomes a performance bottleneck, and it slows the whole service.
  2. Over time, some users store far more videos than others, so keeping the data evenly distributed becomes difficult.

To solve these problems, we either repartition the data, which means dividing it among the servers again, or use consistent hashing to balance the load between servers.

Sharding based on VideoID. The hash function maps each VideoID to a random server, which stores that video's metadata. To find one user's videos, we query all servers, and a centralized server aggregates and ranks the results. This approach solves the popular-user problem, but it shifts the bottleneck to popular videos. A cache in front of the database servers holds hot videos and serves most of that load.

Video deduplication

With this many uploaders, the service receives many duplicate videos. Duplicates often differ in aspect ratio or encoding. They may have overlays or extra borders, or be parts cut from a longer original. Duplication is costly in several ways:

  1. Storage: we waste space keeping multiple copies of the same video.
  2. Caching: duplicates take cache slots that unique content could use.
  3. Network: duplicates increase the data sent to in-network caching systems.
  4. Energy: extra storage, less effective caches, and extra traffic all waste energy.

Users see the cost too: duplicate search results, longer video startup times, and interrupted streaming.

Deduplication is most useful early, while the user is still uploading. This is called inline deduplication, in contrast to finding duplicates later in post-processing. Deduplicating inline saves the resources a duplicate would consume in encoding, transfer, and storage. As soon as an upload starts, the service runs video matching algorithms, like Block Matching or Phase Correlation. If we already have a copy, we can stop the upload and use the existing copy. Or we can finish the upload and keep the new video if its quality is higher. If the new video is a subpart of an existing video, or an existing video is a subpart of the new one, we divide the video into smaller chunks. Then we upload only the parts that are missing.

Load balancing

Use consistent hashing among the cache servers. It balances the load between them, and it handles the failure of a cache server. One problem remains. A static hash maps each video to one hostname, but video popularity is very uneven. A popular video sends heavy traffic to its one logical replica, the hostname that the hash assigned to it. The physical server behind that hostname then receives the same uneven load.

To resolve this, a busy server can redirect a client to a less busy server in the same cache location. We can use dynamic HTTP redirections for this. A redirection is the server telling the client to request the video from a different address.

Redirections have drawbacks. If the server receiving the redirection cannot serve the video either, the client is redirected again. Each redirection is one extra HTTP request, so the video starts playing later. Redirections across cache tiers, or across data centers, can also send a client to a distant cache location, because higher-tier caches exist in only a small number of locations.

Cache

Introduce a cache for the metadata servers to hold hot database rows. Application servers check a cache like Memcache before querying the database. Least Recently Used (LRU) is a reasonable eviction policy here, where an eviction policy is the rule for choosing which row to remove when the cache is full. Under LRU, we discard the least recently viewed row first. LRU fits because a video's popularity falls as the video gets older, and the rows being read right now stay in memory.

How can we build a more intelligent cache? Apply the 80-20 rule: 20 percent of the videos generate 80 percent of the traffic. Be careful about which quantity you use to size the cache. A cache holds videos and rows, not requests, so size it by the number of distinct objects, not by the read volume. The read volume is 1 TB per second, and no cache can hold one day of that traffic. The hot set, meaning the objects read most often, is small. The number of videos watched today is in the millions, and a metadata row is a few hundred bytes. Hot rows go in Memcache, and the hot video files go in the CDN below, which is where the video data is actually stored.

Content Delivery Network (CDN)

A CDN is a system of distributed servers that delivers content based on the user's location and the content's origin. The Caching lesson covers CDNs in more detail.

Our service moves popular videos to CDNs:

  • CDNs replicate content in many places, so a video is more likely to be stored near its viewer, and it then crosses fewer networks on the way.
  • CDN machines use heavy caching and can mostly serve videos from memory.

Less popular videos, say 1 to 20 views per day, are not cached by CDNs. Our own servers in various data centers serve them.

One property makes all this caching safe. An encoded video file never changes, so a cached copy of it can never become stale. Only the metadata, like view counts, keeps changing. We already accepted that the metadata can be slightly stale.

How playback works

The encoder does more than produce several formats. One encoded copy of a video at one resolution and bitrate, such as 1080p at 5 Mbps, is called a rendition. The encoder cuts each rendition into short numbered segments of a few seconds each. For each video, it also writes a manifest. A manifest is a small text file that lists every rendition and the address of each of its segments, in playing order.

To play a video, the player first downloads the manifest. It then requests the segments in order, over plain HTTP, and keeps a buffer of the next 10 to 30 seconds. Before each request, it compares its measured download speed with the bitrates listed in the manifest. If the network slows down, the next segment comes from a lower rendition. If the network speeds up, the player switches back to a higher rendition. This method is called adaptive bitrate streaming. The two common protocols for it are HLS (HTTP Live Streaming) and DASH (Dynamic Adaptive Streaming over HTTP).

Segments also explain the offset in streamVideo. To resume at 600 seconds, the player calculates which segment holds that time and starts there. Every segment is an ordinary file fetched over HTTP, so a CDN caches it like any other static file. This is what lets the CDN serve most of the 1 TB per second of outgoing traffic.

Step 7: Bottlenecks and Failure Points

The interviewer does not expect this design to be limitless. They expect you to know where its limits are.

  • A database server dies. Consistent hashing decides where the data moves, but it does not keep the data safe. It replaces a dead server with minimal data movement, and it spreads the load while doing so. But the data survives the failure only if replicas exist. Requirement 1 says an uploaded video must never be lost, so every metadata shard keeps secondaries, and the object store keeps several copies of every file. Name both when the interviewer asks about a dead server.
  • A video goes viral. The cache, the CDN, and dynamic HTTP redirections handle most of the extra traffic. But the metadata shard that holds that VideoID remains the busiest single point.
  • The processing pipeline is delayed. The queue, the encoder, and the thumbnail generator can all be slow or down. New uploads then take longer to appear, but playback keeps working, because watching a video depends only on the stores, the caches, and the CDN. State this isolation out loud, because it is a strength of the design.
  • Stale metadata reads. A secondary can serve rows a few milliseconds old, so a viewer may not see a new video for a short time. We chose this in step 1, so present it as a choice, not a defect.

Where AI Fits in This Design

After the main design, interviewers often ask one more question: where would AI fit in this system?

For a video platform, the answer is in the processing pipeline. That pipeline is already asynchronous, which means its work runs in the background after the upload request has returned. An upload enters the queue, the encoder and the thumbnail generator do their work, and the user waits for none of it. An AI step is simply one more consumer of the same queue, that is, one more program that takes tasks from it.

Two uses matter here. The first is automatic captions. A speech-to-text model (one that turns spoken audio into written text) transcribes each new video, and the result is stored with the metadata. The second is moderation. A classifier (a small model that assigns labels) scores frames and audio for content that breaks the rules. It sends what it finds to human review.

Now apply the same reasoning as the rest of the design. Captions must never block publishing. If the caption job fails, the video is published anyway, and the captions can be added later. Moderation is the opposite choice: publishing may wait for it, and that is a product decision, not a technical one. Name the cost too. These models are priced by the minute of video processed, so the cost grows with every upload, whether anyone watches the video or not.

Playback needs no AI. The storage split, the caches, and the CDN stay exactly as designed.

💡 In the interview: spend your time on storage and the read path. Say early that the system is read heavy, with 200 views for every upload. The part the interviewer most wants to hear is the storage split: video files in object storage, metadata in sharded MySQL, thumbnails in Bigtable. Be ready to explain the trade-off between object storage and HDFS, and the reason an upload returns HTTP 202 instead of waiting for encoding to finish. The most likely follow-up is a viral video: answer with the cache, the CDN, and dynamic redirections.

Key takeaway: YouTube is a storage and delivery problem under a very uneven load, with 200 views for every upload. Split the data by its size and structure. Large video files, which are immutable (they never change), go to object storage, or to a distributed file system like HDFS. Small structured metadata goes to sharded MySQL, and tiny hot thumbnails go to Bigtable. Send every upload through a processing queue, so encoding never blocks the user, and return HTTP 202. Serve popular videos from a CDN and hot metadata from an LRU cache, following the 80-20 rule. Deduplicate inline during upload, and use consistent hashing to spread both database and cache load.

Sky Destinies

Sky Destinies

· 2 months ago

I feel like Functional Requirement #4 "The service records stats for each video, like likes, dislikes, and total views" should be moved to Out of Scope.

The designing youtube likes system is an entire lesson in the System Design Interview, Vol II

Having it here just makes this lesson confusing because it's having the total view and likes as part of the Video row. But that is a simplistic approach that will not scale with the 46k views/s (especially with a SQL database and popular videos).

H

hpyangjiayue

· 5 months ago

Storing the videos in HDFS is basically not a good practice. And there is no trade off discussing why would we choose HDFS. This system design material is too basic and not helpful!

Show 1 reply
Mohit Jayee

Mohit Jayee

· 2 years ago

The design diagram shown in video is missing in the writeup. I think it should be included in the write-up as well, as it makes it easier to keep it open while watching video.

Show 1 reply
Jonathan Morales

Jonathan Morales

· 2 years ago

I'm so confused why does it say to use a file storage system when an object store is so much faster and better for videos specifically in this cases where you show and store videos publicly like youtube.

Show 1 reply
Akib Ali

Akib Ali

· 2 years ago

there is nothing mentioned how view video will work, protocol, stream chunks and their orders.

Show 1 reply
C

Chris

· 4 years ago

In the "Cache" section, you say "Our service should push its content closer to the user using a large number of geographically distributed video cache servers".

Isn't this essentially what the next section, "Content Delivery Network" describes? Is there some difference between the two?

Show 1 reply
M

Mohammed Shoaib

· 4 years ago

Looking at the data size, Doesn't it make sense to store metadata as well in NoSQL. Math as follows: 230 videos per second, assume it takes 5MB to store metadata of a video. Total metadata per day = 230 * 10^5 * 5MB = 115 * 10 ^ 6 MB = 115TB. (10^5 seconds a day) At this rate, SQL DB becomes a bottleneck.

Show 1 reply
C

calvio

· 4 years ago

The system design interview is all about discussing trade-offs. How can you have a "Database Schema" section without discussing pros/cons, let alone any other alternatives?

J

Junaid Effendi

· 4 years ago

Similar Q as previous chapters. VideoID sharding would still need Consistent Hashing to avoid future redistribution.

If we go with static modulus, 100 db servers meaning, videoid % 100, means when we need more we need to reshuffle the data.

Also, why not use nosql in this case? Since they can easily scale horizontally unlike mysql which are good with vertical scaling.

Show 1 reply
J

Junaid Effendi

· 4 years ago

Load Balancing... If consistent hashing with http dynamic redirection would not work, then whats the solution?

Show 1 reply

Reading Progress

0%


Vote for new content

On This Page

Why YouTube?

Try it yourself

Sketch it here

Designing YouTube (video)

Step 1: Clarify the Requirements

Step 2: Estimate the Scale

Step 3: Define the API

Step 4: Define the Data Model

Step 5: Draw the High-Level Design

Step 6: Go Deep

Where are the videos stored?

How should we manage read traffic?

Where are thumbnails stored?

Video uploads

Video encoding

Metadata sharding

Video deduplication

Load balancing

Cache

Content Delivery Network (CDN)

How playback works

Step 7: Bottlenecks and Failure Points

Where AI Fits in This Design