SlideShare a Scribd company logo
1 of 82
Download to read offline
Understanding
monorepos
@PhilipJFulcher
@bencabanes nx.dev • nrwl.io powered by
Hi 👋

I’m Benjamin Cabanes
🇨🇦 · 🐬
Javascript Architect @ Nrwl

Nx Core Team
@bencabanes
@PhilipJFulcher
@bencabanes powered by
Hi 👋

I’m Philip Fulcher
🇺🇸 · 🐬
Nx Core Team Member
@philipjfulcher
@PhilipJFulcher
@bencabanes powered by
Why do companies
use monorepos?
@PhilipJFulcher
@bencabanes powered by
SHORT
ANSWER?
@PhilipJFulcher
@bencabanes powered by
Why do companies use
monorepos?
• Manage complexity
• Organization-wide best
practices
• Maximizing shared code
• Consistency & predictability in
code
• Discoverability and
communication
• Foster collaboration
@PhilipJFulcher
@bencabanes powered by
LONG
ANSWER?
@PhilipJFulcher
@bencabanes powered by
Let’s talk about
monorepos…
@PhilipJFulcher
@bencabanes powered by
What is a
monorepo?
@PhilipJFulcher
@bencabanes powered by
A monorepo is a single repository
containing multiple distinct projects,
with well-de
fi
ned relationships.
@PhilipJFulcher
@bencabanes powered by
A monorepo is a single repository
containing multiple distinct projects,
with well-de
fi
ned relationships.
@PhilipJFulcher
@bencabanes powered by
A monorepo is a single repository
containing multiple distinct projects,
with well-de
fi
ned relationships.
@PhilipJFulcher
@bencabanes powered by
@PhilipJFulcher
@bencabanes powered by
You projects in the
same place
• High level view of projects
• Allows collaboration
• Removes assumptions
• Project discoverability
• Code reuse
• Architecture discoverability
@PhilipJFulcher
@bencabanes powered by
@PhilipJFulcher
@bencabanes powered by
✋ Monolith ≠ Monorepo ✋
@PhilipJFulcher
@bencabanes powered by
Monolith & Monorepo are different concepts

A monorepo is about code organization
A monolith is about code linking and particular type of deployment
@PhilipJFulcher
@bencabanes powered by
@PhilipJFulcher
@bencabanes powered by
A monorepo is a single repository
containing multiple distinct projects,
with well-de
fi
ned relationships.
@PhilipJFulcher
@bencabanes powered by
Well-de
fi
ned relationships are
used by tooling to provide
automation & assistance
@PhilipJFulcher
@bencabanes powered by
00
V1
Date
Presentation Subtitle
Presentation Title
@PhilipJFulcher
@bencabanes powered by
Cross-project changes
Architecture awareness
Relationships
are key
Performance with
smart commands
Project graph
Projects discoverability & always
up to date visual representation
Test/build only affected code
Identify relations & contracts
Smart code generation
Adds a smart layer to
project relationships
@PhilipJFulcher
@bencabanes powered by
Smarter tooling
Better DX
Collaboration & Productivity increase
@PhilipJFulcher
@bencabanes powered by
Wait. So what’s wrong
with my polyrepo setup? 🤔
@PhilipJFulcher
@bencabanes powered by
Well, nothing is really
*wrong*. It’s just…
@PhilipJFulcher
@bencabanes powered by
Polyrepos have a high
cost of maintenance.
@PhilipJFulcher
@bencabanes powered by
Polyrepos are dif
fi
cult
to scale.
@PhilipJFulcher
@bencabanes powered by
A common situation
with polyrepos
Let’s share
some code!
@PhilipJFulcher
@bencabanes powered by
Sharing code with
polyrepos
4/ Write the shareable code
5/ CI & CD checks
6/ Deploy & publish to registry
1/ Create repository, setting
permissions, team management
2/ Setup CI & CD (waiting from
IT team)
3/ Setup tooling for build, serve,
lint …
@PhilipJFulcher
@bencabanes powered by
- Write the shared code
Sharing code with
monorepos
- Test consuming projects
directly from where you are.
All changes are done in a single PR
Consumers are all tested (high con
fi
dence)

No externals, faster merge and release
- Use existing code, tooling
@PhilipJFulcher
@bencabanes powered by
Sharing code with
polyrepos
- depends on published artefacts
- Changes, PRs, Code reviews, CI/
CD runs times “n” for each repo
- Takes time to complete and
start using the shared code.
@PhilipJFulcher
@bencabanes powered by
Sharing code with
polyrepos
A: v1.0
B: v1.0 C: v1.0
D: v1.0
A: v1.0
B: v1.0 C: v1.1
B: v1.0 C: v1.1
A: v1.0
B: v1.0 C: v1.1
D: v1.0 D: v1.1
😨
😎 😱
💎The Diam
on
d Dependency Problem 💎
@PhilipJFulcher
@bencabanes powered by
Polyrepos creates silos &
makes collaboration
harder.
@PhilipJFulcher
@bencabanes powered by
It is easy to do the wrong
things when working in
silos.
@PhilipJFulcher
@bencabanes powered by
Polyrepos and monoliths
are pretty common.
@PhilipJFulcher
@bencabanes powered by
@PhilipJFulcher
@bencabanes powered by
The industry has moved to the
polyrepo to get team autonomy.
@PhilipJFulcher
@bencabanes powered by
Autonomy by isolation
harms collaboration.
@PhilipJFulcher
@bencabanes powered by
What about
monorepos then?
@PhilipJFulcher
@bencabanes powered by
Monorepos do
relationships analysis
@PhilipJFulcher
@bencabanes powered by
One version of everything
03
Atomic commit across projects
02
No overhead to create new projects
01
Developer mobility
05
Consistent tooling
04
Monorepos
bene
fi
ts
@PhilipJFulcher
@bencabanes powered by
I can’t use a monorepo.
I do micro frontends. 😏
@PhilipJFulcher
@bencabanes powered by
Again, a common
misconception.
@PhilipJFulcher
@bencabanes powered by
No more assumptions,
all the code is here,
easier to debug with monorepos
@PhilipJFulcher
@bencabanes powered by
A monorepo makes micro-
frontends easier & manageable
@PhilipJFulcher
@bencabanes powered by
If everyone has access to
everything. Then it’s
unmanageable. Right? 😱
@PhilipJFulcher
@bencabanes powered by
Again, a common
misconception.
@PhilipJFulcher
@bencabanes powered by
Polyrepo
code ownership?
No high level overview
No structure
Everyone can depend on everything
Permissions per repository
@PhilipJFulcher
@bencabanes powered by
Monorepo

code ownership
High level overview
Visible structure & enforced by tooling
Clear hierarchy and dependencies
Granular access:
- constraints per import
- constraints per folder
- constraints per project
- custom constraints with tooling
@PhilipJFulcher
@bencabanes powered by
Relationships are key to
monorepos
@PhilipJFulcher
@bencabanes powered by
00
V1
Date
Presentation Subtitle
Presentation Title
Why is Nx the right
tool for your
Monorepo?
@PhilipJFulcher
@bencabanes powered by
Not just code
colocation
@PhilipJFulcher
@bencabanes powered by
Projects
@PhilipJFulcher
@bencabanes powered by
Knowledge Base

feat-knowledge-base
Live Chat

feat-live-chat
Support Tickets
feat-support-tickets
New Ticket
feat-new-ticket
Libraries
Customer Service App
App
@PhilipJFulcher
@bencabanes powered by
- Name
- Path Alias
- Well-de
fi
ned API
Each project
has
@PhilipJFulcher
@bencabanes powered by
cart-ui-components
@PhilipJFulcher
@bencabanes powered by
@myorg/cart/ui-components
@PhilipJFulcher
@bencabanes powered by
@PhilipJFulcher
@bencabanes powered by
Well-De
fi
ned
Relationships
@PhilipJFulcher
@bencabanes powered by
Tags
@PhilipJFulcher
@bencabanes powered by
Module
Boundaries
@PhilipJFulcher
@bencabanes powered by
Microfrontends 😎
@PhilipJFulcher
@bencabanes powered by
Superpowered
Micro Frontends with
Monorepos
@PhilipJFulcher
@bencabanes powered by
Speeding up day-to-
day development
@PhilipJFulcher
@bencabanes powered by
Targets
@PhilipJFulcher
@bencabanes powered by
Testing
@PhilipJFulcher
@bencabanes powered by
Affected Commands
- affected:test
- affected:build
- affected:e2e
@PhilipJFulcher
@bencabanes powered by
Never run the same target
twice.
@PhilipJFulcher
@bencabanes powered by
Nx Cloud
@PhilipJFulcher
@bencabanes powered by
Into the (Nx) Clouds
@PhilipJFulcher
@bencabanes powered by
Atomic Changes
@PhilipJFulcher
@bencabanes powered by
Project
Graph
@PhilipJFulcher
@bencabanes powered by
Affected Commands
- affected:test
- affected:build
- affected:e2e
@PhilipJFulcher
@bencabanes powered by
Experimentation
@PhilipJFulcher
@bencabanes powered by
Generators
@PhilipJFulcher
@bencabanes powered by
Workspace Generators
@PhilipJFulcher
@bencabanes powered by
Keys take away on
monorepos
@PhilipJFulcher
@bencabanes powered by
Monorepos are not just about
code colocation
@PhilipJFulcher
@bencabanes powered by
Well-de
fi
ned relationships between
isolated units of code are essential
@PhilipJFulcher
@bencabanes powered by
Good tools & automation are needed for
a monorepo to scale with the
organization
@PhilipJFulcher
@bencabanes powered by
nx.dev
monorepo.tools
@PhilipJFulcher
@bencabanes powered by

More Related Content

What's hot

'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
OdessaJS Conf
 

What's hot (20)

Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
CICD with Jenkins
CICD with JenkinsCICD with Jenkins
CICD with Jenkins
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Practical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfPractical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdf
 
DevOps - A Gentle Introduction
DevOps - A Gentle IntroductionDevOps - A Gentle Introduction
DevOps - A Gentle Introduction
 
Microservices
MicroservicesMicroservices
Microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Scaling WebRTC applications with Janus
Scaling WebRTC applications with JanusScaling WebRTC applications with Janus
Scaling WebRTC applications with Janus
 
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
 
Devops Devops Devops
Devops Devops DevopsDevops Devops Devops
Devops Devops Devops
 
Introduction to CI/CD
Introduction to CI/CDIntroduction to CI/CD
Introduction to CI/CD
 
DevOps & SRE at Google Scale
DevOps & SRE at Google ScaleDevOps & SRE at Google Scale
DevOps & SRE at Google Scale
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Integration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices ArchitecturesIntegration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices Architectures
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
 
Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1
 
Micro-frontend
Micro-frontendMicro-frontend
Micro-frontend
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 

Similar to Understanding Monorepos

Moving to a DevOps mode - easy, hard or just plain terrifying? - Daniel Bryan...
Moving to a DevOps mode - easy, hard or just plain terrifying? - Daniel Bryan...Moving to a DevOps mode - easy, hard or just plain terrifying? - Daniel Bryan...
Moving to a DevOps mode - easy, hard or just plain terrifying? - Daniel Bryan...
JAXLondon2014
 
Documenting apps ti confnyc
Documenting apps   ti confnycDocumenting apps   ti confnyc
Documenting apps ti confnyc
Jamil Spain
 

Similar to Understanding Monorepos (20)

JAX London 2014 "Moving to DevOps Mode: easy, hard or just plain terrifying?"
JAX London 2014 "Moving to DevOps Mode: easy, hard or just plain terrifying?"JAX London 2014 "Moving to DevOps Mode: easy, hard or just plain terrifying?"
JAX London 2014 "Moving to DevOps Mode: easy, hard or just plain terrifying?"
 
Moving to a DevOps mode - easy, hard or just plain terrifying? - Daniel Bryan...
Moving to a DevOps mode - easy, hard or just plain terrifying? - Daniel Bryan...Moving to a DevOps mode - easy, hard or just plain terrifying? - Daniel Bryan...
Moving to a DevOps mode - easy, hard or just plain terrifying? - Daniel Bryan...
 
I broke what?!??!? Taking over maintenance on well loved projects
I broke what?!??!? Taking over maintenance on well loved projectsI broke what?!??!? Taking over maintenance on well loved projects
I broke what?!??!? Taking over maintenance on well loved projects
 
I broke what? Taking over maintenance on existing (well loved) projects, by B...
I broke what? Taking over maintenance on existing (well loved) projects, by B...I broke what? Taking over maintenance on existing (well loved) projects, by B...
I broke what? Taking over maintenance on existing (well loved) projects, by B...
 
The Latest in DevOps: Elite Performance, Productivity, and Scaling - Google
The Latest in DevOps: Elite Performance, Productivity, and Scaling - GoogleThe Latest in DevOps: Elite Performance, Productivity, and Scaling - Google
The Latest in DevOps: Elite Performance, Productivity, and Scaling - Google
 
DevOps: The Right Abstraction Level
DevOps: The Right Abstraction LevelDevOps: The Right Abstraction Level
DevOps: The Right Abstraction Level
 
Move Fast in the Age of Uncertainty
Move Fast in the Age of UncertaintyMove Fast in the Age of Uncertainty
Move Fast in the Age of Uncertainty
 
GeeCON 2015 DevOps and the dark side
GeeCON 2015 DevOps and the dark side GeeCON 2015 DevOps and the dark side
GeeCON 2015 DevOps and the dark side
 
From hello world to goodbye code
From hello world to goodbye codeFrom hello world to goodbye code
From hello world to goodbye code
 
Vimeo and Open Source (SMPTE Forum 2015)
Vimeo and Open Source (SMPTE Forum 2015)Vimeo and Open Source (SMPTE Forum 2015)
Vimeo and Open Source (SMPTE Forum 2015)
 
FEC2017-Introduction-to-programming
FEC2017-Introduction-to-programmingFEC2017-Introduction-to-programming
FEC2017-Introduction-to-programming
 
DevOps & the Dark Side 10 ways to convince your team DevOps is a force for good
DevOps & the Dark Side 10 ways to convince your team DevOps is a force for goodDevOps & the Dark Side 10 ways to convince your team DevOps is a force for good
DevOps & the Dark Side 10 ways to convince your team DevOps is a force for good
 
2022 DOI SKILup Days_Google Uses Monorepo, and I Don't - Here's Why.pptx
2022 DOI SKILup Days_Google Uses Monorepo, and I Don't - Here's Why.pptx2022 DOI SKILup Days_Google Uses Monorepo, and I Don't - Here's Why.pptx
2022 DOI SKILup Days_Google Uses Monorepo, and I Don't - Here's Why.pptx
 
TiConf NYC - Documenting Your Titanium Applications
TiConf NYC - Documenting Your Titanium ApplicationsTiConf NYC - Documenting Your Titanium Applications
TiConf NYC - Documenting Your Titanium Applications
 
Documenting apps ti confnyc
Documenting apps   ti confnycDocumenting apps   ti confnyc
Documenting apps ti confnyc
 
Rip DevOps (Feb 2019)
Rip DevOps (Feb 2019)Rip DevOps (Feb 2019)
Rip DevOps (Feb 2019)
 
OSDC 2019 | Terraform best practices with examples and arguments by Anton Bab...
OSDC 2019 | Terraform best practices with examples and arguments by Anton Bab...OSDC 2019 | Terraform best practices with examples and arguments by Anton Bab...
OSDC 2019 | Terraform best practices with examples and arguments by Anton Bab...
 
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java applicationOSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
 
Continuous delivery of embedded systems embedded meetup
Continuous delivery of embedded systems   embedded meetupContinuous delivery of embedded systems   embedded meetup
Continuous delivery of embedded systems embedded meetup
 
JUC Europe 2015: Continuous Integration and Distribution in the Cloud with DE...
JUC Europe 2015: Continuous Integration and Distribution in the Cloud with DE...JUC Europe 2015: Continuous Integration and Distribution in the Cloud with DE...
JUC Europe 2015: Continuous Integration and Distribution in the Cloud with DE...
 

Recently uploaded

Recently uploaded (20)

ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 

Understanding Monorepos