Fireship · @fireship

Monorepos - How the Pros Scale Huge Software Projects // Turborepo vs Nx

Uploaded December 13, 2021 · Length 9:07

Monorepos - How the Pros Scale Huge Software Projects // Turborepo vs Nx

Summary

A tutorial on monorepos, comparing Turborepo and Nx, and how to scale huge software projects like Google's.

  • monorepos
  • turborepo
  • nx
  • software development
  • scalability
  • google monorepo
  • dependency management

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    a software company like google maintains

  2. 0:02

    a lot of code like seriously a lot like

  3. 0:04

    over 2 billion lines of code and nearly

  4. 0:06

    100 terabytes of data to go along with

  5. 0:08

    it it's a scale that's hard to even

  6. 0:10

    comprehend like all the stars in the

  7. 0:11

    universe or all the universes in the

  8. 0:13

    multiverse and you have thousands of

  9. 0:14

    engineers around the world working on it

  10. 0:16

    simultaneously but get this they store

  11. 0:18

    all their code in a single monolithic

  12. 0:20

    repository and they've been doing it

  13. 0:22

    since the very beginning today google's

  14. 0:24

    monorepo is likely the largest code base

  15. 0:26

    in the world but it takes an

  16. 0:27

    extraordinary effort to scale they have

  17. 0:29

    their own homegrown version control

  18. 0:30

    system and a highly advanced build tool

  19. 0:32

    called bazel which goes by the much

  20. 0:33

    cooler name of blaze internally in

  21. 0:35

    today's video you'll learn everything

  22. 0:37

    you ever wanted to know about mono repos

  23. 0:39

    and how you the humble javascript

  24. 0:41

    developer can build a high performance

  25. 0:42

    mono repo in your garage if you're new

  26. 0:44

    here like and subscribe we're so close

  27. 0:45

    to 1 million and if you hit the button

  28. 0:47

    right now we might even make it there by

  29. 0:48

    christmas you may have heard some

  30. 0:50

    exciting news last week that vercell

  31. 0:51

    acquired a company called turbo repo

  32. 0:53

    it's a build tool written in go that

  33. 0:55

    makes it really easy to manage multiple

  34. 0:57

    apps and packages in a single git

  35. 0:59

    repository but first let's answer the

  36. 1:01

    question of why would i want to use a

  37. 1:03

    mono repo there are many reasons but at

  38. 1:05

    the highest level it gives you

  39. 1:06

    visibility of your company's entire code

  40. 1:08

    base without the need to track down and

  41. 1:10

    clone a bunch of different repos in

  42. 1:12

    addition it provides consistency because

  43. 1:14

    you can share things like your eslint

  44. 1:16

    config a ui library of web components

  45. 1:18

    for your design system utility libraries

  46. 1:20

    documentation and so on the real power

  47. 1:23

    though comes in the form of dependency

  48. 1:24

    management imagine somebody makes a

  49. 1:26

    breaking change to a shared library all

  50. 1:28

    affected applications will know

  51. 1:30

    instantly and monorepo tools can

  52. 1:31

    actually help you visualize the entire

  53. 1:33

    dependency graph of your software when

  54. 1:35

    it comes to third party dependencies a

  55. 1:37

    mono repo can dedupe packages that are

  56. 1:39

    used in multiple apps a mono repo is

  57. 1:41

    also ideal for continuous integration

  58. 1:43

    and automation because your code is

  59. 1:45

    already unified by default making it

  60. 1:47

    much easier to build and test everything

  61. 1:49

    together but there is one big problem

  62. 1:51

    with monorepos and that's the fact that

  63. 1:53

    they're big as the monorepo becomes

  64. 1:55

    larger there are more things to test

  65. 1:57

    more things to build and a lot more

  66. 1:58

    artifacts to store as a result vs code