Monorepo explained

Do not miss this exclusive book on Binary Tree Problems. Get it now for free.

Reading time: 20 minutes | Coding time: 10 minutes

Monorepo is:

  • A repository contains more than one logical project (e.g. an iOS client and a web-application)
  • These projects are most likely unrelated, loosely connected or can be connected by other means such as a dependency management tool like Bazel
  • The repository is large in many ways: Number of commits, Number of branches and/or tags, Number of files tracked, size of content tracked and many others

One good software design practice is to keep projects modular. If so, why is monorepo still in use?

Advantages of Monorepo

Advantages of Monorepo are:

  • Unified versioning, one source of truth;
  • Extensive code sharing and reuse
  • Simplified dependency management
  • Atomic changes
  • Large-scale refactoring
  • Collaboration across teams
  • Flexible team boundaries and code ownership
  • Code visibility and clear tree structure providing implicit team namespacing

Disadvantages

Disadvantages of Monorepo are:

  • Massive tooling investments for both development and execution
  • Codebase complexity, including unnecessary dependencies and difficulties with code discovery
  • Effort invested in code health

Usage

Monorepo architecture is used by the following great companies: Google, Facebook and Twitter.

Interesting readings

Sign up for FREE 3 months of Amazon Music. YOU MUST NOT MISS.