Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Modularise a Laravel Monolith Application
Search
Zeshan
March 04, 2024
Programming
160
0
Share
Modularise a Laravel Monolith Application
Zeshan
March 04, 2024
Other Decks in Programming
See All in Programming
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
220
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
150
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
190
NakouPAY説明用
annouim0
0
280
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
230
[RubyKaigi 2026] Require Hooks
palkan
1
250
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
250
Back to the roots of date
jinroq
0
530
AIエージェントで業務改善してみた
taku271
0
550
Agentic Elixir
whatyouhide
0
420
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
280
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
150
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
280
Writing Fast Ruby
sferik
630
63k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
340
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Embracing the Ebb and Flow
colly
88
5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
A designer walks into a library…
pauljervisheath
211
24k
Prompt Engineering for Job Search
mfonobong
0
280
Transcript
MUHAMMAD ZESHAN KHATTAK https://pinkary.com/@zeshan77
Modularising the Monolith LaravelLive Pakistan 2024
SHIP THE PRODUCT TO THE MARKET
BENEFITS OF MONOLITH • Single repository • Single CI/CD pipeline
• Single set of infrastructure • Easy to handle DB transactions
BIG BALL OF MUD • Tight coupling between functionalities •
No domain boundaries • All code is globally accessible • Need to understand the entire codebase
MICROSERVICES User Interface Microservice Microservice Microservice HTTP HTTP
BENEFITS OF MICROSERVICES • Clear boundaries between services • Deployed
independently • Can be scaled independently • Freedom of tech stack
CHALLENGES OF MICROSERVICES • Multiple repositories • Multiple CI/CD pipelines
• Network overhead • Complex cross-service transactions
TECHNICAL DECISIONS ARE ALWAYS TRADE-OFF
OUR GOALS • Maximise teams’ productivity • Scalable architecture
OUR APPROACH • Modularise the monolith • De f ine
domain boundaries
MODULAR MONOLITH Contracts Implementation Tests Contracts Implementation Tests Contracts Implementation
Tests Inventory module Order module Payment module
INCREMENTAL MIGRATION MICROSERVICES Contracts Implementation Tests Contracts Implementation Tests Contracts
Implementation Tests Inventory service Order module Payment module
MICROSERVICES ARE EXPENSIVE TO CHANGE User Interface Microservice Microservice Microservice
HTTP HTTP
MODULAR MONOLITH IS EASIER TO CHANGE Contracts Implementation Tests Contracts
Implementation Tests Contracts Implementation Tests Inventory module Order module Payment module
MODULES & TEAM STRUCTURE Inventory Module Order Module Payment Module
Shipping Module Auth Module
DEFAULT STRUCTURE
MODULAR STRUCTURE
None
COMMUNICATION BETWEEN MODULE
COMMUNICATION THROUGH CONTRACT Module A Module B Downstream Upstream Contract
Implementation
CROSS-MODULE FOREIGN KEY LEADS TO A TIGHT COUPLING Order module
Inventory module Products Cart Items product_id id
HOW CAN WE ENFORCE DOMAIN BOUNDARIES?
STATIC ANALYSIS • Deptrac • De f ine layers based
on PHP classes • De f ine rulesets on layers access • Detect violation of the rulesets • Visualize dependency graph
THANK YOU https://pinkary.com/@zeshan77