Ever Wondered How Many Lines of Code Google is? Here’s the Startling Answer

It’s something that maybe you have never thought about as you type words for the thing you’re looking for into Google’s search box, but what an interesting question: how many lines of code is “Google?”

Remarkably, the company has disclosed that the vast majority of its code is stored in a single repository called “Piper” where all the coders at the company have access to it.

An amazing article from WIRED dives in to the details:

Google’s Rachel Potvin came pretty close to an answer Monday at an engineering conference in Silicon Valley. She estimates that the software needed to run all of Google’s Internet services—from Google Search to Gmail to Google Maps—spans some 2 billion lines of code. By comparison, Microsoft’s Windows operating system—one of the most complex software tools ever built for a single computer, a project under development since the 1980s—is likely in the realm of 50 million lines.

So, building Google is roughly the equivalent of building the Windows operating system 40 times over.

The comparison is more apt than you might think. Much like the code that underpins Windows, the 2 billion lines that drive Google are one thing. They drive Google Search, Google Maps, Google Docs, Google+, Google Calendar, Gmail, YouTube, and every other Google Internet service, and yet, all 2 billion lines sit in a single code repository available to all 25,000 Google engineers.

All in all, it may be the single largest code repository in the world, according to Ms. Potvin.

In order to manage this behemoth, Google has invented its own version control system to manage this staggering mass of code. The article continues:

Basically, Google has built its own “version control system” for juggling all this code. The system is called Piper, and it runs across the vast online infrastructure Google has built to run all its online services. According to Potvin, the system spans 10 different Google data centers.

It’s not just that all 2 billion lines of code sit inside a single system available to just about every engineer inside the company. It’s that this system gives Google engineers an unusual freedom to use and combine code from across myriad projects. “When you start a new project,” Potvin tells WIRED, “you have a wealth of libraries already available to you. Almost everything has already been done.” What’s more, engineers can make a single code change and instantly deploy it across all Google services. In updating one thing, they can update everything.

Although Piper contains virtually all of Google’s code, there are still some projects that are only accessible to select programmers, Potvin says. These include the PageRank search algorithm, as well as the Android and Chrome projects.

Even without those projects, Piper contains a stunning 85 terabytes of data and manages over 45,000 code changes made by Google’s 25,000 programmers every single day.  If your not impressed by now, then we recommend that you head over to YouTube (yep, it’s a Google product) and type “cat videos” in the search box. You will be entertained, we promise, without having to think about the insane technology that you just used.

For more amazing details about Google’s Piper and efforts to make a similar code repository available to all via an open source project in progress now, head on over to WIRED to read the rest of the story.


Source: WIRED.com – “Google Is 2 Billion Lines of Code—And It’s All in One Place”

Featured Image Credit: Getty Images (from the original article)