Have you heard this term thrown around but not really sure what it means. Well, let's take a quick introductory look at it.
If you've heard the term "monorepo" and are confused, it's okay. There's actually not that much to it. As the name suggests, it simply means one repo. In a monorepo, all the code for a project and its related items go into one repository.
Guess what!? You're looking at a monorepo (or the result of one) right now! The code for this site is a monorepo. I did this because I was running into issues with example code falling out of date and developers having trouble with it. I don't pay super close attention to those examples, but it's nice that they are in this space with everything else and it can be apparent when there is an issue with one of them.
I still build some projects separately when there is a reason, but I'm slowly bringing more into this repo to make it easier to manage.
At Grouparoo, our main product is a monorepo. But the website is in a separate repo. That was because the two were unrelated — the website isn't the product. But we may change that in the future.
And for a bigger example, here's a great article on Why Google Stores Billions of Lines of Code in a Single Repository. Google's monorepo is believed to be the biggest in the world.
It might seem silly, but a monorepo can have several benefits, including:
The biggest issue I see with monorepos is in their ability to scale, especially when it comes to build tools. If trying to manage dependencies across several projects, it can be time-consuming to make everything work. For me, at my scale with this project, that has yet to be an issue.
Larger teams sometimes run into an issue that there isn't a good way to control access at the project level, since all projects are included in the repo. I haven't worked on a team where that's been an issue.
One last thing before we go. It may be confusing because the terms are so close to one another, but a monorepo is not a monolithic application. A monolithic app is one that contains a front-end and a back-end in the same application. WordPress is a great example of that. The application that is the CMS is also the website itself.
A monolithic application is concerned with how the code runs, while a monorepo is about how the code is stored.