Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Splitting your code over many repositories massively increases the cost of refactoring, making it that less likely that your system will be "well factored".

Besides the "N pull requests" problem you now lose history whenever you move a file across repo boundaries, and you'll eventually have straggler projects staying on old versions for years - so switching to a new way of doing something essentially means supporting both versions forever. Code for common needs gets duplicated, or worse, split out into yet another repository and /then/ duplicated, because no one wants to check if any of 100 repositories rely on the buggy behaviour they want to fix.

I find this to be this a level headed explanation of the advantages of monorepos: https://danluu.com/monorepo/. I'm surprised to see so many comments summarily dismissing them, as if sanely managing thousands of smaller interdependent repositories doesn't require at least as much investment in custom tooling.



> Splitting your code over many repositories massively increases the cost of refactoring, making it that less likely that your system will be "well factored"

The project should stay a full monolith until the factoring is more clear.

> I find this to be this a level headed explanation of the advantages of monorepos: https://danluu.com/monorepo/.

There are two issues I have with this article. One of them is when it describes drawbacks of multiple repositories, its not specific enough e.g.

> That sounds like it ought to be straightforward, but in practice, most solutions are cumbersome and involve a lot of overhead.

The other is that it assumes you have Google scale of resources to throw at the problem. If thats the case you can make anything work / monorepos or polyrepos. The issue is that small-to-medium sized organizations will not be prepared to invest the amount of resources needed to keep a monorepo working well, as the org will largly need to rely on existing available (OSS) tools which often have poor monorepo support. (Bazelifying everything has a significant cost, bazel rules are often not generic enough to work with e.g. the variety of JS ecosystem tools)


Only if you break your code up on boundaries that don't reflect reality.

If one business change requires code changes to ~every module in your source tree, then of course microservices, and therefore separate repos per service or whatever, make no sense at all.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: