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

A Monolith on the Dissecting Table: The Strangler Fig Pattern in Action @ RivieraDev France 2023

A Monolith on the Dissecting Table: The Strangler Fig Pattern in Action @ RivieraDev France 2023

Abstract:

Many existing companies cannot just start over on the green field. Instead, significant maintenance efforts are necessary for aged applications, which usually exhibit a monolithic architecture based on traditional, potentially outdated tech stacks. Companies willing to shift towards distributed architectures and modern technologies are struggling because they don't know where and how to start.

This talk briefly introduces the strangler fig pattern, which enables a smooth and step-wise transformation of monolithic applications into separate (micro)services. The main focus of this practical session is a demo scenario, showing step-by-step how to extract a particular part of an existing monolith into a separate service. During the demo, we will also get in touch with popular technologies such as Kubernetes, Apache Kafka, Debezium, and MongoDB.

This session helps you to understand what it means to apply the strangler fig pattern to extract functionality from your monoliths. The learnings will empower you to gradually evolve existing applications into a (micro)service architecture and an en-vogue tech stack.

Demo Repository: https://github.com/hpgrahsl/sfp-rivieradev23

Video Recording: Sessions haven't been recorded.

Hans-Peter Grahsl

July 12, 2023
Tweet

More Decks by Hans-Peter Grahsl

Other Decks in Programming

Transcript

  1. A Monolith
    on the Dissecting Table:
    The Strangler Fig Pattern
    in Action
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023

    View full-size slide

  2. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    2

    View full-size slide

  3. !
    It's me ... Hans-Peter
    • Developer
    !
    Advocate @ Red Hat
    • Open-Source Enthusiast
    • 4x Confluent Community Catalyst
    • MongoDB Community Champion since 2020
    • based in Graz, Austria
    "
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    3

    View full-size slide

  4. system migrations are challenging
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    4

    View full-size slide

  5. !
    What about
    the big rewrite
    and a hard cut-over? !
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    5

    View full-size slide

  6. BIG BANG migrations
    often doomed to failure
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    6

    View full-size slide

  7. "If you do a big bang
    rewrite, the only thing
    you're certain of is a big
    bang."
    — Martin Fowler
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    7

    View full-size slide

  8. Migration Goal
    • gradually evolve from old into new
    • support (temporary) coexistence
    • avoid risky big bang rewrite
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    8

    View full-size slide

  9. strangler fig pattern
    to the rescue
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    9

    View full-size slide

  10. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    10

    View full-size slide

  11. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    11

    View full-size slide

  12. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    12

    View full-size slide

  13. strangler fig pattern
    by example
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    13

    View full-size slide

  14. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    14

    View full-size slide

  15. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    15

    View full-size slide

  16. Change-Data-Capture
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    16

    View full-size slide

  17. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    17

    View full-size slide

  18. Debezium's supported Databases
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    18

    View full-size slide

  19. Open-Source Change-Data-Capture
    • captures data changes by tapping into DB's TX log
    • change events propagated via Apache Kafka / Connect
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    19

    View full-size slide

  20. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    20

    View full-size slide

  21. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    21

    View full-size slide

  22. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    22

    View full-size slide

  23. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    23

    View full-size slide

  24. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    24

    View full-size slide

  25. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    25

    View full-size slide

  26. CDC Pipeline Concern #1
    We're leaking our
    data / domain model.
    I want an anti-corruption layer.
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    26

    View full-size slide

  27. Single Message Transforms
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    27

    View full-size slide

  28. CDC Pipeline Concern #2
    But this only replicates data
    "row by row".
    I might need aggregate structures.
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    28

    View full-size slide

  29. Stream Processor for Joining
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    29

    View full-size slide

  30. DEMO TIME
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    30

    View full-size slide

  31. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    31

    View full-size slide

  32. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    32

    View full-size slide

  33. Wrapping Up
    • incremental migration → baby steps
    • pause / stop without losing spent $$$
    • extraction steps ideally reversible
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    33

    View full-size slide


  34. minimize migration risk
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    34

    View full-size slide

  35. !
    Let's stay in touch
    !
    @hpgrahsl
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    35

    View full-size slide

  36. !
    Give it a try!
    "
    • Strangler Fig Pattern Demo
    https://bit.ly/sfp-rivdev23
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    36

    View full-size slide

  37. @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    37

    View full-size slide

  38. Links & Resources
    • Demo Repository
    https://github.com/hpgrahsl/sfp-rivieradev23
    • Developer Sandbox for Openshift
    https://developers.redhat.com/developer-sandbox
    • Debezium Website
    https://debezium.io
    • Quarkus
    https://quarkus.io
    @hpgrahsl | #RivieraDev @rivieradev - France | 2023
    38

    View full-size slide

  39. @hpgrahsl | #RivieraDev @rivieradev - France | 2023

    View full-size slide