Save 37% off PRO during our Black Friday Sale! »

A Monorepo vs Manyrepos

A Monorepo vs Manyrepos

9a22d09f92d50fa3d2a16766d0ba52f8?s=128

Fabien Potencier

April 25, 2016
Tweet

Transcript

  1. A Monolith Repository vs Many Repositories F A B I

    E N P O T E N C I E R @ F A B P O T
  2. A Monorepo vs Manyrepos F A B I E N

    P O T E N C I E R @ F A B P O T
  3. The monorepo https://github.com/symfony/symfony Bridge/ 5 sub-projects Bundle/ 5 sub-projects Component/

    33 independent sub-projects like Asset, Cache, CssSelector, Finder, Form, HttpKernel, Ldap, Routing, Security, Serializer, Templating, Translation, Yaml, ... 43 projects, 25 000 commits, and 400 000 LOC
  4. The monorepo Agent PHP extension Signify Chrome Extension PHP SDK

    Player Docs Book Go C C JavaScript PHP PHP ReST ReST
  5. Development vs Distribution

  6. Monolith Repository ≠ Tightly coupled code

  7. Monorepos are
 awesome Make large
 backward incompatible changes easily...
 especially

    if they span
 different parts of the project
  8. Monorepos are
 awesome Old APIs can be removed with confidence

  9. Monorepos are
 awesome Change an API endpoint code
 and all

    its usages in all projects
 in one pull request
  10. Monorepos are
 awesome Code review are easier
 no manual coordination

    between multiple repos
  11. Monorepos are
 awesome Easy continuous integration for changes spanning several

    projects
  12. Monorepos are
 awesome Productivity increases

  13. Monorepos are
 awesome No switch from one repo to the

    next
 depending on which part of the codebase
 you are working on
  14. Monorepos are
 awesome Collaboration between teams becomes natural

  15. Monorepos are
 awesome Developers can fix bugs in all projects


    Noone owns code
  16. Monorepos are
 awesome Less management, everything is centralized

  17. Monorepos are
 awesome Dependency management is a non-issue, no need

    for version constraints for internal code
  18. Manyrepos are
 awesome

  19. Manyrepos are
 awesome Clean boundaries between projects for free

  20. Manyrepos are
 awesome Code more reusable in other contexts

  21. Manyrepos are
 awesome Access control is easy

  22. Manyrepos are
 awesome Continuous integration might be simpler as well

  23. Working with
 a monorepo and
 manyrepos?

  24. Manyrepos - 43 https://github.com/symfony/asset https://github.com/symfony/console ... https://github.com/symfony/* A monorepo -

    1 https://github.com/symfony/symfony
  25. symfony/symfony src/Symfony/Component/Console CHANGELOG.md Command/ Exception/ LICENSE ... symfony/console CHANGELOG.md Command/

    Exception/ LICENSE ...
  26. git log --oneline origin/2.0 src/Symfony/Component/Console 3be3dde [Console] Fixed comment dc2cc6b

    [Console] fixed input bug when the value of an option is empty (closes #6649, closes #6689) 151f2c1 Revert "merged branch egeloen/f-2.0-terminal-width (PR #6571)" 5157693 merged branch egeloen/f-2.0-terminal-width (PR #6571) f299bd0 [Console] Make getTerminalWith & getTerminalHeight public df5c171 updated license year 2fc41a1 [Console] fixed unitialized properties (closes #5935) 9aec4c8 Show correct class name InputArgument in error message 762649f shows correct class name InputOption in error message git log --oneline origin/2.0 da9d86b [Console] Fixed comment 5aaf6a3 [Console] fixed input bug when the value of an option is empty (closes #6649, closes #6689) efa6379 Revert "merged branch egeloen/f-2.0-terminal-width (PR #6571)" c9511da merged branch egeloen/f-2.0-terminal-width (PR #6571) 47e1ce7 [Console] Make getTerminalWith & getTerminalHeight public f3168bf updated license year fc6e023 [Console] fixed unitialized properties (closes #5935) 29e0ef3 Show correct class name InputArgument in error message 03cec88 shows correct class name InputOption in error message
  27. tree 55adb57 symfony/symfony f299bd0 git ls-tree origin/2.0 src/Symfony/Component/Console

  28. symfony/symfony f299bd0 git ls-tree origin/2.0 src/Symfony/Component/Console symfony/console 47e1ce7 git cat-file

    -p origin/2.0 tree 55adb57
  29. symfony/console 47e1ce7 symfony/symfony f299bd0 55adb57 a463ed5 ade4572 4f33efa 978ac3e

  30. source of thruth "read-only" Code changes Access control Tags CI

    / CD ... ? ... repo repo repo repo repo Manyrepos Read-time sync commits, tags, ... Monorepo PR moves
  31. Splitting
 a monorepo
 to manyrepos git subtree split

  32. ... at scale git subtree split 1 monorepo 43 manyrepos

    5 maintained versions 220 maintained branches
  33. split.sh, a rewrite in Go + libgit2 Initial split From

    hours+ to < 1 minute Incremental splits From minutes+ to < 10ms
  34. split.sh a toolkit to manage mono/many repos

  35. split.sh Pull requests are automatically moved
 from the manyrepos to

    the monorepo
  36. split.sh CI/CD can happen
 from the monorepo
 and/or the manyrepos

  37. split.sh Contractors can have access
 to some manyrepos only

  38. split.sh and much more...

  39. split.sh for Agent PHP extension Signify Chrome Extension PHP SDK

    Player Docs Book Website Go C C JavaScript PHP PHP ReST ReST PHP/Symfony Open-Source Open-Source A contractor works on this part only Independant releases Deployed together
  40. Soon to be released as Open-Source Interested?
 Email me at

    fabien@symfony.com Thank you!