What is a Monorepo

Definition: A monorepo is a standard Version Control System, or VCS (such as Git, Subversion or CVS) repository, which instead of containing just one application or unit of software (applications, libraries, micro services, modules…), contains all the components that a project (or company) needs to operate.

At first glance, it sounds counterintuitive to host more than one unit of software in a single repository, but there are few advantages on having all components stored in the same place:

  • All dependencies are easily within reach, just in a different path
  • Multiple-project changes in a single changeset
  • No more versioning issues between internal modules, all of them are always in sync
  • Easier to share knowledge between teams, their code is just there for you to change

Why then, would you ask, have we typically used single repositories until recently? Well, there are a few reasons also:

  • Code isolation
  • Smaller repository size
  • Access control to the code
  • Higher chance of merge conflicts
  • Easier to deploy

So there are some tradeoffs to using one approach or the other, some of them are greater than others, but also probably harder to grasp.

In this series of posts we will deep down into how to properly structure a monorepo, tools that can help us manage it and challenges that you and your team will face in the transition to a monorepo.

Will the effort be worth it? Subscribe to our feed to figure it out


Image credit: Erzhan Torokulov (https://medium.com/@erzhtor/javascript-monorepo-with-lerna-5729d6242302)