A lot of projects actually interdepend on each other within the organization. So a common example is your design system. I don't know when this trend started, but at some point of time, every company wanted their own design system. They're like, no, I'm not going to use maybe ShadC and UI, or maybe Material UI. We will build our own because we are unique. I don't know who is unique. And then shared libraries, right? You have some code which is actually shared across multiple projects, and you say, oh, where should I put this code? So okay, let's create a shared library. And we put it there. Need for atomic changes. I think this is one of the things which at Selonis, we were struggling a lot. We used to make change in one small library, update it at 30 places, and now two apps broke. So our commits actually have scattered across now 32 different libraries, or 32 different code bases. So with actually monorepos, you don't see this. You have actually a breaking change, single commit, right? Because what you're changing, and you actually update the entire monorepo with the same change. For example, a simple API change, right? You added a new parameter. Just think about going to 30 code bases just to update a parameter, and being in a monorepo where you know, oh, if I do something, my build will break anyways. And API updates as well. So these are multiple cases where you get the advantage of atomic changes.
So I still have 10 minutes, so I'll go a little bit faster. And large scale refactoring. A simple example can be upgrading your React version, right? So if you have multiple projects with multiple or different React version, and there is a breaking change, it becomes pain to actually upgrade them. Believe me, people actually leave the companies by the time they finish all the migrations. But in monorepos, you can actually do it in a single upgrade, right? And then, strong code reuse culture. We stopped reinventing the wheel, because everyone is using the same code base, so everyone knows what's happening. And interconnected products, for example, micro frontend and shared backends. This is also one use case where you can actually just go ahead and use monorepos. Why team loves monorepo? I mean, at Selonis, we started from scratch. So we started, like, onboarding, talking to teams, and then started onboarding all of them. Initially, they were resistant, as anyone would be. But once they saw, like, we are now sharing more code, and we have more reusable code, they said, like, okay, that's absolutely fine.
Comments