SlideShare uma empresa Scribd logo
1 de 37
Baixar para ler offline
Microservices in frontend:
architectures and solutions
Mikhail Kuznetcov, ING
Mikhail Kuznetcov
Dev engineer at ING
Twitter: @legkoletat
Github: github.com/shershen08
Agenda
Agenda
● Microservices
● Modern frontend
● Microservice-oriented frontend solutions
● Challenges and conclusion
Microservices
Microservices
● Single responsibility principle - “granularity”
● Faster developers onboarding
● Faster adding features
● Ease of deployment*
● Freedom to choose technology*
● High scalability
Modern frontend
● Complexity
● Size (100s of files, 100s of KLOC)
● Size of the teams (10s developers)
● Technological diversity
● Constant upgrades and migrations
History
2010
BigPipe by Facebook
2016
Micro-frontends.org
Mosaic project
2017
Adoption of Web components
2019
thoughtworks.com/radar/te
chniques/micro-frontends
Architectures
FRONTEND
BACKEND
App1 App2 App3
Infra (BE4FE, NGNIX, etc)
MS1
MS2
MS3
MS5
MS4
MS6
FRONTEND
+
BACKEND
Solutions
Solutions overview
● In-browser: single-spa
● Server-side: tailor
● iFrames & per-route apps
● Web components as wrapper
In-browser: Single-spa
github.com/CanopyTax/single-spa
● In browser
● Lazy load
● Parts of one page & separate routes
● Share styles, utils, data, events etc.
● Unified lifecycle
@legkoletat | Microservices in frontend: architectures and solutions
Schema #1: Single-spa
Widget
app 1
Widget
app 2
Dashboard app
Single-spa
+ config
Header
app
index.html
Single-spa: root config
//single-spa-config.js
import {declareChildApplication, start} from 'single-spa';
declareChildApplication('app-user-profile', () =>
import('PATH_TO/app.user.profile.js'),pathPrefix('/profile’));
declareChildApplication('app-transactions', () =>
import('PATH_TO/app.transactions.js'),pathPrefix('/transactions’));
//etc
start();
Single-spa: configure app
// app-user-profile.js
export function bootstrap(props) {
return Promise
.resolve()
.then(() => {
// one-time app initialization code
});
}
//mount callback
//unmount callback
Stitching fragments
github.com/zalando/tailor
● Backend powered (NodeJS)
● Serves parts of one page
● Provides complete toolset - Mosaic
Widget
app 1
Schema #2: Tailor
github.com/shershen08/tailor-vue-demo
Widget
app 2
Dashboard app
Tailor +
Webserver
Header
app
HTML-like
template
@legkoletat | Microservices in frontend: architectures and solutions
Tailor server
const Tailor = require('node-tailor');
const tailor = new Tailor({
templatesPath: '/built-apps-folder'
});
const server = http.createServer((req, res) => {
// custom server logic
tailor.requestHandler(req, res)
})
server.listen(process.env.PORT);
Tailor template
<body>
<!-- header -->
<div id="header">
<span class="fragment-error">Header failed to load</span>
</div>
<fragment src="https://abs123.company.internal.com"></fragment>
<!-- dashboard -->
<fragment src="https://dashb22.company.internal.com" primary>
</fragment>
Tailor app setup
"scripts": {
"start": "npm run start-fragments & node tailor.js",
"install-fragment-dependencies": "lerna bootstrap",
"build-fragments": "lerna run build",
"start-fragments": "lerna run --parallel start",
"watch-fragments": "lerna run --parallel dev"
},
App1 app1.min.js assets/
Serve to tailor
Single repo per app:
Or in monorepo:
Pipeline
Single app per route
● Easy to setup
● No direct interaction
● Transfer state
● Control styles
Image from Elisabeth Engel: Break Up With Your Frontend Monolith
iFrames
● Security
● Content adjustment - size, scroll
● Data exchange (via postMessage)
● Control styles
//app 1
window.addEventListener("message", receiveMessage, false);
//app 2
window.postMessage("hello there!", "http://example.com");
Widget
app 1
Schema #3: App per route & iframe
Widget app
2
Dashboard
app
Header
app
Separate repos,
pipelines, etc
Header
No SPA
State: via server or request
params
Framework + Web components
● WCs in 2019 are widespread and supported
● DOM & styles can be isolated
● From apps to single components
Framework + Web components
github.com/vuejs/vue-web-component-wrapper
Example for Vue, same can be for Angular, React, Svelte, etc
Glimpse of future: Portals
<portal id="myPortal" src="https://www.example.com/"></portal>
github.com/WICG/
Secure and seamless navigation
Portal can be activated
myPortal.activate({ data: [...] });
Other document (portal) listens to activation, loads data and react
window.addEventListener('portalactivate', e => {
let predecessor = e.adoptPredecessor(document);
//etc
Challenges &
conclusions
Technical challenges
● More complex setup
● Managing state and passing data & events
● Predictable and reusable styles
● Page code size (TTI, loading, debugging)
var bus = new EventBus();
bus.on('someEvent', function (data) {
console.log('got ' + data);
});
bus.on('someEvent', function foo () {
bus.off('someEvent', foo);
});
Non-technical challenges
● Onboarding new developers
● Team composition
● Knowledge transfer
● More moving parts (compatibility, upgrades)
Pros
Single Responsibility Principle
Fast onboarding and adding features
Ease of testing, deployment
Freedom to choose technology
@legkoletat | Microservices in frontend: architectures and solutions
Do you really need this?
1. Business profile
2. Application usage profile
3. Size of codebase
4. Infrastructure
5. Size, stablity and maturity of team
Thank you! Questions?
Presentation PDF on Slideshare

Mais conteúdo relacionado

Mais procurados

ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewShahed Chowdhuri
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservicesAnil Allewar
 
Messaging in CQRS with MassTransit
Messaging in CQRS with MassTransitMessaging in CQRS with MassTransit
Messaging in CQRS with MassTransitGeorge Tourkas
 
Get Started with ReactJS 18 Development Services_ New Features and Updates.pptx
Get Started with ReactJS 18 Development Services_ New Features and Updates.pptxGet Started with ReactJS 18 Development Services_ New Features and Updates.pptx
Get Started with ReactJS 18 Development Services_ New Features and Updates.pptxConcetto Labs
 
NGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for KubernetesNGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for KubernetesNGINX, Inc.
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
Different types of virtualisation
Different types of virtualisationDifferent types of virtualisation
Different types of virtualisationAlessandro Guli
 
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)Tech Triveni
 
Continuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarContinuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarPascal Larocque
 

Mais procurados (20)

ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 
Micro frontends
Micro frontendsMicro frontends
Micro frontends
 
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJSMicro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
 
Micro Frontends
Micro FrontendsMicro Frontends
Micro Frontends
 
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Virtualisation basics
Virtualisation basicsVirtualisation basics
Virtualisation basics
 
Android MVVM
Android MVVMAndroid MVVM
Android MVVM
 
Messaging in CQRS with MassTransit
Messaging in CQRS with MassTransitMessaging in CQRS with MassTransit
Messaging in CQRS with MassTransit
 
Get Started with ReactJS 18 Development Services_ New Features and Updates.pptx
Get Started with ReactJS 18 Development Services_ New Features and Updates.pptxGet Started with ReactJS 18 Development Services_ New Features and Updates.pptx
Get Started with ReactJS 18 Development Services_ New Features and Updates.pptx
 
NGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for KubernetesNGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for Kubernetes
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Micro frontend
Micro frontendMicro frontend
Micro frontend
 
Different types of virtualisation
Different types of virtualisationDifferent types of virtualisation
Different types of virtualisation
 
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)
 
Why Microservices
Why MicroservicesWhy Microservices
Why Microservices
 
Continuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarContinuous integration using Jenkins and Sonar
Continuous integration using Jenkins and Sonar
 
Azure Container Services
Azure Container Services Azure Container Services
Azure Container Services
 
What is Virtualization
What is VirtualizationWhat is Virtualization
What is Virtualization
 
Micro-frontend
Micro-frontendMicro-frontend
Micro-frontend
 

Semelhante a Front end microservices: architectures and solution

Frontend microservices: architectures and solutions
Frontend microservices: architectures and solutionsFrontend microservices: architectures and solutions
Frontend microservices: architectures and solutionsMikhail Kuznetcov
 
Magnificent Meteor -By Dipali Vyas (PM Zestard Technologies) for GDG Ahmedaba...
Magnificent Meteor -By Dipali Vyas (PM Zestard Technologies) for GDG Ahmedaba...Magnificent Meteor -By Dipali Vyas (PM Zestard Technologies) for GDG Ahmedaba...
Magnificent Meteor -By Dipali Vyas (PM Zestard Technologies) for GDG Ahmedaba...Dipali Vyas
 
Micro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniMicro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniSandeep Soni
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)Alex Ross
 
JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendJSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendVlad Fedosov
 
Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Bruce Pentreath
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JSFestUA
 
PhoneGap Framework for smartphone app developement
PhoneGap Framework for smartphone app developementPhoneGap Framework for smartphone app developement
PhoneGap Framework for smartphone app developementTrieu Nguyen
 
Front end microservices - October 2019
Front end microservices - October 2019Front end microservices - October 2019
Front end microservices - October 2019Mikhail Kuznetcov
 
Struts natraj - satya
Struts   natraj - satyaStruts   natraj - satya
Struts natraj - satyaSatya Johnny
 
Angular 1.x reloaded: improve your app now! and get ready for 2.0
Angular 1.x reloaded:  improve your app now! and get ready for 2.0Angular 1.x reloaded:  improve your app now! and get ready for 2.0
Angular 1.x reloaded: improve your app now! and get ready for 2.0Carlo Bonamico
 
Workshop About Software Engineering Skills 2019
Workshop About Software Engineering Skills 2019Workshop About Software Engineering Skills 2019
Workshop About Software Engineering Skills 2019PhuocNT (Fresher.VN)
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Jonas Bandi
 
Javaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedJavaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedpgt technology scouting GmbH
 
How to migrate large project from Angular to React
How to migrate large project from Angular to ReactHow to migrate large project from Angular to React
How to migrate large project from Angular to ReactTomasz Bak
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraLINAGORA
 
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechVue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechDivante
 

Semelhante a Front end microservices: architectures and solution (20)

Frontend microservices: architectures and solutions
Frontend microservices: architectures and solutionsFrontend microservices: architectures and solutions
Frontend microservices: architectures and solutions
 
Magnificent Meteor -By Dipali Vyas (PM Zestard Technologies) for GDG Ahmedaba...
Magnificent Meteor -By Dipali Vyas (PM Zestard Technologies) for GDG Ahmedaba...Magnificent Meteor -By Dipali Vyas (PM Zestard Technologies) for GDG Ahmedaba...
Magnificent Meteor -By Dipali Vyas (PM Zestard Technologies) for GDG Ahmedaba...
 
Micro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniMicro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoni
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)
 
JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendJSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontend
 
Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
 
PhoneGap Framework for smartphone app developement
PhoneGap Framework for smartphone app developementPhoneGap Framework for smartphone app developement
PhoneGap Framework for smartphone app developement
 
Front end microservices - October 2019
Front end microservices - October 2019Front end microservices - October 2019
Front end microservices - October 2019
 
Struts natraj - satya
Struts   natraj - satyaStruts   natraj - satya
Struts natraj - satya
 
Struts natraj - satya
Struts   natraj - satyaStruts   natraj - satya
Struts natraj - satya
 
Struts notes
Struts notesStruts notes
Struts notes
 
Angular 1.x reloaded: improve your app now! and get ready for 2.0
Angular 1.x reloaded:  improve your app now! and get ready for 2.0Angular 1.x reloaded:  improve your app now! and get ready for 2.0
Angular 1.x reloaded: improve your app now! and get ready for 2.0
 
Micro Frontends
Micro FrontendsMicro Frontends
Micro Frontends
 
Workshop About Software Engineering Skills 2019
Workshop About Software Engineering Skills 2019Workshop About Software Engineering Skills 2019
Workshop About Software Engineering Skills 2019
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!
 
Javaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedJavaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learned
 
How to migrate large project from Angular to React
How to migrate large project from Angular to ReactHow to migrate large project from Angular to React
How to migrate large project from Angular to React
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
 
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechVue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
 

Mais de Mikhail Kuznetcov

Building decentralised apps with js - Devoxx Morocco 2018
Building decentralised apps with js - Devoxx Morocco 2018Building decentralised apps with js - Devoxx Morocco 2018
Building decentralised apps with js - Devoxx Morocco 2018Mikhail Kuznetcov
 
Vuejs and Web components - current state
Vuejs and Web components - current stateVuejs and Web components - current state
Vuejs and Web components - current stateMikhail Kuznetcov
 
Working with Smart contracts in Javascript
Working with Smart contracts in JavascriptWorking with Smart contracts in Javascript
Working with Smart contracts in JavascriptMikhail Kuznetcov
 
Vuejs for Angular developers
Vuejs for Angular developersVuejs for Angular developers
Vuejs for Angular developersMikhail Kuznetcov
 
Augmented reality : Technology
Augmented reality : TechnologyAugmented reality : Technology
Augmented reality : TechnologyMikhail Kuznetcov
 

Mais de Mikhail Kuznetcov (7)

Svelte JS introduction
Svelte JS introductionSvelte JS introduction
Svelte JS introduction
 
Building decentralised apps with js - Devoxx Morocco 2018
Building decentralised apps with js - Devoxx Morocco 2018Building decentralised apps with js - Devoxx Morocco 2018
Building decentralised apps with js - Devoxx Morocco 2018
 
Vuejs and Web components - current state
Vuejs and Web components - current stateVuejs and Web components - current state
Vuejs and Web components - current state
 
Working with Smart contracts in Javascript
Working with Smart contracts in JavascriptWorking with Smart contracts in Javascript
Working with Smart contracts in Javascript
 
Web components api + Vuejs
Web components api + VuejsWeb components api + Vuejs
Web components api + Vuejs
 
Vuejs for Angular developers
Vuejs for Angular developersVuejs for Angular developers
Vuejs for Angular developers
 
Augmented reality : Technology
Augmented reality : TechnologyAugmented reality : Technology
Augmented reality : Technology
 

Último

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Front end microservices: architectures and solution

  • 1. Microservices in frontend: architectures and solutions Mikhail Kuznetcov, ING
  • 2. Mikhail Kuznetcov Dev engineer at ING Twitter: @legkoletat Github: github.com/shershen08 Agenda
  • 3. Agenda ● Microservices ● Modern frontend ● Microservice-oriented frontend solutions ● Challenges and conclusion
  • 5.
  • 6. Microservices ● Single responsibility principle - “granularity” ● Faster developers onboarding ● Faster adding features ● Ease of deployment* ● Freedom to choose technology* ● High scalability
  • 7.
  • 9. ● Complexity ● Size (100s of files, 100s of KLOC) ● Size of the teams (10s developers) ● Technological diversity ● Constant upgrades and migrations
  • 10.
  • 11. History 2010 BigPipe by Facebook 2016 Micro-frontends.org Mosaic project 2017 Adoption of Web components
  • 13. Architectures FRONTEND BACKEND App1 App2 App3 Infra (BE4FE, NGNIX, etc) MS1 MS2 MS3 MS5 MS4 MS6 FRONTEND + BACKEND
  • 15. Solutions overview ● In-browser: single-spa ● Server-side: tailor ● iFrames & per-route apps ● Web components as wrapper
  • 16. In-browser: Single-spa github.com/CanopyTax/single-spa ● In browser ● Lazy load ● Parts of one page & separate routes ● Share styles, utils, data, events etc. ● Unified lifecycle @legkoletat | Microservices in frontend: architectures and solutions
  • 17. Schema #1: Single-spa Widget app 1 Widget app 2 Dashboard app Single-spa + config Header app index.html
  • 18. Single-spa: root config //single-spa-config.js import {declareChildApplication, start} from 'single-spa'; declareChildApplication('app-user-profile', () => import('PATH_TO/app.user.profile.js'),pathPrefix('/profile’)); declareChildApplication('app-transactions', () => import('PATH_TO/app.transactions.js'),pathPrefix('/transactions’)); //etc start();
  • 19. Single-spa: configure app // app-user-profile.js export function bootstrap(props) { return Promise .resolve() .then(() => { // one-time app initialization code }); } //mount callback //unmount callback
  • 20. Stitching fragments github.com/zalando/tailor ● Backend powered (NodeJS) ● Serves parts of one page ● Provides complete toolset - Mosaic
  • 21. Widget app 1 Schema #2: Tailor github.com/shershen08/tailor-vue-demo Widget app 2 Dashboard app Tailor + Webserver Header app HTML-like template @legkoletat | Microservices in frontend: architectures and solutions
  • 22. Tailor server const Tailor = require('node-tailor'); const tailor = new Tailor({ templatesPath: '/built-apps-folder' }); const server = http.createServer((req, res) => { // custom server logic tailor.requestHandler(req, res) }) server.listen(process.env.PORT);
  • 23. Tailor template <body> <!-- header --> <div id="header"> <span class="fragment-error">Header failed to load</span> </div> <fragment src="https://abs123.company.internal.com"></fragment> <!-- dashboard --> <fragment src="https://dashb22.company.internal.com" primary> </fragment>
  • 24. Tailor app setup "scripts": { "start": "npm run start-fragments & node tailor.js", "install-fragment-dependencies": "lerna bootstrap", "build-fragments": "lerna run build", "start-fragments": "lerna run --parallel start", "watch-fragments": "lerna run --parallel dev" }, App1 app1.min.js assets/ Serve to tailor Single repo per app: Or in monorepo: Pipeline
  • 25. Single app per route ● Easy to setup ● No direct interaction ● Transfer state ● Control styles Image from Elisabeth Engel: Break Up With Your Frontend Monolith
  • 26. iFrames ● Security ● Content adjustment - size, scroll ● Data exchange (via postMessage) ● Control styles //app 1 window.addEventListener("message", receiveMessage, false); //app 2 window.postMessage("hello there!", "http://example.com");
  • 27. Widget app 1 Schema #3: App per route & iframe Widget app 2 Dashboard app Header app Separate repos, pipelines, etc Header No SPA State: via server or request params
  • 28. Framework + Web components ● WCs in 2019 are widespread and supported ● DOM & styles can be isolated ● From apps to single components
  • 29. Framework + Web components github.com/vuejs/vue-web-component-wrapper Example for Vue, same can be for Angular, React, Svelte, etc
  • 30. Glimpse of future: Portals <portal id="myPortal" src="https://www.example.com/"></portal> github.com/WICG/ Secure and seamless navigation Portal can be activated myPortal.activate({ data: [...] }); Other document (portal) listens to activation, loads data and react window.addEventListener('portalactivate', e => { let predecessor = e.adoptPredecessor(document); //etc
  • 32.
  • 33. Technical challenges ● More complex setup ● Managing state and passing data & events ● Predictable and reusable styles ● Page code size (TTI, loading, debugging) var bus = new EventBus(); bus.on('someEvent', function (data) { console.log('got ' + data); }); bus.on('someEvent', function foo () { bus.off('someEvent', foo); });
  • 34. Non-technical challenges ● Onboarding new developers ● Team composition ● Knowledge transfer ● More moving parts (compatibility, upgrades)
  • 35. Pros Single Responsibility Principle Fast onboarding and adding features Ease of testing, deployment Freedom to choose technology @legkoletat | Microservices in frontend: architectures and solutions
  • 36. Do you really need this? 1. Business profile 2. Application usage profile 3. Size of codebase 4. Infrastructure 5. Size, stablity and maturity of team