$30 off During Our Annual Pro Sale. View Details »

How domain-driven design enabled scaling a big ball of mud product

How domain-driven design enabled scaling a big ball of mud product

Kenny will tell the story of how their software development team decoupled their big ball of mud, to several bounded contexts all within the same monolith.

He will present several heuristics, practices, tools and a strategy to decouple the current model while continuously adding features to the product and gaining feedback from the customers.

One of the bigger challenges was that the team had no knowledge of Domain-Driven Design, and Kenny will show you how the team, with their stakeholders started embracing DDD.

Ending up with a strategy to disentangle the model, an idealised bounded context design and monitoring domain events from the bounded context that drove collaboratively drives the product roadmap.

Kenny Baas-Schwegler

September 14, 2023
Tweet

More Decks by Kenny Baas-Schwegler

Other Decks in Technology

Transcript

  1. @kenny_baas
    @[email protected]
    How domain-​
    driven design
    enabled scaling a big ball of mud product
    Photo by National Cancer Institute

    View Slide

  2. @kenny_baas
    @[email protected]
    Agenda
    Once upon a time.....
    Domain-​
    Driven Design 101
    Why understanding the underlying needs of users was crucial
    Collaborative software design and embedding software architecture in the team
    From output to data-​
    driven outcomes through Domain-​
    Driven Design

    View Slide

  3. @kenny_baas
    @[email protected]
    Legend
    user
    (external)
    needs
    user
    (internal)
    Capabilities
    * Simplified map - left out accepting, screening and billing and more...
    Companies with
    blue collar
    workers
    temporary
    employees for
    blue collar jobs
    Students
    age 18-25
    Temporary jobs
    able to work
    next to studying
    Looking for
    a job
    online
    website
    job openings
    database
    Customer
    agreements
    Job
    openings
    Pay
    Custom
    ERP
    Recruiter
    Fulfil jobs for
    customer
    Email
    Applying
    for job
    account
    management
    account
    management

    View Slide

  4. @kenny_baas
    @[email protected]
    * Simplified map - left out accepting, screening and billing and more...
    Legend
    user
    (external)
    needs
    user
    (internal)
    Capabilities
    Companies with
    blue collar
    workers
    temporary
    employees for
    blue collar jobs
    Students
    age 18-25
    Temporary jobs
    able to work
    next to studying
    Looking for
    a job
    online
    website
    job openings
    database
    Customer
    agreements
    Job
    openings
    Pay
    Custom
    ERP
    Recruiter
    Fulfil jobs for
    customer
    Email
    Applying
    for job
    account
    management
    account
    management
    ERP
    Payrolling
    payout
    student

    View Slide

  5. @kenny_baas
    @[email protected]
    * Simplified map - left out accepting, screening and billing and more...
    Student
    18-25 years
    Work single day
    job when money
    is needed
    Company
    Find blue collars
    worker 'last
    minute'
    Legend
    user
    (external)
    needs
    user
    (internal)
    Capabilities
    Companies with
    blue collar
    workers
    temporary
    employees for
    blue collar jobs
    Students
    age 18-25
    Temporary jobs
    able to work
    next to studying
    Looking for
    a job
    online
    website
    job openings
    database
    Customer
    agreements
    Job
    openings
    Pay
    Custom
    ERP
    Recruiter
    Fulfil jobs for
    customer
    Email
    Applying
    for job
    account
    management
    account
    management
    ERP
    Payrolling
    payout
    student

    View Slide

  6. @kenny_baas
    @[email protected]
    Hyper flex
    Written in ruby on Rails over 1.5 year time from scratch
    Based on previous models from the website
    Uses both the website, custom ERP and SaaS ERP
    Reusable capabilities for FLEX to automate manual processes
    Looks promising and strategy is to also go live in another country
    Scaled up from 3 to 13 engineers, hybrid working
    Keep delivering new features
    Photo by Osman Rana on Unsplash

    View Slide

  7. @kenny_baas
    @[email protected]
    It is designed to make programming web applications easier by making assumptions about
    what every developer needs to get started. It allows you to write less code while
    accomplishing more than many other languages and frameworks.
    Rails emphasizes the use of convention over configuration (CoC)
    and follows the principle of Don't Repeat Yourself (DRY).

    View Slide

  8. @kenny_baas
    @[email protected]
    The Model is usually the boundary, where new features are
    being added to...Ending up with a Big Ball of Mud

    View Slide

  9. @kenny_baas
    @[email protected]
    Team A Team B
    Application
    Database
    Somewhere around the Millenium
    Domain-​
    Driven Design 101

    View Slide

  10. @kenny_baas
    @[email protected]
    Domain models often start based on a naïve,
    over simplified entity-​
    relationship model based on reality.
    Good when you start, but when dealing with more complicated and
    complex problems it will become a big ball of mud

    View Slide

  11. @kenny_baas
    @[email protected]
    Platonic Domain model thinking assumes idealized, abstract representations
    of reality which may not always capture the intricacies of a domain. This can
    be misleading in Domain-​
    Driven Design (DDD), especially in core or
    complicated supporting domains where the nuances matter. A naïve model,
    influenced by this thinking, can confine you to an oversimplified view,
    potentially leading to incorrect, suboptimal and unadaptable software
    solutions.
    Inspired by Barry M O'Reilly
    - Plato is the devil
    Anti-​
    Pattern:
    Platonic Domain Model Thinking

    View Slide

  12. @kenny_baas
    @[email protected]
    Users and
    stakeholders
    Other people involved in
    designing and building software
    Managers
    Architects
    User researcher
    Analysts
    .....
    Code
    Engineering
    Team

    View Slide

  13. @kenny_baas
    @[email protected]
    Photo by pure julia on Unsplash
    For each specific problem, a different map
    For each specific problem, a different model

    View Slide

  14. @kenny_baas
    @[email protected]
    Job template
    Jobs
    Jobs
    Applications
    Candidate
    applications
    Application
    Job drafting Job Fulfilment
    Candidate
    applications

    View Slide

  15. @kenny_baas
    @[email protected]
    Job template
    Jobs
    Jobs
    Applications
    Candidate
    applications
    Application
    ......
    Domain-​
    Driven Design allows you to break down your domain
    into smaller models, enabling a single team to take ownership,
    even within a monolithic architecture.
    This empowers the team to make changes more independently,
    as it reduces the impact of those changes on other models.
    Job drafting Job Fulfilment
    Candidate
    applications

    View Slide

  16. @kenny_baas
    @[email protected]
    Photo by oxana v on Unsplash
    Keep the shop open:
    Start extracting bounded context guided by the roadmap
    What bounded context do we touch that is on the backlog?
    What is something on the backlog what is hard to do with the current model?

    View Slide

  17. @kenny_baas
    @[email protected]
    Building a shared understanding of your domain
    and use it to guide your design
    _is_ the philosophy behind DDD.
    The rest is principles, patterns, and practices.
    — Mathias Verraes
    Domain-​
    Driven Design 101 - Summary

    View Slide

  18. @kenny_baas
    @[email protected]
    Why understanding the underlying needs of users was crucial
    Photo by Kelly Sikkema on Unsplash

    View Slide

  19. @kenny_baas
    @[email protected]
    Onboarding a student
    Signup for
    an account
    Screen a
    candidate
    Upload compliancy
    information and
    documents
    Plan a
    kickstart
    Check student
    compliancy
    Enable on
    platform
    Student
    18-25 years
    Work single day
    job when money
    is needed
    Recruiter
    Find the best job
    for a student to
    work on
    apply for a
    job
    user
    (external)
    needs
    user
    (internal)
    Capabilities
    Account
    service
    Kickstart
    service
    Screening
    service
    Compliancy
    service
    Candidate
    service

    View Slide

  20. @kenny_baas
    @[email protected]
    Anti-​
    Pattern:
    Splitting a big ball of mud based
    on objects or process
    Refactoring a monolithic system by dividing it based on abstract or "platonic"
    object concepts can lead to a fragmented architecture, an approach that's an
    acknowledged anti-​
    pattern. This method, focused on idealized object categories
    rather than concrete functionalities, often results in ambiguous module
    responsibilities, impractical implementations, increased maintenance overhead,
    and reduced adaptability to new requirements.
    Inspired by Barry M O'Reilly
    - Plato is the devil

    View Slide

  21. @kenny_baas
    @[email protected]
    https://medium.com/inclusive-​
    software/when-​
    why-​
    to-​
    explore-​
    the-​
    problem-​
    space-​
    16068f1a1dbc

    View Slide

  22. @kenny_baas
    @[email protected]
    Collaborative modelling is a visualisation
    technique to analyse complex and conflict-​
    laden
    decision-​
    making processes with all relevant
    stakeholders and decision-​
    makers to create a
    shared understanding.

    View Slide

  23. @kenny_baas
    @[email protected]
    https://www.eventstorming.com/
    First time we started with only the team, on-​
    site.
    Afterward we move it to a miro board, so we could continue online.
    EventStorming became the default modelling language to design
    software for the engineers.
    Once the engineers had a good understanding of EventStorming, we
    started doing session with stakeholders
    1.
    2.
    3.
    4.

    View Slide

  24. @kenny_baas
    @[email protected]
    ........
    ........
    ........ ........
    ........ ........
    ........
    Start with 1 Miro board, and let the team self organise and enable structuring by
    splitting the miro board when needed. Giving each bounded context it's own board
    * Note, the team themselves decided on using miro

    View Slide

  25. @kenny_baas
    @[email protected]
    Prepare templates before doing collaborative
    modelling with certain key stakeholder

    View Slide

  26. @kenny_baas
    @[email protected]
    Distilling Bounded Context
    Onboarding a student
    Signup for
    an account
    Screen a
    candidate
    Upload compliancy
    information and
    documents
    Plan a
    kickstart
    Check student
    compliancy
    Enable on
    platform
    Student
    18-25 years
    Work single day
    job when money
    is needed
    Recruiter
    Find the best job
    for a student to
    work on
    apply for a
    job
    user
    (external)
    needs
    user
    (internal)
    Capabilities
    Candidate
    screening
    Candidate
    compliancy
    Candidate
    management
    Account
    management
    Split according to the:
    Language
    Departments
    Users
    And run through the
    design with scenarios
    1.
    2.
    3.

    View Slide

  27. @kenny_baas
    @[email protected]
    Photo by Trnava University on Unsplash
    Start applying Domain-​
    Driven Design on a complicated, medium risk problem.
    That way the team can experiment with the new patterns safely, and get used
    too the paradigm shift without to much risk and organisation exposure

    View Slide

  28. @kenny_baas
    @[email protected]
    Understanding the user needs - summary
    We are so caught up in the solution space
    that we miss perspectives
    that we forget to understand
    that we miss opportunities
     ​
     ​
     ​
     ​
     ​
     ​
    — Indi Young
    CC BY-​
    SA: INDI YOUNG

    View Slide

  29. @kenny_baas
    @[email protected]
    Embedding
    software
    architecture
    in the team

    View Slide

  30. @kenny_baas
    @[email protected]
    A paradigm shift
    Command
    Bounded Context
    Entity Domain
    Event
    Event Handler
    Command
    Bounded Context
    Entity Domain
    Event
    Controllers (MVC or Rest)

    View Slide

  31. @kenny_baas
    @[email protected]
    Photo by Nima Mot on Unsplash
    "Pair programming is not just about writing code together;
    it's about weaving two minds
    into a singular thread of creativity and problem-​
    solving."

    View Slide

  32. @kenny_baas
    @[email protected]
    Controllers (MVC or Rest)
    Rest
    request
    (command)
    Rest
    request
    (query)
    Company management
    Command
    Services
    Aggregate
    Company
    Registered WorkLoc
    ationUp
    dated
    Legacy model
    Rest
    request
    (query)
    Event Handler Do
    something
    else
    Database
    Entity table
    Column Column Column
    Updates
    Views
    Entity
    Reads
    request
    (command)
    request
    (query)
    Bubble context
    Controllers (MVC or Rest)
    Rest
    request
    (command)
    Rest
    request
    (query)
    Company management
    Command
    Services
    Aggregate
    Company
    Registered
    WorkLoc
    ationUp
    dated
    Legacy model
    Rest
    request
    (query)
    Event Handler
    Database
    Aggregate table
    Column Column Column
    Views
    Entity
    Reads
    Read entity Table
    Updates
    Column Column Column
    Event Handler
    Do
    something
    else
    request
    (command)
    request
    (query)
    Autonomous
    Bubble context

    View Slide

  33. @kenny_baas
    @[email protected]
    https://bytesizearchitecturesessions.com/
    Andrea Magnorsky
    Bytesize architecture session

    View Slide

  34. @kenny_baas
    @[email protected]

    View Slide

  35. @kenny_baas
    @[email protected]
    Sustainable design decisions are decisions that
    consider the sociotechnical impact of the
    alternatives. After designing and analysing the
    alternatives, you pick the one that gives you the
    best sociotechnical trade-​
    off with the information
    that is available. You create a feedback loop into
    your design process to improve it along the way.
    Over time, you will find yourself making decisions in
    a similar way. This is when your decisions become
    sustainable.
    Collaborative software design - summary
    Sociotechnical System - from https://www.researchgate.net/figure/Sociotechnical-​
    system-​
    STS-​
    4_fig2_306242078

    View Slide

  36. @kenny_baas
    @[email protected]
    Photo by Ibrahim Boran on Unsplash
    From output to data-​
    driven outcomes
    through Domain-​
    Driven Design

    View Slide

  37. @kenny_baas
    @[email protected]
    Job Drafting
    Add
    job
    Job
    Added Job Fullfiment
    Publish
    Job
    Job
    Published
    Cancel
    job
    Apply
    candidate
    for job
    Cancel
    application
    Job
    Cancelled
    Candidate
    applied
    for job
    Application
    cancelled
    ACL
    Create
    legacy
    Job
    Legacy model
    Create
    job
    Job
    Created
    Challenging the backlog....

    View Slide

  38. @kenny_baas
    @[email protected]
    Business monitoring

    View Slide

  39. @kenny_baas
    @[email protected]
    “We can't impose our will on a system. We can listen to what the
    system tells us, and discover how its properties and our values can
    work together to bring forth something much better than could
    ever be produced by our will alone.”
     ​
     ​
     ​
     ​
     ​
    — Donella H. Meadows
    From output to data-​
    driven outcomes
    through Domain-​
    Driven Design - Summary

    View Slide

  40. @kenny_baas
    @[email protected]

    View Slide

  41. @kenny_baas
    @[email protected]

    View Slide

  42. @kenny_baas
    @[email protected]
    Thank You #CatTax
    kenny@weave-​
    it.org - weave-​
    it.org
    Get the book here

    View Slide