Monorepo For Beginners

Taming chaos

Mono vs multi

Multirepos downsides: — No one view of the complete system — Changes require writing to multiple repositories — Tedious stakeholder management

Monorepo upsides: — A complete view of the entire system — One repository is easy to watch and manage — Uniform standards across projects

All glory to the monorepo?

Monorepo downsides: — Grows very large (in size and complexity) — Discipline and processes are required — Tedious access management

Azure DevOps and Github provide ways to prohibit unapproved code from merging, so making pipeline runs mandatory is essential to keep the quality high. Branching policies protect mainline branches from direct edits.

As a developer, pull/merge requests are a great way to make sure you didn’t miss anything and to learn about alternative solutions to yours. Embrace the feedback!

A closer look at the monorepo in practice

Sample folder structure in monorepo

Code, merge, release, repeat

Using a feature branch following GitFlow approach

In Azure DevOps, use branching policy to prohibit direct access to these branches. Set up DevOps pipelines to create immutable, repeatable, and tested deployments and identify them by the latest commit hash or (Git) tag.

Automation

Automated interdependencies make it almost impossible to quickly fix a problem or try out something within the codebase.

File and repository sizes

Wrapping it up

--

--

Senior Software Engineer at Microsoft working on Azure Services and Spatial Computing for enterprise customers around the world.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store