SlideShare ist ein Scribd-Unternehmen logo
1 von 41
©
2022
Devops
Institute
CI/CD SKILup Day
Google Uses Monorepo, and I Don't -
Here's Why
Turja Narayan Chaudhuri
Thank You all for being here.
And , a Big Thank You to the DevOps Institute for
hosting this event , and inviting me over .
I hope you all have a wonderful session.
A brief about me -
• Currently , I am working as an Assistant Director,
Cloud Practice at EY (Ernst & Young).
• Before that I led the CCOE ( Cloud
Centre Of Excellence) Team at Accenture.
• I have around 10+ years of IT experience,
working on Public Cloud technologies since 2017.
Expectation management -
• This is not an introductory session on how to get started
with Source control repositories, or Git.
• It is expected that the audience for this session is already
familiar with Git, or any other source control repository
tool.
• This talk is primarily targeted at software developers,
devops architects, and build/release engineers who want
to know more about different repository structures, their
pros and cons, and how to choose between them.
Agenda -
• Section I - An introduction to Monorepo, and
Polyrepo.
• Section II - How does Google do Monorepo.
• Section III - Monorepo vs Polyrepo :
Advantages and Disadvantages.
• Section IV - What or how to choose?
• Section V - Conclusion and moving forward.
•Section I - An introduction
to Monorepo, and
Polyrepo.
• Section II - How does Google do Monorepo.
• Section III - Monorepo vs Polyrepo – Advantages and Disadvantages.
• Section IV - What or how to choose?
• Section V - Conclusion and moving forward.
In version control systems,
a repository is a data
structure that stores
metadata for a set of files or
directory structure.
What is a repository?
Primarily, there
are 2 types or
patterns
when it comes
to repository
structures.
Types/patterns of repo
The way an enterprise/software company organizes
its codebase, normally seems like a trivial topic, but
in reality, it has a huge impact on
- how fast the development teams can make
changes.
- how fast they can get those changes released in
production.
- how well developers can communicate and
collaborate amongst each other.
- how fast engineering can deliver credible
business value to the end users.
But, why should you be interested?
Monorepo and Polyrepo – A high
level view
What is a Monorepo?
• It is a single repository that contains more than one logical
project (e.g. an iOS client and a web-application)
• These projects are most likely unrelated, loosely connected
or can be connected by other means (e.g. via dependency
management tools)
• The repository is large in many ways:
Number of commits
Number of branches and/or tags
Number of files tracked
Size of content tracked (as measured by looking at the
.git directory of the repository)
Sample Monorepo structure
The Monorepo structure consists of a single
code repository with a hierarchical directory
structure that includes several projects.
A proposed structure is defined here, where
each microservice/project/
application can be
owned by different teams.
One single repo
Who uses Monorepo?
• Google uses a homegrown version-control system
to host one large codebase visible to, and used by,
most of the software developers in the company.
• Google's monolithic software repository is used by
95% of its software developers worldwide.
Who uses Monorepo?
• With thousands of commits a week across hundreds of thousands
of files, Facebook’s main source repository is enormous — many
times larger than even the Linux kernel, which checked in at 17
million lines of code and 44,000 files in 2013.
• And while conducting performance tests, the test repository
Facebook used were as follows:
4 million commits
Linear history
~1.3 million files
The size of the .git directory was roughly 15GB
The size of the index file was 191MB
A polyrepo architecture means using multiple
repositories, rather than one repository.
For example, a polyrepo can use a repo for a web app
project, a repo for a mobile app project, and a repo
for a server app project.
Polyrepo is also known as many-repo or multi-repo.
What is a polyrepo?
Sample Polyrepo structure
As you can see, in a polyrepo, each logical
structure of the code, in this case, say
services/domains, get one individual repo.
So, in this case the Monorepo shown earlier has
been broken down into
3 separate
Polyrepo.
One repo for apple
One repo for banana
One repo for grocery
High-level summary of Section I –
2 types of repo structures available today –
Monorepo where you have all projects/products of an
enterprise in a single repo
VS
Polyrepo where you create multiple repositories,
each one dedicated to a project/product/logical
segregation of a product.
• Section I - An introduction to Monorepo, and Polyrepo.
•Section II - How does
Google do Monorepo.
• Section III - Monorepo vs Polyrepo – Advantages and Disadvantages.
• Section IV - What or how to choose?
• Section V - Conclusion and moving forward.
Scale of Google Monorepo
Used by 95% of engineers at Google
,as of 2015 data
It’s way bigger than the Linux Kernel
As of 2015 data,
But why does Google use Monorepo?
Google tools for Monorepo management
High-level summary of Section II –
Google has been able to successfully adopt Monorepo at huge scale,
across billions of lines of code.
While doing that it has enjoyed the benefits that comes with adopting
Monorepo like code reuse, easier dependency management, etc.
But at the same time, to be able to use Monorepo properly across
such a big enterprise, it had to make significant investments,
both time and effort, in its tooling, practices and patterns.
• Section I - An introduction to Monorepo, and Polyrepo.
• Section II - How does Google do Monorepo.
•Section III - Monorepo vs
Polyrepo – Advantages
and Disadvantages.
• Section IV - What or how to choose?
• Section V - Conclusion and moving forward.
• Single source of truth
• Strong collaboration across
teams
• Standard coding, architectural
and testing patterns
• Simplified dependency
management
• Easy refactoring and code reuse
Advantages and
Disadvantages of
Monorepo
• IDE lag
• Git slowdown
• Broken master
• Long build times
• Codebase
complexity
• Tooling
investment
Monorepos are sometimes called
monolithic repositories, but they
should not be confused with monolithic
architecture, which is a
software development practice
for writing self-contained applications.
• Clear/strong ownership
• Smaller code base
• Narrow clones
• Fast build times
• Isolated master breakage.
Advantages and
Disadvantages of Polyrepo
• Integration issues
• Code searching, and
sharing
• Functionality
duplication
• Dependency hell
• Silos
An enterprise view of
Polyrepo
Can I change from Monorepo to Polyrepo and vice-versa?
Yes, you can, and you might have to based on the
state of your application/company from time to
time.
Uber moved from Monorepo to Polyrepo to back
again.
• Section I - An introduction to Monorepo, and Polyrepo.
• Section II - How does Google do Monorepo.
• Section III - Monorepo vs Polyrepo – Advantages and Disadvantages.
•Section IV - What or how
to choose?
• Section V - Conclusion and moving forward.
So, what should I choose?
The answer like many things in
software architecture is -
Monorepo vs Polyrepo
It is very much like – the concept of a glass
being half-empty/ half-full.
This topic, in itself has been a topic of a never-
ending debate, across engineers and software
professionals.
Nowadays, this is more of a subjective choice
that an organization makes and is related to
its engineering team’s toolchain and culture.
Don’t follow big companies blindly
Many times in enterprises, engineers tend to look at big
companies, and try to replicate their practices and patterns,
without understanding the monumental effort that has been
invested in making those initiatives work for them, at scale.
It’s never a good idea to just go with an approach because
Google/Facebook/Twitter said so.
Instead, the enterprise engineering team should try to measure
how the approaches impact the organisation, and then take a
decision that works for them.
• Section I - An introduction to Monorepo, and Polyrepo.
• Section II - How does Google do Monorepo.
• Section III - Monorepo vs Polyrepo – Advantages and Disadvantages.
• Section IV - What or how to choose?
•Section V - Conclusion
and moving forward.
A forward thinking approach
What if we could take the advantages of both
approaches, and try to minimize the
disadvantages, and come up with our own
repo structure, that works for our company,
and our teams.
The ultimate goal is to come up with a repo
structure that facilitates faster development,
and does not get in the way of your
development teams.
You need to strike a delicate
balance between – not storing
everything in a single repo, and
at the same time, keeping the
number of repositories to
manageable level.
Hybrid repo
Any solution should be tailored
for the specific requirements and
needs of the organization.
For example,
- One single Monorepo for all
infrastructure libraries,
cross-SL API, security
baselines, etc
- While individual service and utilities team
will continue to live in their separate
repositories, one per team.
References -
https://www.atlassian.com/git/tutorials/monorepos
https://engineering.fb.com/2014/01/07/core-data/scaling-mercurial-at-
facebook/
https://monorepo.tools/
https://www.youtube.com/watch?v=lV8-1S28ycM
https://eng.uber.com/android-engineering-code-monorepo/
https://www.youtube.com/watch?v=W71BTkUbdqE
https://www.fourtheorem.com/blog/monorepo
https://codeburst.io/monorepos-by-example-part-1-3a883b49047e
https://medium.com/outbrain-engineering/mono-repository-or-poly-repo-
we-go-hybrid-314e1e17a7dd
TurjaChaudhuri-
LinkedIn
Thank you so much !!
©
2022
Devops
Institute
CI/CD SKILup Day
Google Uses Monorepo, and I Don't - Here's Why
Thanks for Watching
Why not continue the conversation in the
Experts Corner?

Weitere ähnliche Inhalte

Ähnlich wie 2022 DOI SKILup Days_Google Uses Monorepo, and I Don't - Here's Why.pptx

Ähnlich wie 2022 DOI SKILup Days_Google Uses Monorepo, and I Don't - Here's Why.pptx (20)

Technology Development in Early Stage Startup Indonesia
Technology Development in Early Stage Startup IndonesiaTechnology Development in Early Stage Startup Indonesia
Technology Development in Early Stage Startup Indonesia
 
Mobile media module part 6 - app development rev-mf
Mobile media module   part 6 - app development rev-mfMobile media module   part 6 - app development rev-mf
Mobile media module part 6 - app development rev-mf
 
10 skills developers should invest in for 2014
10 skills developers should invest in for 201410 skills developers should invest in for 2014
10 skills developers should invest in for 2014
 
AliExpress’ Way to Microservices - microXchg 2017
AliExpress’ Way to Microservices  - microXchg 2017AliExpress’ Way to Microservices  - microXchg 2017
AliExpress’ Way to Microservices - microXchg 2017
 
why google stores billions of lines of code in a single repository
why google stores billions of lines of code in a single repositorywhy google stores billions of lines of code in a single repository
why google stores billions of lines of code in a single repository
 
Engineering Software Products: 10. Devops and code management
Engineering Software Products: 10. Devops and code managementEngineering Software Products: 10. Devops and code management
Engineering Software Products: 10. Devops and code management
 
DevOps: an efficient operating model
DevOps: an efficient operating modelDevOps: an efficient operating model
DevOps: an efficient operating model
 
Cloud Academy Webinar: Recipe for DevOps Success: Capital One Style
Cloud Academy Webinar: Recipe for DevOps Success: Capital One StyleCloud Academy Webinar: Recipe for DevOps Success: Capital One Style
Cloud Academy Webinar: Recipe for DevOps Success: Capital One Style
 
DevOps – Don’t Be Left Behind
DevOps – Don’t Be Left BehindDevOps – Don’t Be Left Behind
DevOps – Don’t Be Left Behind
 
From hello world to goodbye code
From hello world to goodbye codeFrom hello world to goodbye code
From hello world to goodbye code
 
DevOps: The Right Abstraction Level
DevOps: The Right Abstraction LevelDevOps: The Right Abstraction Level
DevOps: The Right Abstraction Level
 
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
 
Mirco hering devops for systems of record final
Mirco hering devops for systems of record finalMirco hering devops for systems of record final
Mirco hering devops for systems of record final
 
DevOps and APIs: Great Alone, Better Together
DevOps and APIs: Great Alone, Better Together DevOps and APIs: Great Alone, Better Together
DevOps and APIs: Great Alone, Better Together
 
ERP Unit iii
ERP  Unit   iii ERP  Unit   iii
ERP Unit iii
 
Enterprise DevOps: Crossing the Great Divide with DevOps Training
Enterprise DevOps: Crossing the Great Divide with DevOps TrainingEnterprise DevOps: Crossing the Great Divide with DevOps Training
Enterprise DevOps: Crossing the Great Divide with DevOps Training
 
Advantages and Disadvantages of React Native App Development
Advantages and Disadvantages of React Native App DevelopmentAdvantages and Disadvantages of React Native App Development
Advantages and Disadvantages of React Native App Development
 
10.15.2014 dallas ws_brian_d_dn_live workshop enterpise agility_cust
10.15.2014 dallas ws_brian_d_dn_live workshop enterpise agility_cust10.15.2014 dallas ws_brian_d_dn_live workshop enterpise agility_cust
10.15.2014 dallas ws_brian_d_dn_live workshop enterpise agility_cust
 
No Code is the Future of Software –How can they add value in 2022.pptx
No Code is the Future of Software –How can they add value in 2022.pptxNo Code is the Future of Software –How can they add value in 2022.pptx
No Code is the Future of Software –How can they add value in 2022.pptx
 
server to cloud: converting a legacy platform to an open source paas
server to cloud:  converting a legacy platform to an open source paasserver to cloud:  converting a legacy platform to an open source paas
server to cloud: converting a legacy platform to an open source paas
 

Mehr von Turja Narayan Chaudhuri

Mehr von Turja Narayan Chaudhuri (12)

ADDO_2022_Turja_Your developers decide your security posture , not your secur...
ADDO_2022_Turja_Your developers decide your security posture , not your secur...ADDO_2022_Turja_Your developers decide your security posture , not your secur...
ADDO_2022_Turja_Your developers decide your security posture , not your secur...
 
SUSECON Digital 22 Scale your CICD setup for Cloud Native microservices via I...
SUSECON Digital 22 Scale your CICD setup for Cloud Native microservices via I...SUSECON Digital 22 Scale your CICD setup for Cloud Native microservices via I...
SUSECON Digital 22 Scale your CICD setup for Cloud Native microservices via I...
 
SUSECON Digital 22 Enterprise-Wide Kubernetes Adoption - Principles, Practice...
SUSECON Digital 22 Enterprise-Wide Kubernetes Adoption - Principles, Practice...SUSECON Digital 22 Enterprise-Wide Kubernetes Adoption - Principles, Practice...
SUSECON Digital 22 Enterprise-Wide Kubernetes Adoption - Principles, Practice...
 
OrteliusMicroserviceVisionaries2022_Why do you need a microservice catalog to...
OrteliusMicroserviceVisionaries2022_Why do you need a microservice catalog to...OrteliusMicroserviceVisionaries2022_Why do you need a microservice catalog to...
OrteliusMicroserviceVisionaries2022_Why do you need a microservice catalog to...
 
2022 DOI SKILup Days_Your Developers Decide Your Security Posture_Not Your Se...
2022 DOI SKILup Days_Your Developers Decide Your Security Posture_Not Your Se...2022 DOI SKILup Days_Your Developers Decide Your Security Posture_Not Your Se...
2022 DOI SKILup Days_Your Developers Decide Your Security Posture_Not Your Se...
 
DevSecOps in the Cloud from the Lens of a Well-Architected Framework.pptx
DevSecOps in the Cloud from the Lens of a  Well-Architected Framework.pptxDevSecOps in the Cloud from the Lens of a  Well-Architected Framework.pptx
DevSecOps in the Cloud from the Lens of a Well-Architected Framework.pptx
 
Agile Architecture and NFR in a Cloud Native Design.pptx
Agile Architecture and NFR in a Cloud Native Design.pptxAgile Architecture and NFR in a Cloud Native Design.pptx
Agile Architecture and NFR in a Cloud Native Design.pptx
 
Cloud lunchn learn_howtobecomeacloudarchitect_part3
Cloud lunchn learn_howtobecomeacloudarchitect_part3Cloud lunchn learn_howtobecomeacloudarchitect_part3
Cloud lunchn learn_howtobecomeacloudarchitect_part3
 
Cloud lunchn learn_howtobecomeacloudarchitect_part2
Cloud lunchn learn_howtobecomeacloudarchitect_part2Cloud lunchn learn_howtobecomeacloudarchitect_part2
Cloud lunchn learn_howtobecomeacloudarchitect_part2
 
Enterprise-Wide Kubernetes Adoption - Principles, Practices and Processes
Enterprise-Wide Kubernetes Adoption - Principles, Practices and ProcessesEnterprise-Wide Kubernetes Adoption - Principles, Practices and Processes
Enterprise-Wide Kubernetes Adoption - Principles, Practices and Processes
 
Cloud lunchn learn_howtobecomeacloudarchitect_part1
Cloud lunchn learn_howtobecomeacloudarchitect_part1Cloud lunchn learn_howtobecomeacloudarchitect_part1
Cloud lunchn learn_howtobecomeacloudarchitect_part1
 
Agile architectures in a modern cloud-native ecosystem
Agile architectures in a modern cloud-native ecosystemAgile architectures in a modern cloud-native ecosystem
Agile architectures in a modern cloud-native ecosystem
 

Kürzlich hochgeladen

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Kürzlich hochgeladen (20)

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 

2022 DOI SKILup Days_Google Uses Monorepo, and I Don't - Here's Why.pptx

  • 1. © 2022 Devops Institute CI/CD SKILup Day Google Uses Monorepo, and I Don't - Here's Why Turja Narayan Chaudhuri
  • 2. Thank You all for being here. And , a Big Thank You to the DevOps Institute for hosting this event , and inviting me over . I hope you all have a wonderful session.
  • 3. A brief about me - • Currently , I am working as an Assistant Director, Cloud Practice at EY (Ernst & Young). • Before that I led the CCOE ( Cloud Centre Of Excellence) Team at Accenture. • I have around 10+ years of IT experience, working on Public Cloud technologies since 2017.
  • 4. Expectation management - • This is not an introductory session on how to get started with Source control repositories, or Git. • It is expected that the audience for this session is already familiar with Git, or any other source control repository tool. • This talk is primarily targeted at software developers, devops architects, and build/release engineers who want to know more about different repository structures, their pros and cons, and how to choose between them.
  • 5. Agenda - • Section I - An introduction to Monorepo, and Polyrepo. • Section II - How does Google do Monorepo. • Section III - Monorepo vs Polyrepo : Advantages and Disadvantages. • Section IV - What or how to choose? • Section V - Conclusion and moving forward.
  • 6.
  • 7. •Section I - An introduction to Monorepo, and Polyrepo. • Section II - How does Google do Monorepo. • Section III - Monorepo vs Polyrepo – Advantages and Disadvantages. • Section IV - What or how to choose? • Section V - Conclusion and moving forward.
  • 8. In version control systems, a repository is a data structure that stores metadata for a set of files or directory structure. What is a repository?
  • 9. Primarily, there are 2 types or patterns when it comes to repository structures. Types/patterns of repo
  • 10. The way an enterprise/software company organizes its codebase, normally seems like a trivial topic, but in reality, it has a huge impact on - how fast the development teams can make changes. - how fast they can get those changes released in production. - how well developers can communicate and collaborate amongst each other. - how fast engineering can deliver credible business value to the end users. But, why should you be interested?
  • 11. Monorepo and Polyrepo – A high level view
  • 12. What is a Monorepo? • It is a single repository that contains more than one logical project (e.g. an iOS client and a web-application) • These projects are most likely unrelated, loosely connected or can be connected by other means (e.g. via dependency management tools) • The repository is large in many ways: Number of commits Number of branches and/or tags Number of files tracked Size of content tracked (as measured by looking at the .git directory of the repository)
  • 13. Sample Monorepo structure The Monorepo structure consists of a single code repository with a hierarchical directory structure that includes several projects. A proposed structure is defined here, where each microservice/project/ application can be owned by different teams. One single repo
  • 14. Who uses Monorepo? • Google uses a homegrown version-control system to host one large codebase visible to, and used by, most of the software developers in the company. • Google's monolithic software repository is used by 95% of its software developers worldwide.
  • 15. Who uses Monorepo? • With thousands of commits a week across hundreds of thousands of files, Facebook’s main source repository is enormous — many times larger than even the Linux kernel, which checked in at 17 million lines of code and 44,000 files in 2013. • And while conducting performance tests, the test repository Facebook used were as follows: 4 million commits Linear history ~1.3 million files The size of the .git directory was roughly 15GB The size of the index file was 191MB
  • 16. A polyrepo architecture means using multiple repositories, rather than one repository. For example, a polyrepo can use a repo for a web app project, a repo for a mobile app project, and a repo for a server app project. Polyrepo is also known as many-repo or multi-repo. What is a polyrepo?
  • 17. Sample Polyrepo structure As you can see, in a polyrepo, each logical structure of the code, in this case, say services/domains, get one individual repo. So, in this case the Monorepo shown earlier has been broken down into 3 separate Polyrepo. One repo for apple One repo for banana One repo for grocery
  • 18. High-level summary of Section I – 2 types of repo structures available today – Monorepo where you have all projects/products of an enterprise in a single repo VS Polyrepo where you create multiple repositories, each one dedicated to a project/product/logical segregation of a product.
  • 19. • Section I - An introduction to Monorepo, and Polyrepo. •Section II - How does Google do Monorepo. • Section III - Monorepo vs Polyrepo – Advantages and Disadvantages. • Section IV - What or how to choose? • Section V - Conclusion and moving forward.
  • 20. Scale of Google Monorepo Used by 95% of engineers at Google ,as of 2015 data
  • 21. It’s way bigger than the Linux Kernel As of 2015 data,
  • 22. But why does Google use Monorepo?
  • 23. Google tools for Monorepo management
  • 24. High-level summary of Section II – Google has been able to successfully adopt Monorepo at huge scale, across billions of lines of code. While doing that it has enjoyed the benefits that comes with adopting Monorepo like code reuse, easier dependency management, etc. But at the same time, to be able to use Monorepo properly across such a big enterprise, it had to make significant investments, both time and effort, in its tooling, practices and patterns.
  • 25. • Section I - An introduction to Monorepo, and Polyrepo. • Section II - How does Google do Monorepo. •Section III - Monorepo vs Polyrepo – Advantages and Disadvantages. • Section IV - What or how to choose? • Section V - Conclusion and moving forward.
  • 26. • Single source of truth • Strong collaboration across teams • Standard coding, architectural and testing patterns • Simplified dependency management • Easy refactoring and code reuse Advantages and Disadvantages of Monorepo • IDE lag • Git slowdown • Broken master • Long build times • Codebase complexity • Tooling investment
  • 27. Monorepos are sometimes called monolithic repositories, but they should not be confused with monolithic architecture, which is a software development practice for writing self-contained applications.
  • 28. • Clear/strong ownership • Smaller code base • Narrow clones • Fast build times • Isolated master breakage. Advantages and Disadvantages of Polyrepo • Integration issues • Code searching, and sharing • Functionality duplication • Dependency hell • Silos
  • 29. An enterprise view of Polyrepo
  • 30. Can I change from Monorepo to Polyrepo and vice-versa? Yes, you can, and you might have to based on the state of your application/company from time to time. Uber moved from Monorepo to Polyrepo to back again.
  • 31. • Section I - An introduction to Monorepo, and Polyrepo. • Section II - How does Google do Monorepo. • Section III - Monorepo vs Polyrepo – Advantages and Disadvantages. •Section IV - What or how to choose? • Section V - Conclusion and moving forward.
  • 32. So, what should I choose? The answer like many things in software architecture is -
  • 33. Monorepo vs Polyrepo It is very much like – the concept of a glass being half-empty/ half-full. This topic, in itself has been a topic of a never- ending debate, across engineers and software professionals. Nowadays, this is more of a subjective choice that an organization makes and is related to its engineering team’s toolchain and culture.
  • 34. Don’t follow big companies blindly Many times in enterprises, engineers tend to look at big companies, and try to replicate their practices and patterns, without understanding the monumental effort that has been invested in making those initiatives work for them, at scale. It’s never a good idea to just go with an approach because Google/Facebook/Twitter said so. Instead, the enterprise engineering team should try to measure how the approaches impact the organisation, and then take a decision that works for them.
  • 35. • Section I - An introduction to Monorepo, and Polyrepo. • Section II - How does Google do Monorepo. • Section III - Monorepo vs Polyrepo – Advantages and Disadvantages. • Section IV - What or how to choose? •Section V - Conclusion and moving forward.
  • 36. A forward thinking approach What if we could take the advantages of both approaches, and try to minimize the disadvantages, and come up with our own repo structure, that works for our company, and our teams. The ultimate goal is to come up with a repo structure that facilitates faster development, and does not get in the way of your development teams.
  • 37. You need to strike a delicate balance between – not storing everything in a single repo, and at the same time, keeping the number of repositories to manageable level.
  • 38. Hybrid repo Any solution should be tailored for the specific requirements and needs of the organization. For example, - One single Monorepo for all infrastructure libraries, cross-SL API, security baselines, etc - While individual service and utilities team will continue to live in their separate repositories, one per team.
  • 41. © 2022 Devops Institute CI/CD SKILup Day Google Uses Monorepo, and I Don't - Here's Why Thanks for Watching Why not continue the conversation in the Experts Corner?