Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Modularise a Laravel Monolith Application

Avatar for Zeshan Zeshan
March 04, 2024

Modularise a Laravel Monolith Application

Avatar for Zeshan

Zeshan

March 04, 2024
Tweet

Other Decks in Programming

Transcript

  1. BENEFITS OF MONOLITH • Single repository • Single CI/CD pipeline

    • Single set of infrastructure • Easy to handle DB transactions
  2. BIG BALL OF MUD • Tight coupling between functionalities •

    No domain boundaries • All code is globally accessible • Need to understand the entire codebase
  3. BENEFITS OF MICROSERVICES • Clear boundaries between services • Deployed

    independently • Can be scaled independently • Freedom of tech stack
  4. CHALLENGES OF MICROSERVICES • Multiple repositories • Multiple CI/CD pipelines

    • Network overhead • Complex cross-service transactions
  5. MODULAR MONOLITH IS EASIER TO CHANGE Contracts Implementation Tests Contracts

    Implementation Tests Contracts Implementation Tests Inventory module Order module Payment module
  6. CROSS-MODULE FOREIGN KEY LEADS TO A TIGHT COUPLING Order module

    Inventory module Products Cart Items product_id id
  7. 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