Why Monorepos Are Winning Again: The Tooling Revolution
Monorepos lost to polyrepos when tooling failed, but modern build systems, git at scale, and cloud CI have solved the pain points. Discover why teams are returning to monorepos not out of nostalgia, but because the developer experience finally works.
Advertisement
Monorepos were once the default. Then distributed version control and microservices pushed everyone toward polyrepos — every service its own repo, every team its own island. But a decade later, monorepos are roaring back. And this time, it's not because of nostalgia — it's because the tooling finally works.
Why Developers Left Monorepos
Early monorepo pain was real. Git scaled poorly with large repositories. A git status could take seconds. Pre-commit hooks became nightmares. CI pipelines rebuilt everything from scratch. And if you needed to manage permissions, you were out of luck — Git didn't care about subdirectory access.
So teams broke things apart. Polyrepos felt clean: each project isolated, each team self-sufficient. But the cracks appeared fast:
- Cross-repo refactoring became a multi-PR coordination headache
- Version mismatches between shared libraries silently broke things
- Copy-paste code proliferated because sharing was too hard
- CI pipelines duplicated work across dozens of repos
The polyrepo world traded monorepo friction for distributed chaos.
The Tooling Revolution That Changed Everything
Three things needed to happen for monorepos to work at scale. Each has been solved in the last few years:
1. Build systems that understand dependencies
Tools like Bazel, Nx, and Turborepo changed the game. They build a dependency graph of your entire repo, then only rebuild what changed. A change deep in a shared library? It automatically invalidates and rebuilds only the packages that depend on it. No more full rebuilds. No more guessing.
Example: Google's monorepo has billions of lines of code. Bazel lets engineers get incremental builds in seconds. The algorithm is the same one your local Nx project uses — just at absurd scale.
2. Git at scale
Microsoft proved git could handle Windows' massive monorepo (300GB+, 3.5 million files) with VFS for Git (now Scalar). GitHub rolled out sparse checkout. Git LFS grew up. The storage and checkout problems were solved — not by giving up on git, but by making it smarter.
3. Cloud-based CI
Traditional CI meant each branch triggered a full pipeline. Monorepo CI without dependency awareness was suicide. Now platforms like GitHub Actions, Buildkite, and GitLab CI support paths: filters and matrix builds based on changed files. Combined with build system caching, a monorepo CI pipeline can finish faster than the equivalent polyrepo setup because cache hits are shared across the entire org.
What You Actually Get With Modern Monorepos
Atomic changes across packages. Refactoring a shared type? Change it in one commit, update all consumers in the same PR. Code review shows the full impact. Rollbacks are clean. No "deploy package A, then wait, then deploy package B, hope nothing breaks" dance.
Shared tooling configuration. One package.json, one tsconfig.json, one set of lint rules. New developers clone one repo and run one command. Polyrepo teams spend days aligning tooling versions.
Cross-team visibility. You can browse the entire codebase. Find patterns. Reuse utilities. Discover that team B already wrote the function you were about to write. A polyrepo hide-and-seek game becomes a single search.
Simpler CI logic. Instead of maintaining separate CI configs for 20 repos (each with subtle differences), you maintain one. Your build system handles the dependency logic. CI becomes a generic "run the pipeline" step that magically knows what to rebuild.
When You Should Still Think Twice
Monorepos aren't a universal win. They shine when:
- Your code is tightly coupled (shared types, utilities, libraries)
- You have a central team managing tooling and infrastructure
- Your teams are small enough to have overlapping code ownership
They struggle when:
- You have truly independent services with no shared code
- Your org enforces strict access control at the repo level (each team must own their directory)
- You're working with massive binary files or generated artifacts that shouldn't be in a single git history
The Real Takeaway
Polyrepos were a reaction to bad tooling. Monorepos are a return to developer convenience now that the tooling exists. A git clone once a day and a build system that actually works is a better developer experience than juggling 15 repos, version mismatches, and cross-team choreography.
The monorepo isn't winning because it's fashionable. It's winning because it removes friction — and friction is the enemy of shipping.
Advertisement
Comments
Questions, corrections, and tips stay visible for everyone reading this page.
Join the discussion
No comments yet
Be the first to leave a note — it helps the next reader.