How Google manages 2 billion lines of code
"Wired" Today, an article about Google's code has reached 2 billion lines, and a brief introduction of how Google manages the code.
These 2 billion lines of code, including search, Gmail, docs, maps, YouTube, Google + and most of the services offered by Google, are stored in the "one" code warehouse, 25,000 Google engineers can access-this is probably the world's largest single code base. There are only a few exceptions: code that involves confidential information, such as the PageRank algorithm, or relatively standalone items, such as Android and Chrome systems, are stored in separate code repositories. It's easy to share code between engineers-meaning that all new projects and features can take advantage of previously written code-2 billion lines are almost all-encompassing, and one improvement, all related projects can benefit.
What is the concept of line 2 billion? 14 years ago, when Windows XP was released, it contained 45 million lines of code--google, approximately 40 XP.
Google uses a system called Piper to manage this huge code warehouse--a system that runs on 10 different data centers and manages about 45,000 commits per day for 85tb,google engineers. What is this concept? It's equivalent to Google engineers rewriting Linux once a week.
Not only that, the system evolved from the predecessor Perforce, but also to help human engineers to take care of trivial code modifications and submissions, such as checking bugs and cleaning up unused code, generating the necessary configuration files, and so on--maintaining the code base health is not only the work of engineers.
In addition, Google is working with Facebook to deliver similar powerful code management tools to the outside world, benefiting all engineers outside of the company. But this system is not based on git, but mercurial. What happens to GitHub when the system is made public?
In fact, not only Google's code is so large and complex, Microsoft is no inferior. Microsoft engineers at Hacker News said they knew the data: only the amount of exchange data generated by the Windows build system on Microsoft's internal network per day is the equivalent of the sum of all Netflix movies!
How Google manages 2 billion lines of code