SlideShare a Scribd company logo
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
Front end microservices: architectures and solution
Microservices
● Single responsibility principle - “granularity”
● Faster developers onboarding
● Faster adding features
● Ease of deployment*
● Freedom to choose technology*
● High scalability
Front end microservices: architectures and solution
Modern frontend
● Complexity
● Size (100s of files, 100s of KLOC)
● Size of the teams (10s developers)
● Technological diversity
● Constant upgrades and migrations
Front end microservices: architectures and solution
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
Front end microservices: architectures and solution
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

More Related Content

PPTX
Micro Front-End & Microservices - Plansoft
PPTX
Microfrontends Monoreops & Trunkbased based
PPTX
Micro frontend architecture_presentation_ssoni
PPTX
Micro-Frontend Architecture
PPTX
Docker 101 : Introduction to Docker and Containers
PDF
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
PPTX
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
PPTX
Jakarta EE 8: Overview of Features
Micro Front-End & Microservices - Plansoft
Microfrontends Monoreops & Trunkbased based
Micro frontend architecture_presentation_ssoni
Micro-Frontend Architecture
Docker 101 : Introduction to Docker and Containers
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
Jakarta EE 8: Overview of Features

What's hot (20)

PPTX
React introduction
PDF
Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019
PPTX
PPTX
Understanding react hooks
PPTX
Introduction To Micro Frontends
PDF
Micro Frontends Architecture
PDF
Mikrofrontend a Module Federation
PPTX
Monoliths and Microservices
PPTX
React Hooks
PDF
React Context API
PPTX
Introduction to react_js
PDF
FEVR - Micro Frontend
PDF
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
PPTX
Solid principles
PDF
Docker Introduction
PDF
Introduction to Hibernate Framework
PDF
Crystal Hirschorn_Building Internal Developer Platforms that will make the en...
PDF
ReactJS presentation
PDF
React Router: React Meetup XXL
PPTX
How to migrate workloads to the google cloud platform
React introduction
Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019
Understanding react hooks
Introduction To Micro Frontends
Micro Frontends Architecture
Mikrofrontend a Module Federation
Monoliths and Microservices
React Hooks
React Context API
Introduction to react_js
FEVR - Micro Frontend
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Solid principles
Docker Introduction
Introduction to Hibernate Framework
Crystal Hirschorn_Building Internal Developer Platforms that will make the en...
ReactJS presentation
React Router: React Meetup XXL
How to migrate workloads to the google cloud platform
Ad

Similar to Front end microservices: architectures and solution (20)

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

More from Mikhail Kuznetcov (7)

PDF
Svelte JS introduction
PDF
Building decentralised apps with js - Devoxx Morocco 2018
PPTX
Vuejs and Web components - current state
PDF
Working with Smart contracts in Javascript
PDF
Web components api + Vuejs
PDF
Vuejs for Angular developers
PPT
Augmented reality : Technology
Svelte JS introduction
Building decentralised apps with js - Devoxx Morocco 2018
Vuejs and Web components - current state
Working with Smart contracts in Javascript
Web components api + Vuejs
Vuejs for Angular developers
Augmented reality : Technology

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Machine Learning_overview_presentation.pptx
PPTX
Cloud computing and distributed systems.
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Network Security Unit 5.pdf for BCA BBA.
Advanced methodologies resolving dimensionality complications for autism neur...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
MYSQL Presentation for SQL database connectivity
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Encapsulation_ Review paper, used for researhc scholars
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Digital-Transformation-Roadmap-for-Companies.pptx
Machine Learning_overview_presentation.pptx
Cloud computing and distributed systems.
sap open course for s4hana steps from ECC to s4
Dropbox Q2 2025 Financial Results & Investor Presentation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Review of recent advances in non-invasive hemoglobin estimation
Network Security Unit 5.pdf for BCA BBA.

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
  • 6. Microservices ● Single responsibility principle - “granularity” ● Faster developers onboarding ● Faster adding features ● Ease of deployment* ● Freedom to choose technology* ● High scalability
  • 9. ● Complexity ● Size (100s of files, 100s of KLOC) ● Size of the teams (10s developers) ● Technological diversity ● Constant upgrades and migrations
  • 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
  • 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