SlideShare a Scribd company logo
1
Choking the Monolith
The Strangler Pattern Applied
Legacy of SoCraTes, April 1, 2020
Tobias Goeschel @w3ltraumpirat
John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0)
2
Choking the Monolith
The Strangler Pattern Applied
Legacy of SoCraTes, April 1, 2020
Tobias Goeschel @w3ltraumpirat
John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0)
fig
V
3
John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0)
Martin Fowler (2004):
StranglerFigApplication
•Incremental, piece-by-piece
replacement of a larger legacy
system.
•NOT a microservices pattern
4
John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0)
Our Agenda:
•Context
•Problem
•Implementation
•Consequences
•Related Patterns
…and what might happen IRL
5
Legacy Code
•Code inherited from someone else
•Code that is unsafe to change
•Code without tests (Michael Feathers)
•“All code, as soon as it’s written”
6
Legacy Code
•Usually code that works
•Contains vast amounts of knowledge
•“The code that earns our money”
7
Almonroth / CC BY-SA (https://creativecommons.org/licenses/by-sa/3.0)
The system needs replacement
•Paradigm shifts / business changes
•Compliance
•Inability to scale
•Cost-effectiveness
•Obsolete platform
•Hard to find developers
•Tools outdated
•Parts of system available as a product /
commodity
•Code has become unmaintainable
8
John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0)
Our Agenda:
•Context
•Problem
•Implementation
•Consequences
•Related Patterns
…and what might happen IRL
9
© Frank Schulenburg / CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/)
Hard to replace:
•Runs vital parts of infrastructure
•Original creators no longer around
•We will likely make many of the same mistakes
(again)
•Replacement will take a long time
•We can’t introduce new features
•Old and new version maintained in parallel
•Production data can only be transformed once
10
John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0)
Our Agenda:
•Context
•Problem
•Implementation
•Consequences
•Related Patterns
…and what might happen IRL
11
Legacy System
12
Mixed System
13
Mixed System
14
Mixed System
15
Mixed System
16
Mixed System
17
Mixed System
18
Mixed System
19
Mixed System
New System
Solution #1: Request Interception (Façade/Proxy)
I II III IV V
Solution #1: Request Interception (rev2) (Façade/Proxy)
« Facade » « Facade » « Facade » « Facade »
I II III IV V
Solution #2: Event Interception (Message Bus / Queue)
I II III IV V
24
John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0)
Our Agenda:
•Context
•Problem
•Implementation
•Consequences
•Related Patterns
…and what might happen IRL
25
Nick Youngson CC BY-SA 3.0 Alpha Stock Images
Benefits over “big bang” rewrite:
•Vital business can run with the least amount of
downtime
•More frequent releases
•Much earlier ROI on new code
•Shorter feedback cycles
•More fine-grained options, more often:
•Some parts of the old system can be left
unchanged / omitted
•New features possible
•Data duplication (vs transformation) allows
experiments
26
Drawbacks:
•Possibly long time of running systems in parallel
•Both systems incur maintenance cost
•Political dismay
•Migration / synchronisation of legacy data may
become a problem
27
John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0)
Our Agenda:
•Context
•Problem
•Implementation
•Consequences
•Related Patterns
…and what might happen IRL
28
Related patterns:
•Proxy / Facade (GoF)
•Event Interception (Martin Fowler)
•Asset Capture (Martin Fowler)
•Group changes by “entity”
(or rather, domain object)
➡ Domain Driven Design!
Schnobby / CC BY-SA (https://creativecommons.org/licenses/by-sa/3.0)
29
John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0)
Our Agenda:
•Context
•Problem
•Implementation
•Consequences
•Related Patterns
…and what might happen IRL
30
31
Bernard DUPONT from FRANCE / CC BY-SA (https://creativecommons.org/licenses/by-sa/2.0)
When the rubber hits the road:
•New features usually more important than
transformation of old bits
➡ Strong focus on replacing legacy system is key
•Who decides what’s worth keeping?
32
Graham Horn / CC BY-SA (https://creativecommons.org/licenses/by-sa/2.0)
When the rubber hits the road:
•Code issues:
•No well-defined interfaces in place
•Code entangled / hard to change
•Knowledge of old system is lost / hard to find
•Documentation outdated / missing
•People have left the company
•Misleading names
•Misused / badly implemented design patterns
33
Chadica from Jerusalem, Israel / CC BY (https://creativecommons.org/licenses/by/2.0)
When the rubber hits the road:
•Code issues:
•Hidden / obscured logic in
•Frontend
•Stored procedures
•Dirty hacks
•These are all common for legacy code
34
Zach Dischner / CC BY (https://creativecommons.org/licenses/by/2.0)
When the rubber hits the road:
•Use helpful / well-known patterns to enable
strangulation:
•Seam (Michael Feathers)
•Walking Skeleton (Alistair Cockburn)
•Hexagonal Architecture (Alistair Cockburn)
•Branch by Abstraction (Jez Humble)
35
…and now: The Most Horrible Code in the World
36
SomeCms
37
•CMS
•Multi-tenancy
•Several million € revenue
•“histerically grown” since the 1990s
•GWT / Vaadin / Java 8 / Tomcat / MySQL / Gradle
•CMS with edit/publish/versioning
•Uses JSP as template format
•Virtual file system
•Module expansion system
SomeCms
38
•Monorepo
•Gradle build runs ca. 25 min.
(of which, 23 min. is the test suite)
•“Unit tests” that aren’t
•All tests are integrated tests
•A stripped down, but functional instance of the
CMS is injected into the test cases
•Test suite only runs as a whole
SomeCms
39
•Needs running instance for … well, everything
•No well-defined API
•Mixes Java / HTML / javascript output and
functionality
•Makes extensive use of filters / HTTP request/
response manipulation
•Method names are obscure (“export”,
“processRequest”, …)
•Brings its own thread logic, resource locking
•Classpath issues
•“Event Manager” for batch processes
SomeCms
40
•Also rolls its own:
•Auth/Permission logic and session handling
•JSON serialization
•Mail server
•Command shell
•Hungarian Notation
•Everything is static, or final, or both
SomeCms
41
SomeCms
?
42
SomeCms
•Some ideas:
•Publishing moves things from a to b. That could
become a service.
•Publishing could render static HTML
•HTTP filters can be used for interception, forward
some requests selectively
•Perhaps some functionality can be extracted as is,
keep using same DB for synchronization
•Permissions handling is tricky - switching from
sessions to web tokens might be a first step
•Finding ways to modularize and speed up the test
suite is essential
codecentric AG
Kreuznacher Str. 30
60846 Frankfurt / Germany
Telefon: +49 (0) 151.14965469
Tobias Goeschel
Principal Consultant
tobias.goeschel@codecentric.de
www.codecentric.de
Innovative - Trustful - Competent - Pragmatic
43

More Related Content

What's hot

Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd products
Julian Mazzitelli
 
Decompose your monolith: strategies for migrating to microservices (Tide)
Decompose your monolith: strategies for migrating to microservices (Tide)Decompose your monolith: strategies for migrating to microservices (Tide)
Decompose your monolith: strategies for migrating to microservices (Tide)
Chris Richardson
 
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
wallyqs
 
Jenkins Pipeline Tutorial | Jenkins Build And Delivery Pipeline | Jenkins Tut...
Jenkins Pipeline Tutorial | Jenkins Build And Delivery Pipeline | Jenkins Tut...Jenkins Pipeline Tutorial | Jenkins Build And Delivery Pipeline | Jenkins Tut...
Jenkins Pipeline Tutorial | Jenkins Build And Delivery Pipeline | Jenkins Tut...
Simplilearn
 
10 years in Network Protocol testing L2 L3 L4-L7 Tcl Python Manual and Automa...
10 years in Network Protocol testing L2 L3 L4-L7 Tcl Python Manual and Automa...10 years in Network Protocol testing L2 L3 L4-L7 Tcl Python Manual and Automa...
10 years in Network Protocol testing L2 L3 L4-L7 Tcl Python Manual and Automa...Mullaiselvan Mohan
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the Containers
Ryan Hodgin
 
Slide DevSecOps Microservices
Slide DevSecOps Microservices Slide DevSecOps Microservices
Slide DevSecOps Microservices
Hendri Karisma
 
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
Chris Richardson
 
WTF is GitOps and Why You Should Care?
WTF is GitOps and Why You Should Care?WTF is GitOps and Why You Should Care?
WTF is GitOps and Why You Should Care?
Weaveworks
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
Terry Chen
 
Redpanda and ClickHouse
Redpanda and ClickHouseRedpanda and ClickHouse
Redpanda and ClickHouse
Altinity Ltd
 
Best Practices of running PostgreSQL in Virtual Environments
Best Practices of running PostgreSQL in Virtual EnvironmentsBest Practices of running PostgreSQL in Virtual Environments
Best Practices of running PostgreSQL in Virtual Environments
Jignesh Shah
 
Cloud Native Bern 05.2023 — Zero Trust Visibility
Cloud Native Bern 05.2023 — Zero Trust VisibilityCloud Native Bern 05.2023 — Zero Trust Visibility
Cloud Native Bern 05.2023 — Zero Trust Visibility
Raphaël PINSON
 
Scaling and High Performance Storage System: LeoFS
Scaling and High Performance Storage System: LeoFSScaling and High Performance Storage System: LeoFS
Scaling and High Performance Storage System: LeoFS
Rakuten Group, Inc.
 
CI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cdCI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cd
Billy Yuen
 
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
SeungYong Oh
 
DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
EastBanc Tachnologies
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
Haggai Philip Zagury
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
tyrantbrian
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
Amazon Web Services
 

What's hot (20)

Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd products
 
Decompose your monolith: strategies for migrating to microservices (Tide)
Decompose your monolith: strategies for migrating to microservices (Tide)Decompose your monolith: strategies for migrating to microservices (Tide)
Decompose your monolith: strategies for migrating to microservices (Tide)
 
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
 
Jenkins Pipeline Tutorial | Jenkins Build And Delivery Pipeline | Jenkins Tut...
Jenkins Pipeline Tutorial | Jenkins Build And Delivery Pipeline | Jenkins Tut...Jenkins Pipeline Tutorial | Jenkins Build And Delivery Pipeline | Jenkins Tut...
Jenkins Pipeline Tutorial | Jenkins Build And Delivery Pipeline | Jenkins Tut...
 
10 years in Network Protocol testing L2 L3 L4-L7 Tcl Python Manual and Automa...
10 years in Network Protocol testing L2 L3 L4-L7 Tcl Python Manual and Automa...10 years in Network Protocol testing L2 L3 L4-L7 Tcl Python Manual and Automa...
10 years in Network Protocol testing L2 L3 L4-L7 Tcl Python Manual and Automa...
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the Containers
 
Slide DevSecOps Microservices
Slide DevSecOps Microservices Slide DevSecOps Microservices
Slide DevSecOps Microservices
 
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
 
WTF is GitOps and Why You Should Care?
WTF is GitOps and Why You Should Care?WTF is GitOps and Why You Should Care?
WTF is GitOps and Why You Should Care?
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 
Redpanda and ClickHouse
Redpanda and ClickHouseRedpanda and ClickHouse
Redpanda and ClickHouse
 
Best Practices of running PostgreSQL in Virtual Environments
Best Practices of running PostgreSQL in Virtual EnvironmentsBest Practices of running PostgreSQL in Virtual Environments
Best Practices of running PostgreSQL in Virtual Environments
 
Cloud Native Bern 05.2023 — Zero Trust Visibility
Cloud Native Bern 05.2023 — Zero Trust VisibilityCloud Native Bern 05.2023 — Zero Trust Visibility
Cloud Native Bern 05.2023 — Zero Trust Visibility
 
Scaling and High Performance Storage System: LeoFS
Scaling and High Performance Storage System: LeoFSScaling and High Performance Storage System: LeoFS
Scaling and High Performance Storage System: LeoFS
 
CI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cdCI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cd
 
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
 
DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 

Similar to Choking the monolith - The Strangler (Fig) Pattern Applied

OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
NETWAYS
 
OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
NETWAYS
 
Fasten Industry Meeting with GitHub about Dependancy Management
Fasten Industry Meeting with GitHub about Dependancy ManagementFasten Industry Meeting with GitHub about Dependancy Management
Fasten Industry Meeting with GitHub about Dependancy Management
Fasten Project
 
RSA conference poster on Docker container security
RSA conference poster on Docker container securityRSA conference poster on Docker container security
RSA conference poster on Docker container security
Manideep Konakandla
 
快速創新的模組化設計
快速創新的模組化設計快速創新的模組化設計
快速創新的模組化設計
MAKERPRO.cc
 
What's really the difference between a VM and a Container?
What's really the difference between a VM and a Container?What's really the difference between a VM and a Container?
What's really the difference between a VM and a Container?
Adrian Otto
 
Defcon through the_eyes_of_the_attacker_2018_slides
Defcon through the_eyes_of_the_attacker_2018_slidesDefcon through the_eyes_of_the_attacker_2018_slides
Defcon through the_eyes_of_the_attacker_2018_slides
Marina Krotofil
 
Is Docker Secure?
Is Docker Secure?Is Docker Secure?
Is Docker Secure?
Manideep Konakandla
 
Digital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesDigital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and Microservices
Lightbend
 
SFScon 21 - Matteo Camilli - Performance assessment of microservices with str...
SFScon 21 - Matteo Camilli - Performance assessment of microservices with str...SFScon 21 - Matteo Camilli - Performance assessment of microservices with str...
SFScon 21 - Matteo Camilli - Performance assessment of microservices with str...
South Tyrol Free Software Conference
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Jérôme Petazzoni
 
Semiconductor Industry Tutorial
Semiconductor Industry TutorialSemiconductor Industry Tutorial
Semiconductor Industry Tutorial
Stanford University
 
From Tacoma Narrows to West Seattle…Appsec Lessons from A Century of Pacific...
From Tacoma Narrows to West Seattle…Appsec Lessons from A Century of Pacific...From Tacoma Narrows to West Seattle…Appsec Lessons from A Century of Pacific...
From Tacoma Narrows to West Seattle…Appsec Lessons from A Century of Pacific...
Adam Shostack
 
Thomson Reuters, TMS: Workflow in GitLab
Thomson Reuters, TMS: Workflow in GitLabThomson Reuters, TMS: Workflow in GitLab
Thomson Reuters, TMS: Workflow in GitLab
Matan Keidar
 
Distributed Version Control Systems
Distributed Version Control SystemsDistributed Version Control Systems
Distributed Version Control Systems
Mihail Stoynov
 
The Basic Theories of Blockchain
The Basic Theories of BlockchainThe Basic Theories of Blockchain
The Basic Theories of Blockchain
Sota Watanabe
 
Microservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done RightMicroservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done Right
Lightbend
 
Where We're Headed and Where NSX Fits In
Where We're Headed and Where NSX Fits InWhere We're Headed and Where NSX Fits In
Where We're Headed and Where NSX Fits In
Scott Lowe
 
OnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildOnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform Build
David Rosen
 
02_07_2018_«El valor de blockchain en el registro de la actividad académica: ...
02_07_2018_«El valor de blockchain en el registro de la actividad académica: ...02_07_2018_«El valor de blockchain en el registro de la actividad académica: ...
02_07_2018_«El valor de blockchain en el registro de la actividad académica: ...
eMadrid network
 

Similar to Choking the monolith - The Strangler (Fig) Pattern Applied (20)

OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
 
OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
OSDC 2015: Martin Gerhard Loschwitz - Kristian Köhntopp | 45 Minutes of OpenS...
 
Fasten Industry Meeting with GitHub about Dependancy Management
Fasten Industry Meeting with GitHub about Dependancy ManagementFasten Industry Meeting with GitHub about Dependancy Management
Fasten Industry Meeting with GitHub about Dependancy Management
 
RSA conference poster on Docker container security
RSA conference poster on Docker container securityRSA conference poster on Docker container security
RSA conference poster on Docker container security
 
快速創新的模組化設計
快速創新的模組化設計快速創新的模組化設計
快速創新的模組化設計
 
What's really the difference between a VM and a Container?
What's really the difference between a VM and a Container?What's really the difference between a VM and a Container?
What's really the difference between a VM and a Container?
 
Defcon through the_eyes_of_the_attacker_2018_slides
Defcon through the_eyes_of_the_attacker_2018_slidesDefcon through the_eyes_of_the_attacker_2018_slides
Defcon through the_eyes_of_the_attacker_2018_slides
 
Is Docker Secure?
Is Docker Secure?Is Docker Secure?
Is Docker Secure?
 
Digital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesDigital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and Microservices
 
SFScon 21 - Matteo Camilli - Performance assessment of microservices with str...
SFScon 21 - Matteo Camilli - Performance assessment of microservices with str...SFScon 21 - Matteo Camilli - Performance assessment of microservices with str...
SFScon 21 - Matteo Camilli - Performance assessment of microservices with str...
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
 
Semiconductor Industry Tutorial
Semiconductor Industry TutorialSemiconductor Industry Tutorial
Semiconductor Industry Tutorial
 
From Tacoma Narrows to West Seattle…Appsec Lessons from A Century of Pacific...
From Tacoma Narrows to West Seattle…Appsec Lessons from A Century of Pacific...From Tacoma Narrows to West Seattle…Appsec Lessons from A Century of Pacific...
From Tacoma Narrows to West Seattle…Appsec Lessons from A Century of Pacific...
 
Thomson Reuters, TMS: Workflow in GitLab
Thomson Reuters, TMS: Workflow in GitLabThomson Reuters, TMS: Workflow in GitLab
Thomson Reuters, TMS: Workflow in GitLab
 
Distributed Version Control Systems
Distributed Version Control SystemsDistributed Version Control Systems
Distributed Version Control Systems
 
The Basic Theories of Blockchain
The Basic Theories of BlockchainThe Basic Theories of Blockchain
The Basic Theories of Blockchain
 
Microservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done RightMicroservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done Right
 
Where We're Headed and Where NSX Fits In
Where We're Headed and Where NSX Fits InWhere We're Headed and Where NSX Fits In
Where We're Headed and Where NSX Fits In
 
OnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildOnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform Build
 
02_07_2018_«El valor de blockchain en el registro de la actividad académica: ...
02_07_2018_«El valor de blockchain en el registro de la actividad académica: ...02_07_2018_«El valor de blockchain en el registro de la actividad académica: ...
02_07_2018_«El valor de blockchain en el registro de la actividad académica: ...
 

Recently uploaded

Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 

Recently uploaded (20)

Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 

Choking the monolith - The Strangler (Fig) Pattern Applied

  • 1. 1 Choking the Monolith The Strangler Pattern Applied Legacy of SoCraTes, April 1, 2020 Tobias Goeschel @w3ltraumpirat John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0)
  • 2. 2 Choking the Monolith The Strangler Pattern Applied Legacy of SoCraTes, April 1, 2020 Tobias Goeschel @w3ltraumpirat John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0) fig V
  • 3. 3 John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0) Martin Fowler (2004): StranglerFigApplication •Incremental, piece-by-piece replacement of a larger legacy system. •NOT a microservices pattern
  • 4. 4 John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0) Our Agenda: •Context •Problem •Implementation •Consequences •Related Patterns …and what might happen IRL
  • 5. 5 Legacy Code •Code inherited from someone else •Code that is unsafe to change •Code without tests (Michael Feathers) •“All code, as soon as it’s written”
  • 6. 6 Legacy Code •Usually code that works •Contains vast amounts of knowledge •“The code that earns our money”
  • 7. 7 Almonroth / CC BY-SA (https://creativecommons.org/licenses/by-sa/3.0) The system needs replacement •Paradigm shifts / business changes •Compliance •Inability to scale •Cost-effectiveness •Obsolete platform •Hard to find developers •Tools outdated •Parts of system available as a product / commodity •Code has become unmaintainable
  • 8. 8 John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0) Our Agenda: •Context •Problem •Implementation •Consequences •Related Patterns …and what might happen IRL
  • 9. 9 © Frank Schulenburg / CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/) Hard to replace: •Runs vital parts of infrastructure •Original creators no longer around •We will likely make many of the same mistakes (again) •Replacement will take a long time •We can’t introduce new features •Old and new version maintained in parallel •Production data can only be transformed once
  • 10. 10 John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0) Our Agenda: •Context •Problem •Implementation •Consequences •Related Patterns …and what might happen IRL
  • 21. Solution #1: Request Interception (Façade/Proxy) I II III IV V
  • 22. Solution #1: Request Interception (rev2) (Façade/Proxy) « Facade » « Facade » « Facade » « Facade » I II III IV V
  • 23. Solution #2: Event Interception (Message Bus / Queue) I II III IV V
  • 24. 24 John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0) Our Agenda: •Context •Problem •Implementation •Consequences •Related Patterns …and what might happen IRL
  • 25. 25 Nick Youngson CC BY-SA 3.0 Alpha Stock Images Benefits over “big bang” rewrite: •Vital business can run with the least amount of downtime •More frequent releases •Much earlier ROI on new code •Shorter feedback cycles •More fine-grained options, more often: •Some parts of the old system can be left unchanged / omitted •New features possible •Data duplication (vs transformation) allows experiments
  • 26. 26 Drawbacks: •Possibly long time of running systems in parallel •Both systems incur maintenance cost •Political dismay •Migration / synchronisation of legacy data may become a problem
  • 27. 27 John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0) Our Agenda: •Context •Problem •Implementation •Consequences •Related Patterns …and what might happen IRL
  • 28. 28 Related patterns: •Proxy / Facade (GoF) •Event Interception (Martin Fowler) •Asset Capture (Martin Fowler) •Group changes by “entity” (or rather, domain object) ➡ Domain Driven Design! Schnobby / CC BY-SA (https://creativecommons.org/licenses/by-sa/3.0)
  • 29. 29 John Tann from Sydney, Australia / CC BY (https://creativecommons.org/licenses/by/2.0) Our Agenda: •Context •Problem •Implementation •Consequences •Related Patterns …and what might happen IRL
  • 30. 30
  • 31. 31 Bernard DUPONT from FRANCE / CC BY-SA (https://creativecommons.org/licenses/by-sa/2.0) When the rubber hits the road: •New features usually more important than transformation of old bits ➡ Strong focus on replacing legacy system is key •Who decides what’s worth keeping?
  • 32. 32 Graham Horn / CC BY-SA (https://creativecommons.org/licenses/by-sa/2.0) When the rubber hits the road: •Code issues: •No well-defined interfaces in place •Code entangled / hard to change •Knowledge of old system is lost / hard to find •Documentation outdated / missing •People have left the company •Misleading names •Misused / badly implemented design patterns
  • 33. 33 Chadica from Jerusalem, Israel / CC BY (https://creativecommons.org/licenses/by/2.0) When the rubber hits the road: •Code issues: •Hidden / obscured logic in •Frontend •Stored procedures •Dirty hacks •These are all common for legacy code
  • 34. 34 Zach Dischner / CC BY (https://creativecommons.org/licenses/by/2.0) When the rubber hits the road: •Use helpful / well-known patterns to enable strangulation: •Seam (Michael Feathers) •Walking Skeleton (Alistair Cockburn) •Hexagonal Architecture (Alistair Cockburn) •Branch by Abstraction (Jez Humble)
  • 35. 35 …and now: The Most Horrible Code in the World
  • 37. 37 •CMS •Multi-tenancy •Several million € revenue •“histerically grown” since the 1990s •GWT / Vaadin / Java 8 / Tomcat / MySQL / Gradle •CMS with edit/publish/versioning •Uses JSP as template format •Virtual file system •Module expansion system SomeCms
  • 38. 38 •Monorepo •Gradle build runs ca. 25 min. (of which, 23 min. is the test suite) •“Unit tests” that aren’t •All tests are integrated tests •A stripped down, but functional instance of the CMS is injected into the test cases •Test suite only runs as a whole SomeCms
  • 39. 39 •Needs running instance for … well, everything •No well-defined API •Mixes Java / HTML / javascript output and functionality •Makes extensive use of filters / HTTP request/ response manipulation •Method names are obscure (“export”, “processRequest”, …) •Brings its own thread logic, resource locking •Classpath issues •“Event Manager” for batch processes SomeCms
  • 40. 40 •Also rolls its own: •Auth/Permission logic and session handling •JSON serialization •Mail server •Command shell •Hungarian Notation •Everything is static, or final, or both SomeCms
  • 42. 42 SomeCms •Some ideas: •Publishing moves things from a to b. That could become a service. •Publishing could render static HTML •HTTP filters can be used for interception, forward some requests selectively •Perhaps some functionality can be extracted as is, keep using same DB for synchronization •Permissions handling is tricky - switching from sessions to web tokens might be a first step •Finding ways to modularize and speed up the test suite is essential
  • 43. codecentric AG Kreuznacher Str. 30 60846 Frankfurt / Germany Telefon: +49 (0) 151.14965469 Tobias Goeschel Principal Consultant tobias.goeschel@codecentric.de www.codecentric.de Innovative - Trustful - Competent - Pragmatic 43