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

Harnessing Domain Driven Design for Distributed Systems

Harnessing Domain Driven Design for Distributed Systems

These are the slides from the session Gayathri Thiyagarajan and I gave at Devoxx UK 2016

Andrew Harmel-Law

June 13, 2016
Tweet

More Decks by Andrew Harmel-Law

Other Decks in Technology

Transcript

  1. @YourTwitterHandle
    #YourSessionHashtag
    Gayathri Thiyagarajan &
    Andrew Harmel-Law,
    Capgemini UK
    http://capgemini.github.io
    Harnessing Domain Driven
    Design for Distributed
    Systems
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  2. cc: kennyma*c - h-ps://www.flickr.com/photos/99472898@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd
    Who are we?

    View Slide

  3. Who are we?
    The image cannot be displayed. Your computer may not have enough memory to open the image,
    or the image may have been corrupted. Restart your computer, and then open the file again. If the
    red x still appears, you may have to delete the image and then insert it again.
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  4. “Microservice”?
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  5. “Microservice”? (cont.)
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  6. “Microservice”? (cont.)
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  7. “Microservice”? (cont.)
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  8. “Microservice”? (cont.)
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  9. “Microservice”? (cont.)
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  10. Microservices ROCK!
    cc: RaeAllen - h-ps://www.flickr.com/photos/30628871@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  11. Microservices are HARD
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  12. “Ge;ng service boundaries wrong
    can result in having to make lots
    of changes in service-service
    collaboraEon. An expensive
    operaEon.”
    from Sam Newman, “Building Microservices”
    (secEon: When shouldn’t you use Microservices)
    Boundaries are HARDEST
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  13. Microservices LOVE DDD
    cc: {AndreaRenee} - h-ps://www.flickr.com/photos/30282864@N02
    “Despite the hype
    [microservices] probably giv[e]
    us the best environment we
    have ever had for doing
    Domain-Driven Design”
    (Interview with Eric Evans at 2015 DDD Exchange)
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  14. cc: taberandrew - h-ps://www.flickr.com/photos/88442983@N00
    Unfortunately...
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  15. Some steps...
    cc: marsupium photography - h-ps://www.flickr.com/photos/43405950@N07
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  16. The Core
    How DDD helps our CODE
    cc: Laurence Vagner - h-ps://www.flickr.com/photos/86078191@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  17. Ubiquitous Language
    cc: mag3737 - h-ps://www.flickr.com/photos/50318388@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  18. Hands-On Modellers
    cc: jovike - h-ps://www.flickr.com/photos/49503078599@N01
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  19. The Misapplied
    How DDD helps our overall Architecture
    cc: juhansonin - h-ps://www.flickr.com/photos/38869431@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  20. The Important Bits
    •  Models
    •  Aggregates
    •  Contexts
    •  Bounded Contexts
    •  Context Maps
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  21. Shared Payment Services
    Our Case Study:
    cc: Khánh Hmoong - h-ps://www.flickr.com/photos/7997148@N05
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  22. Shared Payment Services
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  23. @gaythu_rajan / @al94781
    #harnessing_ddd
    Shared Payment Services

    View Slide

  24. @gaythu_rajan / @al94781
    #harnessing_ddd
    Shared Payment Services

    View Slide

  25. @gaythu_rajan / @al94781
    #harnessing_ddd
    Shared Payment Services

    View Slide

  26. Models
    cc: Rob Swatski - h-ps://www.flickr.com/photos/50946274@N02
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  27. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  28. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  29. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  30. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  31. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  32. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  33. Aggregates
    cc: J-W Brown - h-ps://www.flickr.com/photos/13797487@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  34. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  35. Contexts
    cc: pe*tshoo - h-ps://www.flickr.com/photos/29426084@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  36. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  37. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  38. Bounded Contexts
    cc: bryce_edwards - h-ps://www.flickr.com/photos/98185064@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  39. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  40. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  41. Context Maps
    cc: roger4336 - h-ps://www.flickr.com/photos/24736216@N07
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  42. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  43. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  44. Why Aggregates?
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  45. @gaythu_rajan / @al94781
    #harnessing_ddd
    Aggregate == Microservice

    View Slide

  46. @gaythu_rajan / @al94781
    #harnessing_ddd
    Aggregate == Microservice

    View Slide

  47. But, Aggregate !=
    Microservice (not always)
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  48. @gaythu_rajan / @al94781
    #harnessing_ddd
    But, Aggregate !=
    Microservice (not always)

    View Slide

  49. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  50. 1.  Draw a Model and begin to implement it
    cc: Muffet - h-ps://www.flickr.com/photos/53133240@N00
    An Approach
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  51. 1.  Draw a Model and begin to implement it
    2.  As you draw it and code it, listen to the Language and
    culEvate your Model accordingly
    cc: Muffet - h-ps://www.flickr.com/photos/53133240@N00
    An Approach
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  52. 1.  Draw a Model and begin to implement it
    2.  As you draw it and code it, listen to the Language and
    culEvate your Model accordingly
    3.  IdenEfy your Aggregates - these are your starter
    Microservices
    cc: Muffet - h-ps://www.flickr.com/photos/53133240@N00
    An Approach
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  53. cc: Muffet - h-ps://www.flickr.com/photos/53133240@N00
    An Approach
    @gaythu_rajan / @al94781
    #harnessing_ddd
    1.  Draw a Model and begin to implement it
    2.  As you draw it and code it, listen to the Language and
    culEvate your Model accordingly
    3.  IdenEfy your Aggregates - these are your starter
    Microservices
    4.  When you hit pain points (indicated by the Language) split
    into different Bounded Contexts to resolve

    View Slide

  54. 1.  Draw a Model and begin to implement it
    2.  As you draw it and code it, listen to the Language and
    culEvate your Model accordingly
    3.  IdenEfy your Aggregates - these are your starter
    Microservices
    4.  When you hit pain points (indicated by the Language) split
    into different Bounded Contexts to resolve
    5.  Revisit your Bounded Contexts now you know more about
    how each Aggregate - you may end up spli;ng them
    cc: Muffet - h-ps://www.flickr.com/photos/53133240@N00
    An Approach
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  55. Done?
    cc: WarzauWynn - h-ps://www.flickr.com/photos/94246031@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  56. The Ignored
    How DDD helps our Teams Organise
    cc: aha42 | tehaha - h-ps://www.flickr.com/photos/31549162@N05
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  57. @gaythu_rajan / @al94781
    #harnessing_ddd
    Customer-Supplier
    Partnership Anti-Corruption Layer
    Upstream
    Downstream

    View Slide

  58. Shared
    Kernel
    Separate
    Ways
    An*-
    Corrup*on
    Layer
    Partner-
    ship
    Conform-
    ist
    Open
    Host
    Service
    Customer
    /
    Supplier
    Control Over Associated Teams
    CommunicaEons Commitment / Capability of Teams
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  59. Shared
    Kernel
    Separate
    Ways
    An*-
    Corrup*on
    Layer
    Partner-
    ship
    Conform-
    ist
    Open
    Host
    Service
    Customer
    /
    Supplier
    Control Over Associated
    Teams
    CommunicaEons Commitment / Capability of
    Teams
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  60. Shared
    Kernel
    Separate
    Ways
    An*-
    Corrup*on
    Layer
    Partner-
    ship
    Conform-
    ist
    Open
    Host
    Service
    Customer
    /
    Supplier
    Control Over Associated
    Teams
    CommunicaEons Commitment / Capability of
    Teams
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  61. Upstream/Downstream
    cc: archer10 (Dennis) (73M Views) - h-ps://www.flickr.com/photos/22490717@N02
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  62. Partnership
    cc: prac*calowl - h-ps://www.flickr.com/photos/55046645@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  63. @gaythu_rajan / @al94781
    #harnessing_ddd
    Partnership

    View Slide

  64. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  65. Customer-Supplier
    cc: TheeErin - h-ps://www.flickr.com/photos/27073477@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  66. @gaythu_rajan / @al94781
    #harnessing_ddd
    Customer-Supplier

    View Slide

  67. @gaythu_rajan / @al94781
    #harnessing_ddd @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  68. An*-Corrup*on Layer
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  69. @gaythu_rajan / @al94781
    #harnessing_ddd
    Anti-Corruption Layer
    Upstream
    Downstream

    View Slide

  70. @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  71. Done Done
    cc: jayneandd - h-ps://www.flickr.com/photos/8180853@N07
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  72. Take Home Messages
    cc: Manoj Kengudelu - h-ps://www.flickr.com/photos/11767573@N02
    •  Find the right Microservices - or you’ll pine for
    the Monolith
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  73. Take Home Messages
    cc: Manoj Kengudelu - h-ps://www.flickr.com/photos/11767573@N02
    •  Find the right Microservices - or you’ll pine for
    the Monolith
    •  Don’t get confused about BCs - they will fall
    out if you listen to the Language
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  74. Take Home Messages
    •  Find the right Microservices - or you’ll pine for
    the Monolith
    •  Don’t get confused about BCs - they will fall
    out if you listen to the Language
    •  Organise around your services beger - apply
    the Strategic Pagerns
    cc: Manoj Kengudelu - h-ps://www.flickr.com/photos/11767573@N02
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  75. Take Home Messages
    •  Find the right Microservices - or you’ll pine for
    the Monolith
    •  Don’t get confused about BCs - they will fall
    out if you listen to the Language
    •  Organise around your services beger - apply
    the Strategic Pagerns
    •  Be inspired to do more Domain Driven Design
    cc: Manoj Kengudelu - h-ps://www.flickr.com/photos/11767573@N02
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  76. And Finally...
    cc: oatsy40 - h-ps://www.flickr.com/photos/68089229@N06
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  77. Ques*ons Please
    cc: Derek Bridges - h-ps://www.flickr.com/photos/84949728@N00
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  78. Oh, and we (Capgemini ) are hiring!
    (visit bit.ly/cg-jvm-jobs-ddd)
    cc: ptrlx - h-ps://www.flickr.com/photos/58615912@N05
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide

  79. Read More...
    •  hgps://capgemini.github.io/architecture/
    microservices-reality-check/
    •  hgps://capgemini.github.io/architecture/
    why-microservices-are-right-for-us-pt1/
    •  hgps://capgemini.github.io/architecture/
    microservices-like-change/
    •  hgps://capgemini.github.io/architecture/
    microservices-gotchas/
    cc: Manoj Kengudelu - h-ps://www.flickr.com/photos/11767573@N02
    @gaythu_rajan / @al94781
    #harnessing_ddd

    View Slide