YouTube: Delivery Deep Dives
How much of the traffic can caches take?
Views Are Concentrated
Two measurements, fifteen years apart, describe how YouTube's views spread over its videos:
- 2007, from a crawl of YouTube's categories: "10% of the top popular videos account for nearly 80% of views, while the rest 90% of videos account for less than 20% of views."
- 2022, from a random sample of all public videos: "The mean number of views of videos in our sample was 5,868.02, with a median of 35"; videos with 10,000 views or more were "only 3.67% of our sample … but they account for 93.61% of total views across the sample"; and "just the 16 most viewed videos in the sample (0.16%) together account for more views (50.52%) than the rest of the sample combined." Videos "with no views whatsoever accounted for 4.88%".
The 2022 numbers fit a lognormal distribution with the median and mean measured (σ = 3.2). That fit predicts 3.86% of videos at 10,000 views or more drawing 92.4% of views — close to the 3.67% and 93.61% measured — and overstates the very top (60% for the top 0.16% against 50.5%).

What a Cache of Each Size Serves
From that distribution we computed what a cache holding a given share of all videos serves — with least-recently-used eviction (Che's approximation over 2 million videos, requests in proportion to views, sizes in proportion to the sample's durations), and for a cache that knew the future and kept exactly the most-viewed videos:
| Cache holds | Requests served (LRU) | Bytes served (LRU) | Perfect knowledge |
|---|---|---|---|
| 0.01% of videos | 15.3% | 12.6% | 29.9% |
| 0.1% | 39.6% | 34.3% | 54.0% |
| 1% | 71.7% | 69.9% | 80.5% |
| 5% | 90.5% | 89.8% | 93.9% |
| 10% | 95.5% | 95.1% | 97.2% |

Google says of the caches it places inside ISPs: "Typically between 70-90% of cacheable traffic can be served from GGC. Cache hit rates will vary, based on the unique consumption patterns of end users on each operator's network." On the model, that is a cache holding roughly 1–5% of the catalogue. The model is static: real demand also moves in time — the 2007 study found that a video that did "not get enough requests during its first days" rarely got many later — which helps a least-recently-used cache, and tastes differ by country, which is why each ISP's cache fills from its own users' requests.
Tiers
A miss at one cache need not go back to the origin. In 2011 researchers measured YouTube's delivery from 471 machines around the world, plus 843 open DNS servers, and found "a 3-tier physical cache hierarchy": primary caches in 38 locations, some inside ISP networks, and "8 secondary and 5 tertiary cache locations in US and Europe and owned by Google only." Google describes its network today as "three distinct elements": data centers, edge points of presence "at over 100 interconnection facilities around the world", and edge nodes inside ISPs, where "Static content that's very popular with the local host's user base, including YouTube and Google Play, is temporarily cached".
In the model, eight edge caches of 0.1% of the catalogue in front of one regional cache of 1%:
| Tier | Share of requests |
|---|---|
| Served by an edge cache | 39.6% |
| Served by the regional cache | 32.2% |
| Reaching the origin | 28.2% |
The regional tier turns a 40% hit ratio into 72% without adding a byte to the edges, which stay small enough to fit inside ISPs.

Pull, Not Push
The caches fill on demand: a miss is fetched from the next tier and kept. Copying "popular" videos to every edge in advance sounds faster but wastes the edges' space on videos popular somewhere else, and the head of the distribution fills a pull cache by itself. Filling ahead pays only for a known spike, such as a scheduled premiere.
Three details make pull caching work at this scale:
- Cache segments, not files. Many views end part-way — "after watching some portion of it", in the words of the 23-million-view study — so a video's first segments are requested more than its last; a segment-level cache keeps only the parts people watch.
- One copy per site. Inside a cache site, each video's segments map to one server by consistent hashing, so the site's servers act as one large cache, and adding a server moves only a slice of the keys.
- Collapse misses. When a new video goes viral, many viewers miss on the same segment at once; the cache sends one request upstream and holds the rest until it returns.
How does the player choose each segment's quality?
The Player Picks Every Segment
Adaptive bitrate is a decision the player makes before each segment: which rung to ask for. It has two signals — the throughput its recent downloads achieved, and how many seconds of video its buffer holds — and the rules differ in which they trust:
| Rule | Decides by | Used in |
|---|---|---|
| Throughput | the highest rung under a safety share of the estimated throughput | dash.js's ThroughputRule: a fast and a slow moving average of past downloads, the lower one, times 0.9 |
| Buffer | the buffer level alone: lowest rung while the buffer is short, highest when it is long, a ramp between | BBA, tested at Netflix (Huang et al., 2014); BOLA (Spiteri et al., 2016), dash.js's BolaRule |
| Hybrid | throughput while the buffer fills, buffer once it is full | dash.js's default: "If both throughputRule and bolaRule are enabled dash.js dynamically switches between those two rules based on the current buffer level" — in its code, to BOLA at 12 s of buffer and back below 6 s |
| Predictive and learned | a model of the next few segments (MPC, Yin et al., 2015), or a neural network trained by reinforcement learning (Pensieve, Mao et al., 2017) | research |
Netflix's test of the buffer approach found that it "allows us to reduce the rebuffer rate by 10–20% compared to Netflix's then-default ABR algorithm, while delivering a similar average video rate". YouTube has not published its own algorithm.
One more rule runs beside all of them in dash.js: a download that is on course to take more than 1.8 segment durations, while the buffer is short, is abandoned and fetched again at the rung the measured throughput affords.
Three Rules on Real 4G
We replayed the three rules on real throughput: the 40 logs of a 4G dataset recorded on foot, by bicycle, bus, tram, train and car around Ghent, Belgium (van der Hooft et al., 2016) — 5 hours in all — over the VP9 ladder we measured (0.15 to 11.06 Mb/s), with 4-second segments, a 30-second buffer, and dash.js's settings and abandon rule:
| Over 40 sessions | Throughput | Buffer (BBA-0) | Hybrid (dash.js) |
|---|---|---|---|
| Stalls | 3 (14.8 s) | 0 | 3 (14.8 s) |
| Sessions with a stall | 1 | 0 | 1 |
| Average bit rate | 10.18 Mb/s | 10.38 Mb/s | 10.58 Mb/s |
| Quality switches | 342 | 225 | 354 |

On these 4G sessions the rules mostly agree, and the 30-second buffer absorbs most dips: in 5 hours only one session stalled at all. The difference is one moment — on a train, the network nearly vanished from second 164 to 214. The throughput rule and the hybrid had just asked for 2160p segments at full throughput and were left downloading 44 megabits over almost nothing; the buffer rule had been lowering its rate as its buffer fell. With the abandon rule switched off, the buffer rule stalled too, once, for 21.2 seconds: dropping a hopeless download is part of what kept it smooth.
Three lessons carry over: keep a buffer of tens of seconds; never let one estimate of throughput commit the player to a segment it cannot finish; prefer staying on a rung to switching on every fluctuation. Which rule is best depends on the network and the ladder — which is why Netflix tested BBA on groups of real users before relying on it.
What happens before the first frame?
What Happens Before the First Frame
Startup is a chain of round trips: find a server (DNS), open a connection, fetch the manifest, fetch the first segment of video and of audio, decode. Each round trip takes as long as the network path to the server and back, so a cache near the viewer shortens every step. That is why the caches matter for startup as much as for bandwidth, and why the player starts with a modest quality: a small first segment arrives sooner.
How much startup matters is measured. Across 23 million views, viewers "start to abandon a video if it takes more than 2 s to start up, with each incremental delay of 1 s resulting in a 5.8% increase in the abandonment rate", and they are "less tolerant to startup delay for a short video such as a news clip than a long video such as an hour-long TV episode".
QUIC
YouTube's video travels over QUIC, the UDP-based transport Google built, on which HTTP/3 runs. It replaces the separate TCP and TLS handshakes with one and lets a returning client send its request in the first packet. Google reported in 2017 that QUIC "reduces rebuffer rates of YouTube playbacks by 18.0% for desktop users and 15.3% for mobile users". Part of the gain is that a lost packet delays only the stream it belongs to, not every request on the connection.
How does the metadata scale?
YouTube's Own Path
Vitess, the MySQL sharding system, began at YouTube: "Vitess was created in 2010 to solve the MySQL scalability challenges that the team at YouTube faced." The steps it records are the usual ones. YouTube first added a replica for reads, then more replicas; "Eventually, write traffic became too high for the primary database to handle, requiring YouTube to shard data". At first the application itself picked the shard for every query; Vitess moved that routing into a proxy, so the application talks to one logical database.
Sharding the Metadata
The watch page reads a video by its id, so video_id is the shard key: ids are random, so videos spread evenly, and a popular video is one row read many times — work for a cache, not for the database.
A channel's list of videos is a different query, by channel. Sharded by video, it would have to ask every shard. So the list lives in its own table, channel_videos, sharded by channel_id: one shard answers "the latest videos of this channel". Across shards the database no longer enforces the references between the two tables; the upload service writes the video row first and the channel row second, and a periodic check removes the rare orphan left by a crash in between.
The read load is caching work. A watch page needs a few rows, and popular videos are read millions of times a day, so the metadata servers keep watch-page data in a cache with a short lifetime and invalidate it when the creator edits the video. Counts are not in that path at all: they come from video_counts, which the counting job rewrites (next section).
How are views counted?
What Counts as a View
YouTube does not show every play as a view at once: "We want to make sure that your metrics are high quality and come from actual humans and not computer programs. It takes our systems some time to figure out which views, likes, dislikes, and subscriptions are legitimate." What a view is changes too: "Beginning August 24, 2026, views are counted the moment a video starts to play across all formats, including Shorts, long-form videos (VOD), and live streams." The count is therefore an output of a validating pipeline, never a field that each play increments.
One Counter, Three Ways
The load is large: Shorts alone average over 200 billion views a day, 2.3 million a second, and a video watched 100 million times in its first day takes 1,157 views a second on average. We measured one video's counter three ways, on PostgreSQL 17 with every commit flushed to disk and on Redis 8:
| Approach | Measured | What goes wrong |
|---|---|---|
UPDATE video_stats SET views = views + 1, 16 connections | 250 a second; 58,193 with commits not flushed | every increment waits for the row's lock and a flush; unflushed, a crash loses acknowledged views |
Redis INCR, flushed to PostgreSQL every second | 217,628 a second (2.6 million pipelined) | killing Redis 2.5 s into a run lost 150,600 of 784,800 acknowledged views, 19% |
Each view a row with its own view_id, 1,000 per transaction | 33,972 a second from one writer, every commit flushed | nothing: a batch sent twice was counted once |

The Counting Pipeline
- The player sends events. Each play is a
POST /v1/viewswith aview_idthe player chose, so a retry repeats the id instead of adding a view. - A log takes them. The events go to a partitioned log, partitioned by video so one video's events are counted in one place; more writers mean more partitions, never contention on one row.
- A job counts them. The counting job reads the log, drops events that fail validation or repeat a
view_id, adds up each video's views for the interval, and writesvideo_countswithcounted_to— the point in the log up to which the count is complete. The watch page reads that row, through the cache. - Counts are recomputable. Because the log keeps the events, a bug or a change in what counts as a view is fixed by counting again, which is what "constantly confirming and adjusting engagement events" requires.
If a single video ever outgrew one partition, its events could be spread by view_id and summed in a second step; repeats would still be caught, since a repeated event carries the same view_id.