Monorepo Build Systems

Hermetic builds, dependency graphs, remote caching, incremental rebuilds. How Google, Meta, Microsoft, Vercel keep monorepos fast.

Overview

What a monorepo is

A monorepo is a single repository containing multiple projects: services, libraries, frontends. The pattern is mainstream. Google's monorepo is the canonical extreme (~2 billion lines, multi-thousand engineers; Potvin and Levenberg, 'Why Google Stores Billions of Lines of Code in a Single Repository,' CACM 2016), and Meta (Mercurial-based), Microsoft (Windows on Git, with VFS for Git) and many product companies use it.

Key concepts

  • Monorepo
  • Hermetic build
  • Build graph / target graph
  • Remote cache
  • Remote execution
  • Affected projects

Interview questions

  • What problem does a monorepo build system solve that pnpm workspaces does not?
  • How does remote caching work, and what does hermeticity have to do with it?
  • When should you choose Bazel over Nx or Turborepo?

Sign up free to read the full topic

More DevOps topics

Start free on Cariara · Coding problems · System design studio