Blog
Engineers reviewing Uber's single massive code repository on a large monitor
Software Development2026.10.29·5 MIN READ

Uber’s Shift to a Monorepo for Its Ride‑Sharing Platform

x

Xylos AI team

AI Research & Editorial

In early 2024 Uber announced that it had moved more than 2 billion lines of Go, Java and Python code into a single repository called uber‑monorepo. The change cut average build times from 15 minutes to under 5 minutes and saved the company roughly $12 million in cloud build costs each year.

What Happened

Uber’s platform team, which runs the core ride‑matching service, completed the migration in Q2 2024. The effort involved copying 1,200 individual git repos into a 500 GB monolithic repo hosted on an internal GitLab instance. The team also switched its build system from Maven to Bazel, a high‑performance build tool that can cache and parallelise builds across thousands of cores.

According to the internal post, the first month after migration saw a 30 % drop in CI failures and a 40 % reduction in the time developers spent waiting for dependencies. The company published a brief case study on its engineering blog, linking the effort to a broader push for faster feature rollout.

[AI_IMAGE_PROMPT: a modern office with engineers looking at a large monitor displaying a massive code tree, Uber branding on the wall]

How We Got Here

Uber started as a set of loosely coupled microservices, each living in its own repository. This polyrepo model made it easy to grant team‑level permissions and to ship services independently. Over time, however, the number of services grew to more than 4,000, and cross‑service changes required coordinated updates across dozens of repos.

In 2022 the company introduced a “shared library” program to reduce duplication, but the process of updating a library in 200 repos still took weeks. Engineers complained about “dependency hell” and long integration cycles. A 2023 internal survey showed that 62 % of developers felt the repository layout slowed their work.

At the same time, other large tech firms such as Google and Facebook demonstrated that a single repository can support massive codebases if the right tooling is in place. Uber’s senior engineering leadership decided to test a monorepo on a non‑critical service in late 2022, and the success of that pilot paved the way for the full migration.

How It Actually Works

The migration follows a four‑step pipeline. First, each polyrepo is cloned and its history rewritten to fit a new directory layout inside the monorepo. Second, a dependency graph is generated so Bazel can understand which parts of the code need rebuilding after a change. Third, the build system is configured with remote caching, which stores compiled artifacts in a distributed storage cluster. Fourth, developers switch their local workflow to use a thin client that streams only the parts of the repo they need, keeping checkout times under 2 minutes.

Below is a simplified outline of the process:

  1. Export each repo’s history with git fast‑export.
  2. Rewrite paths using a script that places the code under //services/ or //libs/ directories.
  3. Import the rewritten history into the central GitLab instance.
  4. Run bazel query to build a complete dependency graph.
  5. Configure remote cache endpoints (e.g., Google Cloud Storage bucket).
  6. Update CI pipelines to call bazel build //... with cache flags.
  7. Roll out a thin‑client wrapper that fetches only needed sub‑trees for each developer.

The key jargon includes “remote cache” (a storage that holds compiled objects so they can be reused), “thin client” (a tool that avoids checking out the whole repo), and “dependency graph” (a map of which code pieces rely on which others). By keeping the graph up‑to‑date, Bazel can rebuild only the affected modules, which explains the dramatic cut in build time.

Who Wins and Who Loses

Uber’s engineering teams win the most. Faster builds mean developers spend less time waiting and can push changes more often, which aligns with the company’s goal of delivering new features weekly. The platform team reported a 15 % increase in deployment frequency within the first quarter after migration.

Operations also benefit. The remote cache reduced duplicate compile work by about 45 %, cutting cloud CPU usage and saving an estimated $12 million per year. The company’s finance department highlighted the lower spend as a concrete ROI on the migration effort.

However, some groups face new challenges. Security teams must now manage access controls at the directory level rather than at the repo level, which required new tooling and policy updates. Smaller partner teams that previously owned a single repo now share space with many other teams, leading to occasional merge conflicts that need careful coordination.

What Can Still Go Wrong

Even with Bazel’s caching, a mis‑configured rule can cause a full rebuild, consuming hours of compute time. Large binary assets, such as machine‑learning models, can bloat the repository and slow down clones if not stored in a separate artifact store.

Cost overruns are possible if the remote cache is over‑provisioned. Uber’s engineers set a cache size limit of 2 TB, but a sudden spike in nightly builds once pushed the usage to 2.5 TB, prompting a temporary price increase.

  • Build‑script bugs that invalidate the cache.
  • Insufficient directory‑level permissions leading to accidental code exposure.
  • Repository bloat from large, version‑controlled data files.

What To Watch Next

Over the next 12 months, keep an eye on three signals. First, monitor Uber’s public engineering blog for updates on scaling the monorepo beyond 500 GB; a new threshold could influence other firms. Second, watch the adoption of Bazel’s remote execution service, which promises even faster builds but adds complexity. Third, track any policy changes from GitLab regarding monorepo permissions, as these could affect how other companies manage security at scale.

If Uber can keep build times under five minutes while adding new services, the monorepo model may gain traction among other ride‑sharing and logistics firms that face similar code‑size challenges. Conversely, any major outage linked to repository corruption would serve as a cautionary tale for the industry.

[AI_IMAGE_PROMPT: close‑up of a terminal showing a Bazel build command with a fast progress bar, Uber branding faint in background]
Editorial Intelligence

Stay Ahead of the Curve

Join 12,000+ top strategists getting weekly human-curated editorial insights and deep-dives directly in their inbox.