Live data from Hacker News

The Ingredients of a Productive Monorepo

blog.swgillespie.me

231–240 of 268 posts

Re: The Ingredients of a Productive Monorepo

#231
post #213

Earlier quoted context omitted.

In my experience microservices are easier to manage and understand when organized in a monorepo.

That indicates a strong coupling between those microservices.

Even loose coupling is still coupling. For the things that have to be coupled having the code organized in the same place, being able to easily read the source for “the other side”, make a change and verify that dependees test still pass, etc is immensely powerful.

Re: The Ingredients of a Productive Monorepo

#232
post #204
post #62

This thread is reminding me of a prior one about complexity merchants. I am seeing a lot of sentiment that there is somehow a technical sacrifice by moving to a monorepo. This is absolutely ludicrous unless you fail to grasp the power of a hierarchical file system. I don't see how a big mess like CI/CD is made easier by spreading it out to more points of configuration. To me the whole point of a monorepo is atomic co…

Here's the issue... Being able to track commits across multiple projects is just a nice to have. Does it even significantly increase your ability to track dependencies or trigger down stream tests? You can track that stuff with multi-repo automations. Maybe it helps a bit but it's not free and its not complete. Your deploys don't become atomic. Your builds don't become atomic. At best you get to tell yourself you can…

Do you have go-to multi repo automations and other tools for operating across multiple repos?

Re: The Ingredients of a Productive Monorepo

#233
post #62

This thread is reminding me of a prior one about complexity merchants. I am seeing a lot of sentiment that there is somehow a technical sacrifice by moving to a monorepo. This is absolutely ludicrous unless you fail to grasp the power of a hierarchical file system. I don't see how a big mess like CI/CD is made easier by spreading it out to more points of configuration. To me the whole point of a monorepo is atomic co…

Just today I saw someone try to set up a new project and stumble over setting it up as it's own repository, instead of just having a central place to add it.

There's also a vicious feedback loop of separating projects across repos creating a huge impediment for touching anything outside of the project you're directly working in.

Re: The Ingredients of a Productive Monorepo

#234

One thing I don't usually see discussed in monorepo vs multi repo discussions is there's an inverse Conway's law that happens: choosing one or the other will affect the structure of your organization and the way it solves problems. Monorepos tend to invite individual heroics among common infrastructure teams, for example. Because there are so many changes going in at once, anything touching a common area has a huge n…

Much more common is that an easy cross project change in a monorepo simply isn't don't in a polyrepo because of how much more onerous it is.

Re: The Ingredients of a Productive Monorepo

#235

Over the past four years, I’ve set up three monorepos for different companies as contract work. The experience was positive, but it’s essential to know your tools. Since our monorepos were used exclusively for frontend applications, we could rely entirely on the JavaScript/TypeScript ecosystem, which kept things manageable. What I learned is that a good monorepo often behaves like a “polyrepo in disguise.” Each proje…

This isn't a polyrepo in disguise. This is a monorepo done correctly.

Re: The Ingredients of a Productive Monorepo

#236
post #89

I firmly believe that us at Molnett(serverless cloud) going for a strict monorepo built with Bazel has been paramount to us being able to make the platform with a small team of ~1.5 full-time engineers. We can start the entire platform, Kubernetes operators and all, locally on our laptops using Tilt + Bazel + Kind. This works on both Mac and Linux. This means we can validate essentially all functionality, even our Bo…

> a small team of ~1.5 full-time engineers Yes, with one and a half FTEs you should only have a single repo. My experience with Bazel has been extremely bad, but I don’t think that it should necessarily be avoided completely. It may actually have some value on extremely large multi-team projects. But for less than two FTEs it seems like massive overkill. I believe that you could do what you need with Kind (and maybe…

Bazel is notoriously difficult to set up to begin with, but not so difficult to use after that. What was your bad experience?

Re: The Ingredients of a Productive Monorepo

#237

I love monorepos, but in large organizations they have a counter-intuitive incentive for teams to _not_ allow other teams to depend on them, which can _reduce_ code reuse - the opposite of what some adopters want. This issue is that users of a library can put almost infinite friction on the library. If the library team wants to make a change, they have to update all the use sites, but Hyrum's Law will get you because…

All software with dependencies needs to respect it's dependents. A monorepo doesn't really change anything about the relationship between a library and it's users, except that the library or the users are somewhat more empowered to change each other.

Re: The Ingredients of a Productive Monorepo

#238
post #79

The article links to a site with this definition: > A monorepo is a single repository containing multiple distinct projects, with well-defined relationships. It would be better if there were terms that delineated "one repo for the company" from "one repo per project" from "many repos for a single project".

I think most monorepo advocates are actually anti "one repo per project" at heart. That's the real anti-pattern imo.

Re: The Ingredients of a Productive Monorepo

#239

I established monorepos for the last two large projects I operated. I’ve never heard such nice compliments from contributors in my whole career. It seems not only can it be a productivity booster but people genuinely love when things are easy to grok and painless. Multiple large monorepos in an organization are highly valuable imo, and should become more of a thing over time.

Why multiple manyrepos over a single monorepo?

Re: The Ingredients of a Productive Monorepo

#240
post #30

I've been very happy with nix. I've been using nix in the reciperium.com monorepo, granted, it's only me, but I'm quite happy with having everything there. From docs, to the infra with terraform, to frontend and backend. The procedure for the CI is quite straightforward (nix build .#project), and caching the dependencies in the CI works quite okay. Even the secrets are there, encrypted using age (might not be the bes…

Nix is great until you're rebuilding multiple packages that are slow to build without incrementality (eg. C++ or Rust).
Post reply on HN