A monorepo is a version control strategy where multiple projects are stored in a single repository.
I've noticed that some developers have a negative perception of monorepos due to past struggles with complex, inflexible, and hard-to-scale projects. However, this is perhaps because they are equating monorepos with monolithic architectures ('balls of mud'), and they were not employing modern build tools and processes.
Monorepo Means Monolith (Wrong)
Monorepos can organise all types of software architecture, such as microservices, not just monoliths. Using multiple programming languages and frameworks within the same repo is possible, too, if you use the right configuration and folder structure.
Remember, monorepos don't create coupled code; developers do. Monorepos don't dictate architecture either; developers do.
Monorepos Mean Bad Developer Experience (Wrong)
With all code stored in the same place, it is more effortless for developers to find, review, and collaborate on code, leading to more consistency and easier search, sharing and reuse of code across applications. It also makes it easier to manage and update dependencies. Monorepos also allow you to see the entire project's history from one place, which can be very useful.
Monorepos Are Hard To Test (Wrong)
A monorepo can actually facilitate better testing and quality assurance. With all of a company's code in a single repository, it's easier to run comprehensive tests across the entire codebase.
Additionally, having all the code in one place also can make it easier to identify and fix issues. For example, if a developer changes one component, then it's immediately obvious if it breaks another part of the system. When projects are kept in separate repositories, you won't discover something is broken until much later (once you've built and pulled the new package or once you've deployed the application).
***
It's worth noting that monorepos have challenges, such as the potential for longer build times, difficulty managing access to large codebases and more complicated build configuration. But with the right tools and practices in place, these difficulties can be overcome, and the benefits of monorepos can be fully realised.
Comments