Backend Development 7 min read

Why Facebook and Google Turned Away from Git: The Rise of Mercurial and Piper for Massive Monorepos

The article explains how Facebook abandoned Git for a heavily customized Mercurial and how Google, facing similar monorepo scaling problems, built its own version‑control system called Piper, illustrating the challenges of managing ultra‑large codebases at internet giants.

IT Services Circle
IT Services Circle
IT Services Circle
Why Facebook and Google Turned Away from Git: The Rise of Mercurial and Piper for Massive Monorepos

1. Two version‑control systems emerge In 2005, after a licensing dispute over BitKeeper, Linus Torvalds created Git, while Olivia Mackall released Mercurial v0.1, both distributed VCSs designed for extensibility.

2. Facebook’s monorepo dilemma Facebook’s rapid growth produced a single repository with millions of files and billions of lines of code, making Git operations painfully slow (basic commands taking up to 45 minutes). To solve this, Facebook formed a team, consulted Git maintainers, and ultimately adopted Mercurial, contributing over 500 patches and integrating the Watchman file‑watcher, achieving more than a 5× speedup for status checks.

Mercurial’s Python‑based, object‑oriented architecture allowed Facebook to extend core data structures such as filelog and remotefilelog , boosting pull/clone speeds by over tenfold and enabling efficient handling of their massive codebase.

3. Google invents a new wheel Google’s codebase grew to 2 billion lines occupying 86 TB, far exceeding the limits of Perforce, which they initially used. Scaling issues (CPU overload, TCP failures) forced Google to develop Piper, a custom VCS built on top of Perforce’s ecosystem. Migrating from Perforce to Piper took four years and required a “clean‑room” implementation to avoid legal entanglements.

Despite the effort, Piper now powers most of Google’s products (except Chrome and Android) and supports over 300 internal tools.

4. Summary Both Facebook and Google, as large‑scale internet companies, chose to abandon standard Git in favor of solutions tailored to their monorepo strategies—Facebook by heavily customizing the open‑source Mercurial, and Google by creating the proprietary Piper—demonstrating that for most organizations, Git remains sufficient, but extreme scale can demand bespoke version‑control systems.

MonorepogitGoogleVersion ControlFacebookPiperMercurial
IT Services Circle
Written by

IT Services Circle

Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.