Monorepo vs polyrepo is the kind of debate engineers argue about with religious intensity. The truth is less satisfying: the right answer depends on your dependency graph and team coupling, not on your aesthetic preferences. Big tech (Google, Meta) runs monorepos at internet scale. Bigger tech (Microsoft, Amazon) runs polyrepos at the same scale. Both work. This guide is the honest framework for picking and the tooling that has neutralized most of the historic pain.
What changed in 2026
- Turborepo and Nx matured to where JavaScript monorepos cache and parallelize at near-Bazel quality without the Bazel learning curve.
- GitHub Actions concurrency and reusable workflows make polyrepo CI almost as efficient as a monorepo's task graph.
- Cross-repo refactors got better with tools like Renovate, Backstage tech radar, and shared OpenAPI schemas — closing the "polyrepo can't refactor" gap.
When monorepo is the right call
- High code sharing across services (types, design system, validation schemas).
- Atomic cross-service refactors are common (rename an API field, update three callers in one PR).
- Small-to-medium team (under ~50 engineers) where everyone can reason about the whole tree.
- Strong CI/CD investment willingness — the payoff requires good tooling.
When polyrepo is the right call
- Many teams own distinct services with stable APIs — clear ownership boundaries.
- Different deployment cadences (a slow-moving infra service and a fast-moving product service shouldn't share CI).
- Security boundaries — different teams need different access levels.
- Acquired companies / external contractor teams — natural repo boundaries.
The hybrid that works
Most large engineering orgs in 2026 land on a hybrid: a few large logical monorepos (one for the web stack, one for backend services in a language, one for data infra), not one mega-repo and not 500 micro-repos. This shape:
- Keeps related code together (shared types and atomic refactors within the repo).
- Maintains clear ownership boundaries between major domains.
- Allows independent deployment cadences.
- Doesn't require Google-scale tooling investment.
Tooling comparison
| Tool |
Best for |
Languages |
Learning curve |
| Turborepo |
JS/TS monorepos |
JS/TS first-class |
Low |
| Nx |
JS/TS monorepos with generators |
JS/TS, some Python/Java |
Medium |
| Bazel |
Polyglot, very large scale |
Polyglot |
High |
| Pants |
Python-first, polyglot |
Python, JS, Java, Go |
Medium-high |
| Lerna |
Legacy JS monorepos |
JS/TS |
Maintenance mode |
For a JS/TS shop under 100 engineers, Turborepo is the default. Above that, evaluate Nx for its generators or Bazel if you're polyglot.
What you lose, by structure
Going monorepo, you trade away:
- Independent versioning of internal packages.
- Per-service CI/CD pipelines (need task-graph-aware tooling).
- Clear "you only touch what you own" boundaries (requires CODEOWNERS discipline).
Going polyrepo, you trade away:
- Atomic cross-service refactors.
- Shared types/code without copy-paste or package publishing.
- Single source of truth for tooling/lint/format config.
Migration realities
Polyrepo → monorepo migrations work; they take 1-3 months of dedicated work at typical scale. Tooling exists (Lerna migrate, manual git filter-repo + scripts). Worth doing if the cross-repo friction is genuinely costing you.
Monorepo → polyrepo migrations are rarer and harder. Usually only happens during major reorgs.
FAQ
Does GitHub support large monorepos?
Yes. The size constraints (memory, indexing) are higher than most teams need to worry about. GitLab and Bitbucket also work.
Does CI scale on a monorepo?
With proper task-graph tooling (Turborepo, Nx affected, Bazel), yes. Without it, no — every PR runs everything and you'll feel pain at ~50k files.
Code review — easier or harder in a monorepo?
Different. CODEOWNERS auto-routes to right reviewers; PRs can span domains, which is power and risk.
Should startups start with monorepo or polyrepo?
Monorepo, almost always. The flexibility to refactor early is more valuable than the early ownership clarity polyrepo provides.
Where to go next
For related material see Turborepo monorepo setup in 2026, CI/CD best practices in 2026, and How to deploy a full-stack app in 2026.