-
Notifications
You must be signed in to change notification settings - Fork 2.6k
docs(nx-dev): add monorepo myths article #32944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
philipjfulcher
wants to merge
1
commit into
master
Choose a base branch
from
philip/monorepo-myths
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| --- | ||
| title: '10 Monorepo Myths Debunked: Separating Fact from Fiction' | ||
| slug: monorepo-myths-debunked | ||
| authors: ['Miroslav Jonaš', 'Philip Fulcher'] | ||
| tags: ['nx', 'monorepo'] | ||
| cover_image: /blog/images/2025-10-02/header.avif | ||
| description: 'Explore the most common misconceptions about monorepos and learn the truth behind the myths. From performance concerns to scaling limitations, we tackle the biggest obstacles to monorepo adoption.' | ||
| --- | ||
|
|
||
| Monorepos have become increasingly popular in modern software development, but misconceptions about them persist. These myths often become the biggest obstacles to adoption, even when monorepos could significantly improve your team's workflow. Let's examine ten common myths and uncover the reality behind them. | ||
|
|
||
| {% toc /%} | ||
|
|
||
| ## How Myths Are Created | ||
|
|
||
| Before diving into specific myths, it's worth understanding how these misconceptions emerge in the first place: | ||
|
|
||
| **Shoehorning** - Trying to force new concepts into old mental models that don't quite fit. Monorepos work differently than traditional multi-repo setups, and assuming they're identical leads to false conclusions. | ||
|
|
||
| **The "Master Level" Trap** - Skipping the documentation and jumping straight into implementation. When we overestimate how our existing expertise translates to new tools, we set ourselves up for failure. | ||
|
|
||
| **Hammer Syndrome** - Just because you have a powerful tool doesn't mean everything is a nail. Monorepos are powerful, but they're not the solution for every problem. | ||
|
|
||
| ## Myth #1: Monorepos Are Just Monoliths | ||
|
|
||
| This is perhaps the most fundamental misconception. While both terms start with "mono," they represent completely different concepts. | ||
|
|
||
| **The Reality**: **Monoliths** are an architectural pattern where all code is tightly coupled into a single deployable unit. **Monorepos** are a [source control strategy](/concepts/decisions/why-monorepos) that can contain monoliths, microservices, micro frontends, or any combination thereof. | ||
|
|
||
| In fact, monorepos actually encourage [modular architecture](/blog/virtuous-cycle-of-workspace-structure) and loose coupling. If you think of a monolith as a headache, consider a monorepo as the pain killer that helps relieve it. | ||
|
|
||
| ## Myth #2: Monorepos Are Inherently Slow | ||
|
|
||
| "Every change rebuilds everything. Pipelines choke. CI costs explode. Developers give up." | ||
|
|
||
| This myth stems from traditional systems that lack dependency awareness. Without understanding what's affected by a change, you're forced to rebuild and retest everything, leading to multi-hour pipelines and nightly tests. | ||
|
|
||
| **The Reality**: Modern monorepo tools provide [dependency graphs](/features/explore-graph) that expose exactly what's been affected by your changes. You can [filter work to only the subset of projects](/ci/features/affected) that actually need attention. | ||
|
|
||
| CI cost and performance depend primarily on pipeline design, not repository topology. With proper dependency handling and features like [caching](/concepts/how-caching-works), monorepos can actually be faster and cheaper than polyrepos, especially when you're only running the subset of work that's truly necessary. | ||
|
|
||
| ## Myth #3: Monorepos Can't Scale Beyond a Certain Point | ||
|
|
||
| "How big is too big? How many projects can you have before things become unbearably slow?" | ||
|
|
||
| This concern often comes with assumptions about synchronized deployments and impossible rollbacks. However, deployments and development are orthogonal concepts. | ||
|
|
||
| **The Reality**: The size of your monorepo doesn't dictate how or when you deploy applications. You can easily have [deployment pipelines per project](/features/manage-releases) while treating each project as if it were in a separate repository, or take advantage of monorepo features. The choice is yours. | ||
|
|
||
| Scaling limitations are always a matter of tooling: | ||
|
|
||
| - Checkout too slow? Use partial checkout | ||
| - Type checking too slow? Implement [project references](/concepts/typescript-project-linking#typescript-project-references-performance-benefits) | ||
| - Graph too convoluted? [Your architecture needs attention](/blog/improve-architecture-and-ci-times-with-projects) | ||
|
|
||
| ## Myth #4: Monorepos Don't Work for Polyglot or Microservices | ||
|
|
||
| Without separate repositories, maintaining clear ownership and technology choices seems impossible. We're used to having full control over a project and assume that [multiple programming languages and frameworks](/blog/spring-boot-with-nx) can't coexist successfully. | ||
|
|
||
| **The Reality**: In monorepos, each project can have its own build, runtime, and deployment pipeline as if it were in a completely separate repository. Teams can restrict access to their code and prevent unauthorized dependencies. | ||
|
|
||
| For example, the Nx codebase contains TypeScript, Rust, Go, Kotlin, and Python. You can use repository-wide conventions where they add value and define per-folder toolchains where they don't. The key is that monorepos provide optional standardization: you bring the benefits without forcing uniformity. | ||
|
|
||
| ## Myth #5: Adoption has to be a big bang | ||
|
|
||
| "We'd love to adopt a monorepo, but we just don't have time to block weeks or months of development for a full migration." | ||
|
|
||
| This assumption comes from painful memories of technology migrations (anyone remember AngularJS to Angular 2?). | ||
|
|
||
| **The Reality**: Migrating to monorepos doesn't have to be a big bang. Start with a single repo, turn on monorepo tooling, then [import another repository while preserving the full Git history](/recipes/adopting-nx/import-project). Initially, treat them as separate repositories that happen to be collocated in the same Git repository. | ||
|
|
||
| As you add more pieces (shared libraries, services, etc.), you can gradually think about standardization, alignment, and creating joint pipelines. You don't have to place everything in the same monorepo immediately. Features like [Polygraph](/blog/nx-cloud-introducing-polygraph) allow you to see dependencies beyond single monorepo borders and run checks across several repositories as if they were one. | ||
|
|
||
| ## Myth #6: You're Locked Into Lockstep Versioning | ||
|
|
||
| Lockstep versioning means deploying everything simultaneously with aligned versions. Many popular open source tools publish lockstep versions, leading to the conclusion that it's unavoidable. | ||
|
|
||
| **The Reality**: Packages in monorepos can have independent versions and release cycles. Lockstep versioning is a choice, not a requirement imposed by the monorepo strategy. | ||
|
|
||
| Workspace-aware package managers and monorepo tools often include release tooling that enables you to: | ||
|
|
||
| - [Publish package versions independently](/recipes/nx-release/release-projects-independently) | ||
| - [Handle changelogs per project](/recipes/nx-release/configure-changelog-format) | ||
|
|
||
| You can implement continuous deployment where you deploy on every change, or decide when to deploy on a per-project, per-application basis. | ||
|
|
||
| ## Myth #7: There Are No Code Boundaries or Permission Controls | ||
|
|
||
| In a huge repository with hundreds of projects and hundreds of people, it's understandable to assume things can get out of control. "Everyone can see all the code and change all the code because they have access to the same repository." | ||
|
|
||
| **The Reality**: Monorepo tools can provide better [code boundaries](/features/enforce-module-boundaries) and source control than traditional multi-repo setups. You can use: | ||
|
|
||
| - Path-based ownership and review rules (like [CODEOWNERS files](/nx-enterprise/powerpack/owners)) | ||
| - Granular write controls enforced by branch protection or server-side policies | ||
| - Automated checks for code requiring approvals from owners | ||
| - [Cross-boundary change validation](/blog/mastering-the-project-boundaries-in-nx) | ||
|
|
||
| In polyrepos, while you might have security per repository, you can't know how published projects are used across the company. In a monorepo, you can absolutely restrict those usages and [enforce architectural boundaries](/technologies/eslint/eslint-plugin/recipes/enforce-module-boundaries). [Conformance rules](/blog/nx-cloud-conformance-automate-consistency) help automate consistency across your organization. | ||
|
|
||
| ## Myth #8: Cognitive load is high & onboarding is painful | ||
|
|
||
| A massive repository seems too overwhelming for developers to navigate and understand, leading to painful onboarding. | ||
|
|
||
| **The Reality**: Proper tooling and organization make large codebases more manageable than scattered multi-repo setups. When you have unified tooling, you can: | ||
|
|
||
| - Set a single set of tools for testing and building | ||
| - Unify frameworks, libraries, and their versions | ||
| - Create a consistent developer environment | ||
| - Reduce overhead where developers spend less time on tooling decisions | ||
| - Focus on [architecture and code quality](/blog/architecting-angular-applications) | ||
|
|
||
| Monorepos enable better technical debt management by providing visibility across your entire codebase. | ||
|
|
||
| ## Myth #9: Dependency Hell Is Worse in Monorepos | ||
|
|
||
| With everything centralized, each project bringing its own dependencies seems to create unmanageable chaos. | ||
|
|
||
| **The Reality**: Centralization makes it easier to: | ||
|
|
||
| - Find duplicate dependencies and consolidate them | ||
| - Apply security patches organization-wide | ||
| - Spot incompatibilities between libraries | ||
| - Maintain allowed versions in a single place | ||
| - [Run automated dependency updates](/features/automate-updating-dependencies) | ||
| - Perform vulnerability scans for the entire organization | ||
|
|
||
| You can still make overrides when needed. If a legacy application needs to use a different version of React or Java, you can override it per project without affecting the rest of your monorepo. | ||
|
|
||
| ## Myth #10: AI Doesn't Work in Large Codebases | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we wanted we could also point to monorepo.tools/ai |
||
|
|
||
| AI shines with single-file changes and simple prompts. But as projects grow and require changes across multiple files, AI fails more frequently. | ||
|
|
||
| **The Reality**: This isn't a limitation of large codebases. It's a consequence of how you're using AI. Giving AI the full context of a monorepo actually [creates better results](/blog/nx-and-ai-why-they-work-together) than polyrepos or single repositories. | ||
|
|
||
| Monorepo tools [share valuable context with AI](/getting-started/ai-integration): | ||
|
|
||
| - How to use monorepo tooling | ||
| - In-depth insights about architecture, the graph, and connections | ||
| - Conventions for the codebase | ||
| - How to run tasks to validate changes | ||
|
|
||
| Learn more about [making your AI assistant smarter with Nx](/features/enhance-AI) and watch our [webinar on AI-assisted development in monorepos](https://go.nx.dev/april2025-webinar). | ||
|
|
||
| ## The Path Forward | ||
|
|
||
| Monorepo myths stem from misunderstanding how modern tooling solves traditional problems. The key takeaways: | ||
|
|
||
| **Don't Believe the Myths**: Monorepo tools have ready solutions for virtually all challenges. They bring serious quality of life and developer experience improvements. | ||
|
|
||
| **Start Incrementally**: You don't have to merge everything into a single repo on day one. Even having several monorepos is better than an unmaintainable mess with polyrepos. With features like Polygraph, you can combine the benefits of polyrepos and monorepos. | ||
|
|
||
| **Leverage AI Properly**: Provide your AI agents with the right context. Clear structure and valuable context can elevate them from junior developer to principal architect level. | ||
|
|
||
| **Value Your Time**: Your time at the company and your developer experience are valuable. Why waste them on tooling maintenance, long build pipelines, and subpar experiences? Share with stakeholders the time spent on non-business tasks, CI instabilities, and idle waiting. Ask yourself: "Does my company want me doing this? How much does it cost? Can we do better?" | ||
|
|
||
| ## Learn More | ||
|
|
||
| Want to explore how monorepos can transform your development workflow? Here are some helpful resources: | ||
|
|
||
| - 📄 [Making the Case for Smarter Monorepos webinar recording](/blog/making-the-case-for-smarter-monorepos-and-how-to-not-get-fooled-by-myths) | ||
| - 📄 [Polygraph Documentation](/ci/recipes/enterprise/polygraph) | ||
| - 🌩️ [Nx Cloud](/nx-cloud) | ||
| - 👩💻 [Nx GitHub](https://github.com/nrwl/nx) | ||
| - 💬 [Nx Official Discord Server](https://go.nx.dev/community) | ||
| - 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools) | ||
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still a valid reference point 🤔. (like AngularJS => Angular) 😅