March 5, 2020

What Is a Monorepo?

Repository Management
Version Control

A monorepo is used by some development teams, while others choose to use multiple repositories. Here, we cover what a monorepo is, how it differs from a monolith, what the benefits of monorepos are, and why companies like Google use a monorepo.

➡️ Best Version Control for Your Monorepo

What Is a Monorepo?

A monorepo (mono repository) is a single repository that stores all of your code and assets for every project.

Using a monorepo is important for many reasons:

  • It creates a single source of truth.
  • It makes it easier to share code.
  • It makes it easier to refactor code.

Difference Between Monorepo and Monolith

A monorepo is a massive codebase containing independent projects, whereas a monolithic application combines sub-projects into one large project.

When we refer to a "monolith" here, we are referring to a monolithic application, which is a single-tiered application designed as a single service. A monolith can be managed in a monorepo. But a monolith could also be split into multiple repositories. Conversely, a monorepo cannot be stored in a monolithic application; instead, monorepos can be used with microservices instead. For additional clarification, check out the blog "Monolith vs Microservices: Which Is Best"?

For the purposes of the piece, we’re going to focus on the monorepo.

Monorepo vs. Polyrepo

Whereas a monorepo contains all the needed code in one repository, a polyrepo typically has one repository for each project. The more projects, the more repositories.

Monorepo Is Usually Best For…


Using a single repository gives you visibility into your code and assets for every project. This helps you manage dependencies.


A single repository makes it easier to collaborate. That’s because everyone can access the code, files, and assets. So, developers can share and reuse assets.


Using a single repository can help you accelerate development. For instance, you can make atomic changes (one action to make a change across multiple projects).

Polyrepo Is Usually Best For…

Git Projects

Managing a monorepo at scale in Git would never work. As the repository gets bigger, a monorepo in Git becomes a huge problem. So if you have teams using Git, it’s best to have multiple repositories.

Another Git challenge is that Git lacks security. Learn how to lock down Git.

➡️ lock Down Git

Open Source or Third-Party Projects

In some version control systems, you’ll need multiple repositories to use open source projects or work with third-party teams. Then you can ensure that third party developers only have access to the project they're working on.

(Of course, with Perforce version control — Helix Core — you can do this with a monorepo or polyrepo. You can restrict permissions down to the file level, even in a monorepo. And you can even bring Git projects into your pipeline with Helix4Git.) 

Is a Monorepo a Good Idea?

Using a mono repository is a good idea for many companies. You can keep all of source code (and other files/digital assets) from every team in one repository. This makes it easier to share with everyone. And it helps you maintain a single source of truth.

After any commit, the new code is visible to and usable by all of your developers. This helps avoid painful merges that are prevalent with trunk-based development.

Here are some reasons why you should consider using a mono repository:

  • You want a single source of truth.
  • You want to share and reuse code easily.
  • You want visibility to manage dependencies (e.g., If you make a change, what else will be impacted?).
  • You want to make atomic changes (e.g., one operation to make a change across multiple projects).
  • You want teams to collaborate more.
  • You want to make large-scale changes (e.g., code refactoring).

If you decide to go the monorepo route, you’ll be in good company. Leading companies — like Google — use a monorepo.

Example: Why Does Google Use a Monorepo?

Google is one of many large companies that famously uses a monorepo.

Google decided early on to use a monorepo — and scaled it up as the company grew. In 2015, the Google monorepo held:

  • 86 terabytes of data.
  • 2 billion lines of code.
  • 9 million unique source files.

So, why did Google choose a monorepo — and stick with it? Because using a monorepo is key to an open and collaborative culture.

Salesforce, Facebook, and Twitter also famously use monorepos.

Of course, if you choose a monorepo, you need version control software — such as Helix Core  — that can support it.

Benefits of a Monorepo with Helix Core

There are a lot of great reasons to use a monorepo. And Helix Core is the best version control for your monorepo.

Here are four key benefits of using Helix Core for your monorepo.


Helix Core is a powerful version control system. It’s the best option for high performance at scale.

When you have a monorepo in Helix Core, it can handle:

  • 10s of 1,000s of users (even geographically distributed teams).
  • Unlimited files.
  • Petabytes of data.


Helix Core gives you visibility and control into your monorepo. In fact, Helix Core gives you the best of both worlds — monorepo and polyrepo.

For example, polyrepo isolates behavior. Monorepo ensures shared responsibility and visibility. With Helix Core, you can have the benefits of both.

You can use Perforce Streams to isolate behavior at a branch level. And you can still get visibility into shared responsibility across branches.


Helix Core is secure — and offers customizable security controls. You can use authentication measures like MFA. And you can set access controls down to the file level.

These security permissions help you work with third party developers on your monorepo.


Helix Core is flexible. You can use Perforce Streams to customize and automate workflows for your team.

This helps your team collaborate better on your monorepo.

Your developers will get fast feedback — and faster builds. They’ll be able to spend less time dealing with tools and processes — and more time delivering value.

Get Started With Helix Core

Helix Core gives you a single source of truth across all projects. And it gives you power, control, security, and flexibility for your teams.

See for yourself how Helix Core will help you. You can get started for free for up to 5 users.

➡️ gET Helix Core


Related Content: