Skip to content

Monorepo

MidasXIV edited this page Dec 10, 2022 · 2 revisions

What is Monorepo.

Single Repository which contains multiple projects/repositories. Netflix, Google, Uber use monorepos.

Main Advantages

  • Easier Collaboration.

    Since everything is in the same place. Usually access to different repositories is blocked for different individuals.

    This can complicate search and discovery of what you are looking for. Searching in Multiple Repos is also easier if you do it via github; Monorepos help searching in a local file system you don't need to use github.

  • Dependency Management.

    Same repository, but can be built separately. No need to pull the dependency; The problem here is everything needs to be rebuild when ever a change is made.

  • Refactoring is easier across Multiple projects.

    APIs are supposed to be backward compatible so chances of refactoring a big project are very little, a new version of API will most likely be re-written.

Disadvantages

  • Git operations are slow.
  • Tight coupling happens.
  • Pipeline issues.

Creating a Monorepo.

  1. Using NX Monorepo.
  • Create a new workspace: npx create-nx-workspace <workspace name>

Clone this wiki locally