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
0
130
Modularise a Laravel Monolith Application
Zeshan
March 04, 2024
Tweet
Share
Other Decks in Programming
See All in Programming
The Niche of CDK Grant オブジェクトって何者?/the-niche-of-cdk-what-isgrant-object
hassaku63
1
410
Porting a visionOS App to Android XR
akkeylab
0
640
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
2
14k
ふつうの技術スタックでアート作品を作ってみる
akira888
1
1.1k
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
990
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
96
33k
AI時代の『改訂新版 良いコード/悪いコードで学ぶ設計入門』 / ai-good-code-bad-code
minodriven
21
8.7k
MCPを使ってイベントソーシングのAIコーディングを効率化する / Streamlining Event Sourcing AI Coding with MCP
tomohisa
0
150
“いい感じ“な定量評価を求めて - Four Keysとアウトカムの間の探求 -
nealle
2
11k
코딩 에이전트 체크리스트: Claude Code ver.
nacyot
0
840
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
230
AI コーディングエージェントの時代へ:JetBrains が描く開発の未来
masaruhr
1
200
Featured
See All Featured
Practical Orchestrator
shlominoach
189
11k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
It's Worth the Effort
3n
185
28k
Writing Fast Ruby
sferik
628
62k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
What's in a price? How to price your products and services
michaelherold
246
12k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.6k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Faster Mobile Websites
deanohume
307
31k
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