Search⌘ K
AI Features

YouTube API Design Decisions

Understand key design decisions for YouTube's streaming API including REST architecture for client interactions, HTTP/2 protocol advantages, and use of binary and JSON data formats. Learn the workflow from video publishing to streaming with a focus on efficiency, scalability, and low latency.

The API design for a streaming service is an intricate operation due to the complex nature of the system. It involves significant technical aspects—for example, the API architecture style to use between different interacting entities and the protocols adopted for transferring streaming data. In the following section, we’ll decide on the primary design considerations that we’ll stick to in designing an API for the YouTube streaming service.

Design overview

The following illustrations show a bird's eye view of YouTube's primary services, which consist of streaming, uploading, searching, commenting, and rating (liking or disliking) services. The upload service is used to upload the video contents to the blob storage and relevant metadata to the metadata database. The search service efficiently finds relevant videos from the vast database of videos. Similarly, the comment service enables users to post comments on a video, and these can be rated via the rating service.

The various functionalities of the YouTube system
The various functionalities of the YouTube system

Since we have covered the other services in our foundational design problems, we’ll focus on streaming services, and other services relevant to streaming, in the figure below. All streaming requests coming from the clients are passed via the API gateway and directed to the relevant service, which, in turn, retrieves the relevant data from the persistent layer. For example, the ad service is responsible for handling any requests related to embedding ads in videos. Typical responsibilities of this service include communicating with other services to find optimal ads to serve specific users, choosing the number of ads to be served, and serving ads during playback. ... ...