SlideShare a Scribd company logo
Evolving your API Architecture
with the Strangler (Fig) Pattern
Tom Hallam - Freshnode NZ
Limited
August 2020
Who I am
● Full stack engineer and AWS Certified Solution
Architect
● Previously Technical Lead @ Dyson - Smart
Home & IoT
● Stack: Node.js (TS), React, React Native, C#,
Golang
● Moved to NZ in November & in CHCH since
lockdown! :)
What Freshnode does
● Solution Architecture
● IoT Consultancy
● Full-Stack Development
● Contract Tech Leadership
● Coaching
https://freshnode.co.nz
What I am talking about today
● Different architectural patterns, and how you’re probably using one of them
● Why you might consider each pattern
● How to start migrating
● The “Strangler (Fig) Pattern”
What is the “Strangler (Fig) Pattern”?
● Martin Fowler coined the term in 2004 after a trip to
Australia, where he marveled at the Strangler figs.
● They seed in the upper branches of a tree and gradually
work their way down the tree, strangling and killing the
tree that was their host.
● He thought it was an apt description of migrating from
legacy systems to modern ones, incrementally
● He has suggested we call it the “Strangler Fig Pattern” to
avoid the violent connotations!
Read more:
https://martinfowler.com/bliki/StranglerFigApplication.html
Let’s talk
architectural
patterns
Monolithic Architecture
All functionality in one deployable unit.
Controllers, models, services and often the UI in one
large package. One data store for all functions.
Advantages:
● Straightforward to share code
● Quick to get started - traditional approach
● Can be quicker (memory vs RPC)
Disadvantages:
● Overload in one component leads to
degradation in others
● Scale everything or nothing
● Cognitive load is high - side effects
● Tight coupling
Models + Data
Layer
Product Controller
User Controller
UI
Application
Data Store
Microservices Architecture
All functionality in multiple deployable units.
Distinct packages for domain components. Single or
multiple data stores.
Advantages:
● Components can scale independently
● Service only contains code for its domain
● Increased velocity (CI/CD)
● Easier cross-team working
● Loose coupling
Disadvantages:
● Initially higher cognitive load
● Sometimes unclear where to put certain
functionality - e.g. which service manages a
User’s Products?
User Service
+ Models
Product Service
+ Models
Public API
Service
(Facade)
(Or Hosted Gateway)
UI
User Data Store
Product Data Store
Internal API
Why would I migrate?
● You can scale features independently
● Improve utilisation (+cost) - size the underlying resources for each use case
● Improved security - a breach of one service doesn’t hand the attacker the keys to
the rest (if you’ve architected your services correctly)
● Easier cross team working - distinct, known responsibilities improves velocity
● Easier to test single features locally
But Tom … Migrating the whole system sounds hard..
Don’t worry - we’ve got the Strangler (Fig) Pattern!
In practice:
Incrementally migrate a legacy system by gradually replacing specific pieces of functionality with new applications and services. As
features from the legacy system are replaced, the new system eventually replaces all of the old system's features, strangling the old
system and allowing you to decommission it.
Source: https://docs.microsoft.com/en-us/azure/architecture/patterns/strangler
It’s ok - you
probably use this
pattern every day!
But inside your services, rather than around them!
In our example...
1. Lift the user controller and required
functionality to a seperate deployable
service
2. Update services (+ UI if server-rendered) in
the existing application to call an API rather
than a local function
3. If UI is a single page app, update the UI to call
the User Service API instead of the main
application API
Models + Data
Layer
Product Controller
UI
Existing Application
Data Store
User Service
+ Models
User Data Store
Shiny new service
And continue with the other controllers/functions..
In our example...
UI
Existing Application
Data Store
User Service
+ Models
User Data Store
Shiny new service
Product Service
+ Models
Product Data Store
Another new service
1. Lift the user controller and required
functionality to a seperate deployable
service
2. Update services (+ UI if server-rendered) in
the existing application to call an API rather
than a local function
3. If UI is a single page app, update the UI to call
the User Service API instead of the main
application API
And continue with the other controllers/functions..
Eventually leading to...
User Service
+ Models
Product Service
+ Models
Public API
Service
(Or Hosted Gateway)
UI
User Data Store
Product Data Store
Internal API
Demo
(uh oh!)
Questions?

More Related Content

What's hot

CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CodeOps Technologies LLP
 
Introduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeopleIntroduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeople
SpringPeople
 
Build Proactive bot using Microsoft Bot Framework
Build Proactive bot using Microsoft Bot FrameworkBuild Proactive bot using Microsoft Bot Framework
Build Proactive bot using Microsoft Bot Framework
Sri Kanth
 
Easy Microservices with JHipster - Devoxx BE 2017
Easy Microservices with JHipster - Devoxx BE 2017Easy Microservices with JHipster - Devoxx BE 2017
Easy Microservices with JHipster - Devoxx BE 2017
Deepu K Sasidharan
 
Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure Functions
Pushkar Saraf
 
IoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
IoT and Serverless - AWS - Serverless Summit - Madhusudan ShekarIoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
IoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
CodeOps Technologies LLP
 
React native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile AppsReact native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile Apps
Jimit Shah
 
UK Azure User Group - Blazor and Azure (Tim Ebenezer)
UK Azure User Group - Blazor and Azure (Tim Ebenezer)UK Azure User Group - Blazor and Azure (Tim Ebenezer)
UK Azure User Group - Blazor and Azure (Tim Ebenezer)
Richard Conway
 
From PowerShell Function to Serverless code with Azure Functions
From PowerShell Function to Serverless code with Azure FunctionsFrom PowerShell Function to Serverless code with Azure Functions
From PowerShell Function to Serverless code with Azure Functions
Jaap Brasser
 
Mobx Internals
Mobx InternalsMobx Internals
Mobx Internals
500Tech
 
Monitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
Monitor Azure Kubernetes Cluster With Prometheus by Mamta JhaMonitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
Monitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
CodeOps Technologies LLP
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
Mike Melusky
 
Serverless in Azure with Functions
Serverless in Azure with FunctionsServerless in Azure with Functions
Serverless in Azure with Functions
Christos Matskas
 
Kubernetes, Istio e Knative: The new cloud stack
Kubernetes, Istio e Knative: The new cloud stackKubernetes, Istio e Knative: The new cloud stack
Kubernetes, Istio e Knative: The new cloud stack
Luram Archanjo
 
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
CodeOps Technologies LLP
 
Discover Microsoft's Cloud Automation Suite
Discover Microsoft's Cloud Automation SuiteDiscover Microsoft's Cloud Automation Suite
Discover Microsoft's Cloud Automation Suite
Jaap Brasser
 
Vincent biret azure functions and flow (toronto)
Vincent biret azure functions and flow (toronto)Vincent biret azure functions and flow (toronto)
Vincent biret azure functions and flow (toronto)
Vincent Biret
 
Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)
Vincent Biret
 
Integration Services Presentation V2
Integration Services Presentation V2Integration Services Presentation V2
Integration Services Presentation V2
Catherine Eibner
 
Integration Services Presentation
Integration Services PresentationIntegration Services Presentation
Integration Services Presentation
Catherine Eibner
 

What's hot (20)

CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
 
Introduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeopleIntroduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeople
 
Build Proactive bot using Microsoft Bot Framework
Build Proactive bot using Microsoft Bot FrameworkBuild Proactive bot using Microsoft Bot Framework
Build Proactive bot using Microsoft Bot Framework
 
Easy Microservices with JHipster - Devoxx BE 2017
Easy Microservices with JHipster - Devoxx BE 2017Easy Microservices with JHipster - Devoxx BE 2017
Easy Microservices with JHipster - Devoxx BE 2017
 
Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure Functions
 
IoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
IoT and Serverless - AWS - Serverless Summit - Madhusudan ShekarIoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
IoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
 
React native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile AppsReact native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile Apps
 
UK Azure User Group - Blazor and Azure (Tim Ebenezer)
UK Azure User Group - Blazor and Azure (Tim Ebenezer)UK Azure User Group - Blazor and Azure (Tim Ebenezer)
UK Azure User Group - Blazor and Azure (Tim Ebenezer)
 
From PowerShell Function to Serverless code with Azure Functions
From PowerShell Function to Serverless code with Azure FunctionsFrom PowerShell Function to Serverless code with Azure Functions
From PowerShell Function to Serverless code with Azure Functions
 
Mobx Internals
Mobx InternalsMobx Internals
Mobx Internals
 
Monitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
Monitor Azure Kubernetes Cluster With Prometheus by Mamta JhaMonitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
Monitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Serverless in Azure with Functions
Serverless in Azure with FunctionsServerless in Azure with Functions
Serverless in Azure with Functions
 
Kubernetes, Istio e Knative: The new cloud stack
Kubernetes, Istio e Knative: The new cloud stackKubernetes, Istio e Knative: The new cloud stack
Kubernetes, Istio e Knative: The new cloud stack
 
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
 
Discover Microsoft's Cloud Automation Suite
Discover Microsoft's Cloud Automation SuiteDiscover Microsoft's Cloud Automation Suite
Discover Microsoft's Cloud Automation Suite
 
Vincent biret azure functions and flow (toronto)
Vincent biret azure functions and flow (toronto)Vincent biret azure functions and flow (toronto)
Vincent biret azure functions and flow (toronto)
 
Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)
 
Integration Services Presentation V2
Integration Services Presentation V2Integration Services Presentation V2
Integration Services Presentation V2
 
Integration Services Presentation
Integration Services PresentationIntegration Services Presentation
Integration Services Presentation
 

Similar to Evolving your api architecture with the strangler pattern

Creating a SPA blog withAngular and Cloud Firestore
Creating a SPA blog withAngular and Cloud FirestoreCreating a SPA blog withAngular and Cloud Firestore
Creating a SPA blog withAngular and Cloud Firestore
TMME - TECH MEETUP FOR MYANMAR ENGINEERS IN JP
 
PureMVC
PureMVCPureMVC
Building scalable applications with angular js
Building scalable applications with angular jsBuilding scalable applications with angular js
Building scalable applications with angular js
Andrew Alpert
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
Hojoong Kim
 
Evolving to Cloud-Native - Nate Schutta (1/2)
Evolving to Cloud-Native - Nate Schutta (1/2)Evolving to Cloud-Native - Nate Schutta (1/2)
Evolving to Cloud-Native - Nate Schutta (1/2)
VMware Tanzu
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
Matthias Noback
 
Intro to OpenShift, MongoDB Atlas & Live Demo
Intro to OpenShift, MongoDB Atlas & Live DemoIntro to OpenShift, MongoDB Atlas & Live Demo
Intro to OpenShift, MongoDB Atlas & Live Demo
MongoDB
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arp
Gary Pedretti
 
Evolving Services Into A Cloud Native World
Evolving Services Into A Cloud Native WorldEvolving Services Into A Cloud Native World
Evolving Services Into A Cloud Native World
Iain Hull
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
Decision Science Community
 
Evolving to Cloud-Native - Nate Schutta 1/2
Evolving to Cloud-Native - Nate Schutta 1/2Evolving to Cloud-Native - Nate Schutta 1/2
Evolving to Cloud-Native - Nate Schutta 1/2
VMware Tanzu
 
Angular js firebase-preso
Angular js firebase-presoAngular js firebase-preso
Angular js firebase-preso
Avinash Kondagunta
 
Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!
pflueras
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructure
Yshay Yaacobi
 
Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)
Brian Brazil
 
Skynet project: Monitor, analyze, scale, and maintain a system in the Cloud
Skynet project: Monitor, analyze, scale, and maintain a system in the CloudSkynet project: Monitor, analyze, scale, and maintain a system in the Cloud
Skynet project: Monitor, analyze, scale, and maintain a system in the Cloud
Sylvain Kalache
 
Google cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGoogle cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptx
GDSCNiT
 
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and MicroservicesRedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
Redis Labs
 
The working architecture of node js applications open tech week javascript ...
The working architecture of node js applications   open tech week javascript ...The working architecture of node js applications   open tech week javascript ...
The working architecture of node js applications open tech week javascript ...
Viktor Turskyi
 
The working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор ТурскийThe working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор Турский
Sigma Software
 

Similar to Evolving your api architecture with the strangler pattern (20)

Creating a SPA blog withAngular and Cloud Firestore
Creating a SPA blog withAngular and Cloud FirestoreCreating a SPA blog withAngular and Cloud Firestore
Creating a SPA blog withAngular and Cloud Firestore
 
PureMVC
PureMVCPureMVC
PureMVC
 
Building scalable applications with angular js
Building scalable applications with angular jsBuilding scalable applications with angular js
Building scalable applications with angular js
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
 
Evolving to Cloud-Native - Nate Schutta (1/2)
Evolving to Cloud-Native - Nate Schutta (1/2)Evolving to Cloud-Native - Nate Schutta (1/2)
Evolving to Cloud-Native - Nate Schutta (1/2)
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
Intro to OpenShift, MongoDB Atlas & Live Demo
Intro to OpenShift, MongoDB Atlas & Live DemoIntro to OpenShift, MongoDB Atlas & Live Demo
Intro to OpenShift, MongoDB Atlas & Live Demo
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arp
 
Evolving Services Into A Cloud Native World
Evolving Services Into A Cloud Native WorldEvolving Services Into A Cloud Native World
Evolving Services Into A Cloud Native World
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
 
Evolving to Cloud-Native - Nate Schutta 1/2
Evolving to Cloud-Native - Nate Schutta 1/2Evolving to Cloud-Native - Nate Schutta 1/2
Evolving to Cloud-Native - Nate Schutta 1/2
 
Angular js firebase-preso
Angular js firebase-presoAngular js firebase-preso
Angular js firebase-preso
 
Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructure
 
Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)
 
Skynet project: Monitor, analyze, scale, and maintain a system in the Cloud
Skynet project: Monitor, analyze, scale, and maintain a system in the CloudSkynet project: Monitor, analyze, scale, and maintain a system in the Cloud
Skynet project: Monitor, analyze, scale, and maintain a system in the Cloud
 
Google cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGoogle cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptx
 
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and MicroservicesRedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
 
The working architecture of node js applications open tech week javascript ...
The working architecture of node js applications   open tech week javascript ...The working architecture of node js applications   open tech week javascript ...
The working architecture of node js applications open tech week javascript ...
 
The working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор ТурскийThe working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор Турский
 

Recently uploaded

socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 

Recently uploaded (20)

socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 

Evolving your api architecture with the strangler pattern

  • 1. Evolving your API Architecture with the Strangler (Fig) Pattern Tom Hallam - Freshnode NZ Limited August 2020
  • 2. Who I am ● Full stack engineer and AWS Certified Solution Architect ● Previously Technical Lead @ Dyson - Smart Home & IoT ● Stack: Node.js (TS), React, React Native, C#, Golang ● Moved to NZ in November & in CHCH since lockdown! :)
  • 3. What Freshnode does ● Solution Architecture ● IoT Consultancy ● Full-Stack Development ● Contract Tech Leadership ● Coaching https://freshnode.co.nz
  • 4. What I am talking about today ● Different architectural patterns, and how you’re probably using one of them ● Why you might consider each pattern ● How to start migrating ● The “Strangler (Fig) Pattern”
  • 5. What is the “Strangler (Fig) Pattern”? ● Martin Fowler coined the term in 2004 after a trip to Australia, where he marveled at the Strangler figs. ● They seed in the upper branches of a tree and gradually work their way down the tree, strangling and killing the tree that was their host. ● He thought it was an apt description of migrating from legacy systems to modern ones, incrementally ● He has suggested we call it the “Strangler Fig Pattern” to avoid the violent connotations! Read more: https://martinfowler.com/bliki/StranglerFigApplication.html
  • 7. Monolithic Architecture All functionality in one deployable unit. Controllers, models, services and often the UI in one large package. One data store for all functions. Advantages: ● Straightforward to share code ● Quick to get started - traditional approach ● Can be quicker (memory vs RPC) Disadvantages: ● Overload in one component leads to degradation in others ● Scale everything or nothing ● Cognitive load is high - side effects ● Tight coupling Models + Data Layer Product Controller User Controller UI Application Data Store
  • 8. Microservices Architecture All functionality in multiple deployable units. Distinct packages for domain components. Single or multiple data stores. Advantages: ● Components can scale independently ● Service only contains code for its domain ● Increased velocity (CI/CD) ● Easier cross-team working ● Loose coupling Disadvantages: ● Initially higher cognitive load ● Sometimes unclear where to put certain functionality - e.g. which service manages a User’s Products? User Service + Models Product Service + Models Public API Service (Facade) (Or Hosted Gateway) UI User Data Store Product Data Store Internal API
  • 9. Why would I migrate? ● You can scale features independently ● Improve utilisation (+cost) - size the underlying resources for each use case ● Improved security - a breach of one service doesn’t hand the attacker the keys to the rest (if you’ve architected your services correctly) ● Easier cross team working - distinct, known responsibilities improves velocity ● Easier to test single features locally
  • 10. But Tom … Migrating the whole system sounds hard..
  • 11. Don’t worry - we’ve got the Strangler (Fig) Pattern! In practice: Incrementally migrate a legacy system by gradually replacing specific pieces of functionality with new applications and services. As features from the legacy system are replaced, the new system eventually replaces all of the old system's features, strangling the old system and allowing you to decommission it. Source: https://docs.microsoft.com/en-us/azure/architecture/patterns/strangler
  • 12. It’s ok - you probably use this pattern every day! But inside your services, rather than around them!
  • 13. In our example... 1. Lift the user controller and required functionality to a seperate deployable service 2. Update services (+ UI if server-rendered) in the existing application to call an API rather than a local function 3. If UI is a single page app, update the UI to call the User Service API instead of the main application API Models + Data Layer Product Controller UI Existing Application Data Store User Service + Models User Data Store Shiny new service And continue with the other controllers/functions..
  • 14. In our example... UI Existing Application Data Store User Service + Models User Data Store Shiny new service Product Service + Models Product Data Store Another new service 1. Lift the user controller and required functionality to a seperate deployable service 2. Update services (+ UI if server-rendered) in the existing application to call an API rather than a local function 3. If UI is a single page app, update the UI to call the User Service API instead of the main application API And continue with the other controllers/functions..
  • 15. Eventually leading to... User Service + Models Product Service + Models Public API Service (Or Hosted Gateway) UI User Data Store Product Data Store Internal API
  • 16.