Short answer: Monorepo wins when teams share code often — one place to refactor across apps, one dependency graph, atomic commits across services. Polyrepo wins when teams are independent — small CI setups per repo, easy ownership boundaries, no monorepo tooling tax. In 2026 the honest answer at 5 engineers is 'polyrepo, do not overthink it'; at 50 engineers, 'hybrid — monorepo for the services that share code, polyrepo for the ones that do not'; at 500 engineers, 'monorepo if you have the platform team to run Bazel or Nx, polyrepo if you do not'. The switching cost is high enough that most teams should decide once and commit.
There are two types of source control for teams who maintain more than one service: monorepo and polyrepo. A monorepo refers to a single git repository containing multiple projects. Polyrepo architecture works by keeping each service in its repository and composing them on the artifact level. There is no one right answer here Google and Meta run on monorepos; Netflix and Spotify run on polyrepos; and the true cost of switching is about a year of work for your platform team.
If you’re a team of 20, 50 or 150 engineers who have outgrown the one-repo-with-one-app phase, this post is for you. We will not tell you one is “best”. We will explain the benefits of each CI solution, the complexity involved in using each and the complexity of switching to another one in case your first choice was wrong.
Ruby.ci provides support for a monorepo change detections alongside path filtering, as well as polyrepo coordination through shared pipeline fragments. We will refer to it twice. Everything else is category-level.
The plain definitions
A single git repository housing multiple applications, services, libraries, or packages is called a monorepo. Examples of these include google's internal mono, meta's mono, shopify/shopify, microsoft's older vast repos. Every project exists in a top-level folder. Multiple Project Touching Changes are landed as a single commit. A single build graph, a single version, a single CI setup.
Having separate git repositories for each application is known as a polyrepo. Classic examples are Netflix and Amazon's internals and most Rails shops. Every repository governs its own build, CI, versioning and release cadence. Cross-service changes take the form of multiple PRs across multiple repos, coordinated by convention or by platform tooling.
A hybrid approach uses a monorepo for services that share code heavily but a polyrepo for services that don’t. In reality, most companies that employ between 50 and 200 engineers find themselves in this situation without ever making a formal decision to.
Check out Google's monorepo paper and Linus Torvalds' email on git design for further information.
Monorepo — where it wins
Make integral updates on various services, rename universal libraries and approve every request in just one confirmation. Avoid the "coordinate three pull requests across three repositories" dance.
Everyone uses same version of a shared internal library which simplifies dependency graph. No more situation in which services A and B are on different versions without memory of why.
Simple Restructuring The greps Get It Done The IDE’s “find all references” is functional. You can evaluate the overall impact of a change before you make it live.
"We invest in shared tools, meaning a linter, a test runner, a pipeline primitive." Platform teams can spend once and gain everywhere.
New engineers can discover the whole codebase. The reduction in onboarding cost is because context is in one place.
Monorepo — what it costs
A naive monorepo CI runs every test on every commit. When there are 500 software engineers and 50 services_available, it will become heavy. It's necessary to have CI that is aware of path filtering that only runs tests. Bazel, Buck, Pants, Nx, Turborepo Every option takes months to learn how to use.
Time to copy repository. No jokes Attempting to git clone takes 5 minutes. The complete record requires 30 minutes. Using partial clone can help, but it does come with ergonomics issues.
Merge contention. There is an increase in merging into the same repo traffic and semantic conflicts. Check our merge queue post for the relevant pattern.
All tools (GitHub, GitLab, self-hosted git) fail at 10GB repo. Reaching production level requires some tooling.
Polyrepo — where it wins
Each repo will have a small, fast CI for itself. Unrelated services don’t need to coordinate.
Clear ownership means every repo has an owner and nothing can happen in that repo without them being aware.
.
Simple to incorporate. New service generates a new repo and done. No negotiation on the location of the monorepo tree.
Each service has the independence to choose its own release cycle. They do not have a common release cycle.
You can manage without a dedicated team for monorepo tooling. We can set up CI for an entire repo within a single afternoon.
Polyrepo — what it costs
Changing the name of a shared library method will require a version bump. You will also have to coordinate decisions with N different callers over weeks which will cost a lot.
Version drift occurs when one service A is using shared-lib v1.3, service B is using shared-lib v2.0, service C vendored it in 2022 and has not updated since. Debt Friends You.
Discovering new things is more tedious than usual. To understand the system, they must clone 15 repos.
Shared tools incur additional expenses as every repo reconfigures linters, test runners, and CI. It is normal to drift.
Refer to Atlassian's monorepo vs multirepo overview and buildkite.com for vendor interpretations.
The decision matrix by team size
Five engineers, polyrepo I'd recommend against spending a month doing tooling for a monorepo to save six weeks of coordination over a year. Opt for the simpler option.
Fifty engineers, hybrid. A monorepo is best suited for services that share code amongst themselves. The ten independent services remain polyrepo. Clearly outline where things live, and document it.
Five hundred engineers We are dependent on whether you have or can fund a platform team of 5+ engineers who can run Bazel or Nx If yes, combine it into a monorepo. If not, stay polyrepo with ownership stringency.
5000 engineers using only one repo The cost of coordination for polyrepo outweighs the cost of tooling for monorepo. Shopify, Google, and Meta all came together here.
The hybrid pattern most people actually run
Most monorepo companies also have polyrepos in their ecosystem. Google has a monorepo and Chrome. Meta has a monorepo and WhatsApp. It is the truthful form.
- A central monorepo for services that share code and release coordinately.
- Separate polyrepos for standalone products or acquisitions.
- A platform team that owns the boundary and documents when to put a new thing where.
Either way, ensure there is sufficient platform engineering capacity to run a monorepo with the necessary caching in place. If folks think they are already in the black then this will probably be out of their control anyway. Use hybrid if necessary.
CI implications
To facilitate CI for a monorepo compliant branches need to be selected. Running the entire test suite on every commit for 50 services isn't scalable. Refer to CI pipelines guide and continuous delivery vs continuous deployment for deployment details.
Coordination across repositories is essential for polyrepo CI. This is the commonplace idea: a shared library publishes an artifact (probably a gem), people pin the version in their downstream service. Then Dependabot opens pull requests when a new version is shipped. Check out our build artifact definition for the second half of the artifact.
Ruby.ci is designed to manage both things: Ruby.ci is already aware of path filtering due to its reusable step syntax. Refer to our CI/CD tools for DevOps and trunk-based development for the context.
Switching cost
A Rough Estimate for Switching from Polyrepo to Monorepo
- 2–4 months of platform engineering to pick and set up the tooling (Bazel/Nx/Turborepo).
- 3–6 months of merging services into the mono one by one.
- 2–3 months of CI retooling to make path filtering fast.
Shifting from a monorepo to a polyrepo takes less wall-clock time (3–6 months total), but is more disruptive you lose atomic commits and version coherence right away, and services have to re-learn independent release cadences.
Most teams must settle on a CI tool, and stay committed. The expense of annulling the choice is substantial to the degree that it seldom reimburses inside two years.
Frequently asked
Refer to the FAQs section.
Still stuck
Wondering if your company with 40 engineers should use hybrid or full mono? Our self-hosted runners and CI pipelines guide now supports path-filter for monorepo setups and artifact coordination for polyrepo settings. To gain an understanding of the overall shape, start with our deployment automation post.