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

Break the Monolith!

Break the Monolith!

If you have a large monolith, built over many years and supported by multiple teams, delivering ambitious features, moving to the cloud or migrating to modern technologies are hard challenges.
A great way to approach that challenge is through a judicious and progressive modularization of the components, teams and products. But such an approach is not self-evident: How to cut judiciously, and at what pace? How to manage the inevitable interactions between the parts? How to preserve the objectives of the organization as a whole despite the division? What are the pitfalls to avoid, and what are the opportunities?

This session will provide pragmatic answers based on several years of practice with numerous companies, on top of the state of the art, and all this with a vision of architecture that bridges the gap between the technical, social and business challenges.

Cyrille Martraire

February 08, 2023
Tweet

More Decks by Cyrille Martraire

Other Decks in Programming

Transcript

  1. SINCE 1999 CYRILLE MARTRAIRE @CYRIUX @AROLLAFR CO-FOUNDER & CTO AROLLA

    DEVELOPER, CONSULTANT, TRAINER FOUNDER PARIS SOFTWARE CRAFTERS SPEAKER & AUTHOR
  2. WHY BREAKING A MONOLITH? TOO BIG FOR ONE TEAM TOO

    BIG TO SCALE WELL TOO BIG FOR THE CLOUD SCALING TEAMS SCALING RUNTIME CLOUD-FRIENDLY
  3. WHY BREAKING A MONOLITH? TOO BIG TO REWRITE TOO BIG

    TO FIT IN YOUR HEAD PROGRESSIVE MODERNIZATION BETTER IMPACT ANALYSIS
  4. @CYRIUX GRANULAR MODERNIZING @CYRIUX partial rewrite TOO BIG TO REWRITE

    partial rewrite partial rewrite partial rewrite
  5. @CYRIUX HUMAN-SIZED @CYRIUX small TOO BIG TO FIT IN YOUR

    HEAD small small small #less-to-learn #fewer bugs
  6. Payment Event Anomaly Agent Transaction Transaction Status Account Basket Items

    Recent Baskets Shopping Cart Payment Payment Fraud Detection
  7. Payment Event Anomaly Agent Transaction Transaction Status Account Basket Items

    Recent Baskets Shopping Cart Payment Payment Fraud Detection purpose = be Paid purpose = Sell purpose = Avoid loss
  8. @CYRIUX Focus on the purpose @CYRIUX Sub-domain names as verbs

    made into nouns: often end in -ing or -tion or -ment
  9. THE SAME THING IN THE REAL WORLD (EG A CUSTOMER)

    FOR DIFFERENT PURPOSES BECOMES DIFFERENT THINGS
  10. Pre-Negotiation Listing) B2BOrdering Fraud Détection Payment Sourcing Distribution Rates Grid

    RealTime Prices Gift Cards Content & Comparators Sales Promotion Acquisition TV Campaigns Online Ads Company Rating Product Reviews Shopping Cart Catalogue Search Categories Tags Partnerships Secondary Listing Internal Purchasing Rates CrossSales Navigation SEO Marketing MAPPING THE POTENTIAL BOUNDED CONTEXTS
  11. Sub-Domain A sub-sub domain A1 sub-sub domain B1 sub-sub domain

    C1 Domain Sub-Domain B Sub-Domain C sub-sub domain A2 sub-sub domain C2 Customers Experience X1 Customers Experience X2 Customers Experience X3 Generic enabler Audience Experiences Business (Sub)- Domains Domain- agnostic Enablers Collaborators Experience X4 Very specific Generic Specific audience Domain- Specific Domain- Agnostic Volatile Stable MAPPING THE POTENTIAL BOUNDED CONTEXTS
  12. Sub-Domain A sub-sub domain A1 sub-sub domain B1 sub-sub domain

    C1 Domain Sub-Domain B Sub-Domain C sub-sub domain A2 sub-sub domain C2 Customers Experience X1 Customers Experience X2 Customers Experience X3 Generic enabler Audience Experiences Business (Sub)- Domains Domain- agnostic Enablers Collaborators Experience X4 Very specific Generic Specific audience Domain- Specific Domain- Agnostic Volatile Stable SpringBoot Postgres / Elastic Search RabbitMQ Microservice MODULE = MICROSERVICE (BACKEND)
  13. MODULE = MODULE IN MONOLITH Sub-Domain A sub-sub domain A1

    sub-sub domain B1 sub-sub domain C1 Domain Sub-Domain B Sub-Domain C sub-sub domain A2 sub-sub domain C2 Customers Experience X1 Customers Experience X2 Customers Experience X3 Generic enabler Audience Experiences Business (Sub)- Domains Domain- agnostic Enablers Collaborators Experience X4 Very specific Generic Specific audience Domain- Specific Domain- Agnostic Volatile Stable Modular Monolith ”Majestic Monolith”
  14. Sub-Domain A sub-sub domain A1 sub-sub domain B1 sub-sub domain

    C1 Domain Sub-Domain B Sub-Domain C sub-sub domain A2 sub-sub domain C2 Customers Experience X1 Customers Experience X2 Customers Experience X3 Generic enabler Audience Experiences Business (Sub)- Domains Domain- agnostic Enablers Collaborators Experience X4 Very specific Generic Specific audience Domain- Specific Domain- Agnostic Volatile Stable Node.js Elastic Search RabbitMQ BFF MODULE = FRONT MICROSERVICE (BFF)
  15. Sub-Domain A sub-sub domain A1 sub-sub domain B1 sub-sub domain

    C1 Domain Sub-Domain B Sub-Domain C sub-sub domain A2 sub-sub domain C2 Customers Experience X1 Customers Experience X2 Customers Experience X3 Generic enabler Audience Experiences Business (Sub)- Domains Domain- agnostic Enablers Collaborators Experience X4 Very specific Generic Specific audience Domain- Specific Domain- Agnostic Volatile Stable (Function) (Function) (Function) Serverless store Serverless bus FaaS / BaaS / SaaS MODULE = FUNCTIONS / SERVERLESS SERVICES
  16. Mapping the Potential Bounded Contexts Sub-Domain A sub-sub domain A1

    sub-sub domain B1 sub-sub domain C1 Domain Sub-Domain B Sub-Domain C sub-sub domain A2 sub-sub domain C2 Customers Experience X1 Customers Experience X2 Customers Experience X3 Generic enabler Audience Experiences Business (Sub)- Domains Domain- agnostic Enablers Collaborators Experience X4 Very specific Generic Specific audience Domain- Specific Domain- Agnostic Volatile Stable legacy components not aligned (at all)
  17. @CYRIUX GUIDING DELIVERY PROJECTS @CYRIUX Don’t split for the sake

    of it. Split Opportunistically when needed. Never fully done.
  18. Event Bus / Observer pattern Ticke t Booked Bookin g

    Service Bookin g Confirmed Inventor y Service Bookin g Cancelled Capacit y Updated Ticketin g Service CHANGE IN ONLY 1 PLACE
  19. Event Bus / Observer pattern Ticke t Booked Bookin g

    Service Bookin g Confirmed Inventor y Service Bookin g Cancelled Capacit y Updated Ticketin g Service Notificatio n Service CHANGE IN ONLY 1 PLACE
  20. Event Bus / Observer pattern Ticke t Booked Bookin g

    Service Bookin g Confirmed Inventor y Service Bookin g Cancelled Capacit y Updated Ticketin g Service CHANGE IN ONLY 1 PLACE
  21. HIGH-LEVEL ALIGNMENT OWN INTELLIGENCE + LOCAL KNOWLEDGE TO ACT COMPANY

    VISION & GOALS HIGH- LEVEL STRATEGY (HIGH LEVEL)
  22. @CYRIUX @CYRIUX TDD, BDD, DDD, 90+ COVERAGE LOCAL OPTIONS CHANGE

    CHEAP, 40% TESTS FROM NOW ON KEEP AS-IS, TEST MANUALLY AS USUAL
  23. @cyriux @arollafr Fraud Détection Payment Gift Cards n mpany ting

    Review Shopping Cart EVENT-SOURCED HEXAGONAL ARCHITECTURE CRUD SaaS
  24. @cyriux @arollafr Fraud Détection Payment Gift Cards n mpany ting

    Review Shopping Cart POstgres POSTGRES S3+RDS Elastic
  25. @cyriux @arollafr Fraud Détection Payment Gift Cards n mpany ting

    Review Shopping Cart Azure API APP on-premise Azure/WEbapp SaaS Azure FUNCTIONS Azure ML
  26. @cyriux @arollafr Fraud Détection Payment Gift Cards n mpany ting

    Review Shopping Cart REWRITE outsource KEEP AS-IS KEEP EXTRACT EXTRACT AS LIB
  27. REPORTING À LA MAP-REDUCE REDUCE MAP MAP MAP MAP REDUCE

    REDUCE REDUCE REDUCE LOCALLY COMPUTED LOCAL METRICS AGREGATED GLOBAL METRICS
  28. BOUNDED CONTEXTS IN A VALUE CHAIN Sub-Domain A sub-sub domain

    A1 sub-sub domain B1 sub-sub domain C1 Domain Sub-Domain B Sub-Domain C sub-sub domain A2 sub-sub domain C2 Customers Experience X1 Customers Experience X2 Customers Experience X3 Generic enabler Domain- agnostic Enablers Collaborators Experience X4 Very specific Generic Specific audience Domain- Specific Domain- Agnostic Volatile Stable Self-care ratio Conversion rate acquisition cost Average Basket Amount Turnover = Traffic x conversion rate x average basket