by Naac on 4/7/22, 3:20 PM with 140 comments
by lisper on 4/7/22, 3:48 PM
by captainmuon on 4/7/22, 4:26 PM
One place I've worked at migrated to a monorepo, the ATLAS experiment at CERN. It was not bad, although there were the usual problems with long checkout time. But it worked because we tended to version every single piece of software together in a big "release" anyway (to make scientific results reproducable).
by bob1029 on 4/7/22, 4:22 PM
Once a non-technical person learns that the entire state of a product/project/organization can be described by a hash, they will begin to abuse it for literally everything. And, I totally endorse this. Its incredible to watch unfold. An employee passively noting the current commit hash like its the time of day puts a bit of joy into my brain every time.
Everyone can speak this language. The semantics are ridiculously simple.
by akshayshah on 4/7/22, 4:49 PM
Edit: I worked at Microsoft, which also uses tons of tiny repos (at least within Azure). I didn't encounter any good cross-repo management tools, though; apart from having a Jira-like ticketing system built in, Azure DevOps seemed quite a bit worse than GitHub.
by lliamander on 4/7/22, 8:31 PM
However, I think the "polyrepo" response to most of these advantages would be to focus on decoupling your systems instead.
Take for instance:
> With a monorepo, you just refactor the API and all of its callers in one commit. That's not always trivial, but it's much easier than it would be with lots of small repos. I've seen APIs with thousands of usages across hundreds of projects get refactored and with a monorepo setup it's so easy that it's no one even thinks twice.
Like, that's really cool you can do that. But why are doing that?! Why are you breaking your API contract and forcing all of your clients to change all at once?
Of course, proper decoupling also requires good engineering. A polyrepo environment can still get horribly tangled, but the natural response to all of these tangling problems in a polyrepo is to move in a direction of looser coupling.
by oceanplexian on 4/7/22, 4:22 PM
A monorepo is an organizational mess when trying to manage and transfer ownership across thousands of teams, contain the blast radius of changes, unless you invest a ton of resources into proprietary tooling that requires a bunch of maintenance, since all the open source solutions are terrible at this and the whole data model is built around splitting out individual project repositories. And then after all that effort, why wouldn’t you just use tooling the way it was intended, and the way it’s used in the open source model, so you can partition your CI/CD without a bunch of hacks, and don’t run into bizarre scaling issues with your VCS.
It perplexes me people advocate for this strategy. All I can think is it’s another one of those cargo-cult ideas that everyone is doing because Google did it (So it must be good).
by pbiggar on 4/7/22, 3:45 PM
In fact, it makes it so easy to add new stuff that I didn't even realize we had 21 services til I counted. My first guess was 12.
by codenesium on 4/7/22, 3:51 PM
by hardwaregeek on 4/7/22, 4:25 PM
Even with Dan's point about monorepos making tooling easier, if a VC tool had a good API, perhaps this point would be moot. Why is it hard to query files and repository dependencies? Should there be some way to model dependencies in your version control system? It'd be interesting to see someone tackle these problems in version control.
by benreesman on 4/7/22, 3:56 PM
All the big shops have multiple repositories. They all broke each one out grudgingly and under some kind of pressure.
by honkycat on 4/7/22, 5:12 PM
On our multi-repos I have consistently seen dozens, if not hundreds, of stale pull requests and branches and issues piling up never to be merged. This compounds with a monorepo.
Additionally, how do you avoid doing pointless builds when new features are pushed? I can only imagine what the `.github` folder in a monorepo looks like.
For me it is similar to the "one large file" argument, and why I don't agree: obfuscation is bad, but information hiding is GOOD. When I open a file, I want the information relevant to the current domain I am working in, not all of the information all at once.
Similarly, when I open a github page, I want its issues, pull requests, branches, and wiki to represent the state of a single project. The one I am currently interested in. You lose this with a monorepo.
You can argue "well tooling can..." yes tooling that does not exist and that I do not want to implement. Similar to the "one large file" argument, editors are set up to manage many different files with tabs. You COULD just compile the code and navigate symbols, but that isn't the world we currently live in.
by jsnell on 4/7/22, 4:10 PM
by trollied on 4/7/22, 4:48 PM
I don't actually understand this. You can do this with git submodules. It's just a directory structure. Can somebody please explain? If the problem is committing to multiple things at the same time for a point-in-time release, then the answer is tags. Rather than terabytes of git history for a gigantic organisation that has many unrelated projects.
A good example for you: Google releases the Google Ad Manager API externally periodically, with dated releases. How does having that in a huge monorepo make sense?
by jkaptur on 4/7/22, 4:10 PM
Does anyone have any useful pointers? I'm in such total agreement with the article that I actually don't know the counterarguments.
by denimnerd42 on 4/7/22, 4:22 PM
by Naac on 4/7/22, 3:51 PM
For example, I've worked in a monorepo that was one giant binary, but I've also worked in a monorepo that was a single repo that contained 4 ish independent services ( but were all in a single git repo ).
by no_wizard on 4/7/22, 3:53 PM
It comes down to how efficient you can be with tooling. Thats the one thing that monorepos really do require, is a good upfront investment in tooling, and long term maintenance. However I've found the initial setup "cost" of setting up a complex monorepo with correct tooling is far outweighed by the simplified operative overhead of working inside it.
by atx42 on 4/7/22, 5:37 PM
I mention this here, as maybe I'm missing some obvious solution.
by paulvnickerson on 4/7/22, 4:54 PM
However, my colleague explained that it's a bad idea because any config changes or accidental button presses on gitlab's ci/cd page can bring down or wipe out everybody's cluster. How can that problem be mitigated? It seems intrinsic to monorepo style.
by Thaxll on 4/7/22, 4:56 PM
by pbalau on 4/7/22, 4:27 PM
With monorepo, I had to set up things once and go on my merry way. And I will be able to kick the monorepo-is-too-slow-can down the road for a few years from now.
by trasz on 4/7/22, 4:57 PM
by wjmao88 on 4/7/22, 4:41 PM
The number of repos you have should roughly be equal to how many autonomous engineering "groups" you can divide into that work largely independent of other groups. Anything a group touches should probably be in the same repo as everything else that the same group touches.
by Maksadbek on 4/7/22, 5:56 PM
by switch33 on 4/7/22, 10:32 PM
There is lots of problems associated with ssds as well as large monorepos. There are more complicated than people realize but if you did google code jam it teaches them somewhat but needs to be explained too. There problem is stories sort of intersect with programming too. Clockwork with ssds needs to be reworked for google code jams. The problem is elixir sort of works with stories and programming. Predicate calculus and proof theories sort of are the only way programming will really make sense in a world full of ssds. Leveldb could be a more interesting problem for google code jams if it has some newer features too. Conflict resolution is tower of hanoi and that has problems with consensus algorithms and concat too.SSDs need to do derivatives for pieceing and parting software too and that is more interesting too.
by liminal on 4/7/22, 3:49 PM
by MichaelMoser123 on 4/7/22, 5:51 PM
I have never worked with mono repos, but I guess that this task would be somewhat easier, given that all sources are under a single repository.
by dqpb on 4/7/22, 11:28 PM
by 88913527 on 4/7/22, 3:47 PM
by exfascist on 4/7/22, 4:23 PM