How do you structure a monorepo vs multiple repos? Pros, cons, and your experiences. #176748
Replies: 5 comments
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
Choice often depends on team topology, the kind of systems you’re building (microservices vs. a tightly‑coupled product), governance needs, and how your CI/CD is set up. Monorepo (one big repo): Best when components evolve together, you need atomic refactors across the whole stack, and you want one place to version, test, and release. Multi‑repo (many smaller repos): Best when services are independently owned/released, with clear boundaries, different cadences, and stricter access controls. Monorepo: Advantages & DisadvantagesAdvantages
Disadvantages
Multi‑repo: Advantages & DisadvantagesAdvantages
Disadvantages
My recommendation:I am definitely using both methodologies. Use multi‑repo for microservices, Terraform modules, and platform components, each with its own lifecycle and ownership. Use monorepo (or a small set of product repos) for tightly coupled application codebases (e.g., a single web app with multiple packages), or for cross‑cutting config, policy-as-code and templates that must stay in lock‑step. Glad I could help! If this clarifies your question, feel free to mark it as an answer. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
Great breakdown by @fernandosalomao! I'd add that the tooling ecosystem has shifted this decision significantly in recent years. Previously, monorepos were scary because of build times and git bloat. Now, tools like Turborepo, Nx, and Moon have solved the "build everything" problem with intelligent caching and affected-graph execution. If you're using TypeScript/JS, a monorepo with workspace tools is often strictly better than multi-repo because you get atomic commits without the CI penalty. For Multi-repo, the hidden cost is often 'dependency hell'—updating a shared library requires a PR in the lib, publishing, then N PRs in consuming apps. Rule of Thumb:
|
Beta Was this translation helpful? Give feedback.
-
|
I’ve worked with both setups and honestly — neither is “better”, they just optimize for different kinds of pain. Monorepo (everything in one repository)What it feels like Why teams love it
Why it hurts
Monorepo works best when Multiple Repositories (repo per service/package)What it feels like Why teams love it
Why it hurts
Multi-repo works best when The real difference (in practice)Monorepo optimizes for development speed You’re basically choosing where you want complexity to live:
My personal rule of thumbI default to monorepo until the org structure forces multi-repo. Because most early teams don’t actually have independent services — they have tightly coupled components pretending to be microservices. A monorepo makes that reality easier instead of fighting it. Later, when teams truly operate independently and release cycles diverge, splitting repos starts to make sense. Short version: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Feature Area
Issues
Body
Do you prefer keeping all your code in one big repo, or do you split it into multiple smaller repos? What are the advantages and disadvantages of each method based on your experience?
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions