Member-only story
A Jr Programmer Asked Me Why Google and YouTube Use Python
Despite being slow.
One of the most important lessons in developing systems at scale is that almost any programming language has potential use in an extensive, distributed system.
The web architecture of YouTube and much of the rest of Google is based on many services. In other words, YouTube and Google are not served by a single piece of software but by thousands of programs running on Google’s millions of servers in a distributed fashion. Each service talks to many other services to get results.
Now, why would an architecture of this style be useful? Plain and simple. It allows you to completely different functionalities, distribute and scale them independently, and give each one a different requirement.
A team can take care of each service (or several) and thus achieve much better productivity. This means that if a service doesn’t need to be extremely fast or efficient, you can write it in a potentially easier to write and/or maintain language, such as Python (although some disagree with me on the point of maintainability).
Likewise, services that need to be fast can be written in a language that allows you to use your resources more efficiently, respond more quickly, or have more control, like C++ or Rust.
So what does this have to do with YouTube or Google? Well, it’s just not the case that they’re both written in Python. Instead, a substantial portion of Google’s services is written in C++ or, in recent years, Go.
The rest are a mix of languages, with Python being one of the biggest, depending on the work area. As far as I understand, many of the web servers are written in C++.
Simply, this is because Google, from the beginning, saw it as a suitable language for services that planned to scale quickly. As a result, the current implementation of “Page Rank” is still written in C++.
Now, let’s move on to YouTube. For the “web” servers (the server serving the front-end and the API), they chose Python. Why? Here we enter the other reality of systems at scale. If you have as much money as Google and a language like Python is good enough to display your site, you can fix inefficiencies in the language by…

