SlideShare une entreprise Scribd logo
1  sur  42
Télécharger pour lire hors ligne
Dana Luther
Packaging the Monolith
Breaking it down “one bite at a time”
@danaluther@phpc.social https://joind.in/talk/5b3d4
“We can’t upgrade because …”
Package it up!
What do we gain?
What do we gain?
•Add support for upgraded PHP Versions package by package
•Test discrete portions of the code via CI/CD pipeline
•Only use the code we actually require in each installation
•Grant access to additional personnel / contractors at the
package level
•Determine which portions of the library are obsolete and no
longer in use
Does this create new
challenges?
Does this create new
challenges?
•Additional repositories to track
•Must implement strict SEMVER
•Additional build pipelines to set up and maintain
•Expense of packagist.com or …
•Complexity of setting up and maintaining Satis
Package it up!
https://packagist.org/
But … public packages?
https://packagist.com/
Can I just host the packages
myself?
Can I just host the packages
myself?
Composer’s documentation on private packages:
https://getcomposer.org/doc/articles/handling-private-
packages-with-satis.md
Or private repositories as package sources:
https://getcomposer.org/doc/05-repositories.md#using-
private-repositories
👍
DIY - Pros and Cons
DIY - Pros and Cons
Direct Repository Links:
• Complete control over access.
• Add and maintain each link in every
project or package that depends on
this package.
• Cannot change the repository source
without updating all references.
Satis:
• Consolidates repo links into a single
source reference.
• Requires scheduled or triggered
builds to recognize new tags.
• Requires hosting the generated
source
fi
le.
“FREE”
How do we do it?
Slowly and carefully!! One component at a time.
Start with discrete components that are easily identi
fi
ed.
Where do we start?
First, map your code
First, map your code
Avoid cyclic dependencies!
Avoid cyclic dependencies!
Where do we start?
•Map out your existing library (if you don’t already have a map)
•Find the smallest building blocks - do those
fi
rst
•Prioritize the modules/components/etc.
•Don’t refactor the logic or upgrade the PHP version yet!
•Update the existing library to leverage each new package as
it’s ready (deprecate and extend).
Create the first package…
Create the first package…
•Create your new repo
•Establish namespace for your package - match your target
class namespaces.
Repo: myCoolAppCore.git
Branch: 1.x
composer.json
Create the first package…
•Create your new repo
•Establish namespace for your package - match your target
class namespaces.
•Branch names and SemVer
•Create your new library folder structure
•Create build pipeline and test suite setup
•Import existing tests!
Create the first package…
•Import your old classes, using the new namespace structure
•Update your tests to reference the new class namespaces
•1.0.0-rc1 tag
Before:
After:
Update the original monolith.
Update the original monolith.
•Require your new package in your original library
•Update the original imported classes
•Mark as deprecated
•Update to extend from the new version (JIC!)
•Add tombstone - You just created a Zombie.
•https://slides.com/andysnell/zombie-hunt
•Update references to the old class to use the new class
Refactoring with Rector
https://getrector.com/about
Rinse … Repeat …
Great … but now what?
New package branch/version!
New package branch/version!
•Create 2.x branch for the package repository
•Update dev-master alias to 2.x-dev
•Update minimum PHP required version to your new target
minimum version (if upgrading)
Repo: myCoolAppCore.git
Branch: 2.x
composer.json
New package branch/version!
•Create 2.x branch for the package repository
•Update dev-master alias to 2.x-dev
•Update minimum PHP required version to your new target
minimum version
•Update test suite to run properly on the new PHP version
•Don’t refactor* the tests!
•Finally … update the codebase to your target PHP version.
Tag it, rinse and repeat again…
Complete? Upgrade the core
requirements.
Questions?
Dana Luther
@danaluther@phpc.social https://joind.in/talk/5b3d4

Contenu connexe

Similaire à Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)

Similaire à Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time) (20)

2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
 
Java developer intro to environment management with vagrant puppet and docker
Java developer intro to environment management with vagrant puppet and dockerJava developer intro to environment management with vagrant puppet and docker
Java developer intro to environment management with vagrant puppet and docker
 
Composer namespacing
Composer namespacingComposer namespacing
Composer namespacing
 
Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development
 
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
 
Create a PHP Library the right way
Create a PHP Library the right wayCreate a PHP Library the right way
Create a PHP Library the right way
 
5. react native-package
5. react native-package5. react native-package
5. react native-package
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
Third party libraries and OSGi - a complicated relationship
Third party libraries and OSGi - a complicated relationshipThird party libraries and OSGi - a complicated relationship
Third party libraries and OSGi - a complicated relationship
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 
Composer
ComposerComposer
Composer
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The Fact
 
Puppet in k8s, Miroslav Hadzhiev
Puppet in k8s, Miroslav HadzhievPuppet in k8s, Miroslav Hadzhiev
Puppet in k8s, Miroslav Hadzhiev
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to Maven
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NL
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
runC – Open Container Initiative
runC – Open Container InitiativerunC – Open Container Initiative
runC – Open Container Initiative
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins world
 
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio StruyfO365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
 

Plus de Dana Luther

Plus de Dana Luther (12)

How to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHPHow to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHP
 
Keep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DIKeep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DI
 
Integrated Feature Management - Using Feature Flags - PHPSerbia
Integrated Feature Management - Using Feature Flags - PHPSerbiaIntegrated Feature Management - Using Feature Flags - PHPSerbia
Integrated Feature Management - Using Feature Flags - PHPSerbia
 
Integrated Feature Management - Using Feature Flags - MidwestPHP
Integrated Feature Management - Using Feature Flags - MidwestPHPIntegrated Feature Management - Using Feature Flags - MidwestPHP
Integrated Feature Management - Using Feature Flags - MidwestPHP
 
Integrated Feature Management - Using Feature Flags - SunshinePHP
Integrated Feature Management - Using Feature Flags - SunshinePHPIntegrated Feature Management - Using Feature Flags - SunshinePHP
Integrated Feature Management - Using Feature Flags - SunshinePHP
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - Cascadia
 
Converting your DEV Environment to a Docker Stack - ZCOE18
Converting your DEV Environment to a Docker Stack - ZCOE18Converting your DEV Environment to a Docker Stack - ZCOE18
Converting your DEV Environment to a Docker Stack - ZCOE18
 
Converting Your DEV Environment to a Docker Stack
Converting Your DEV Environment to a Docker StackConverting Your DEV Environment to a Docker Stack
Converting Your DEV Environment to a Docker Stack
 
Code Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsCode Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application Migrations
 

Dernier

Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
ChloeMeadows1
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
lolsDocherty
 

Dernier (17)

Free scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsFree scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirts
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirts
 
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
 
Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdf
 
Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdf
 
GOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdfGOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdf
 
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
 
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
 
I’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 ShirtI’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 Shirt
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirts
 
The Rise of Subscription-Based Digital Services.pdf
The Rise of Subscription-Based Digital Services.pdfThe Rise of Subscription-Based Digital Services.pdf
The Rise of Subscription-Based Digital Services.pdf
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's Guide
 
AI Generated 3D Models | AI 3D Model Generator
AI Generated 3D Models | AI 3D Model GeneratorAI Generated 3D Models | AI 3D Model Generator
AI Generated 3D Models | AI 3D Model Generator
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of apps
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
 

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)