bye bye frontend monolith
accelerating feature development with micro frontends
#PhillyETE / Emerging Technologies for the Enterprise 2021
Michael Geers / @naltatis
Slide 2
Breaking up the Monolith
Slide 3
Ne
Tren
The Frontend Monolith
d
w
presented by
Slide 4
popular architectures nowadays
Michael Geers / @naltatis
Slide 5
Micro Frontends
Slide 6
Michael Geers frontend engineer
naltatis
Twitter & GitHub author of the book
Micro Frontends in Action and the website micro-frontends.org building tailored e-commerce systems
A De nition 1/3 Our preferred (and proven) approach is to split the browser-based code into micro frontends. In this approach, the web application is broken down into its features, and each feature is owned, frontend to backend, by a different team. This ensures that every feature is developed, tested and deployed independently from other features. β¦
fi
source: ThoughtWorks Technology Radar
Michael Geers / @naltatis
Slide 11
A De nition 1/3 Our preferred (and proven) approach is to split the browser-based code into micro frontends. In this approach, the web application is broken down into its features, and each feature is owned, frontend to backend, by a different team. This ensures that every feature is developed, tested and deployed independently from other features. β¦
fi
source: ThoughtWorks Technology Radar
Michael Geers / @naltatis
teams can own one or more pages Customer Journey 1
1
1
2
2 33 $ 66 $
$$
66 $
%%
99 $
home
list
Team Inspire
illustration: Micro Frontends in Action
detail
Team Decide
buy
basket
payment
confirm
Team Checkout
Michael Geers / @naltatis
Slide 15
fragments are embedded mini-applications Team Decide
Team Inspire
Fragment
Page
Team Checkout illustration: Micro Frontends in Action
Fragment Michael Geers / @naltatis
Slide 16
A De nition 2/3 Our preferred (and proven) approach is to split the browser-based code into micro frontends. In this approach, the web application is broken down into its features, and each feature is owned, frontend to backend, by a different team. This ensures that every feature is developed, tested and deployed independently from other features. β¦
fi
source: ThoughtWorks Technology Radar
Michael Geers / @naltatis
Slide 17
Team Missions
illustration: Micro Frontends in Action
Michael Geers / @naltatis
Slide 18
Independent Teams & Systems Cross Functional Teams ux/design, frontend backend, data science, ops
Self-Contained Systems separate applications that donβt rely on each other
End-to-End Responsibility from user interface to database , e c iv r e s o r ic m like a chunky I U n w o s it h but wit illustration: Micro Frontends in Action
Michael Geers / @naltatis
Slide 19
each team ships user interface Michael Geers / @naltatis
Slide 20
A De nition 3/3 Our preferred (and proven) approach is to split the browser-based code into micro frontends. In this approach, the web application is broken down into its features, and each feature is owned, frontend to backend, by a different team. This ensures that every feature is developed, tested and deployed independently from other features. β¦
fi
source: ThoughtWorks Technology Radar
Michael Geers / @naltatis
Slide 21
Independent Deployments
illustration: Micro Frontends in Action
Michael Geers / @naltatis
Slide 22
Real World Projects
Slide 23
manufactum.com 2 teams
Slide 24
Team After-Sell Team Sell product page
login status fragment mini basket fragment
Michael Geers / @naltatis
Slide 25
Team Sell
Team After-Sell basket page
navigation fragment
Michael Geers / @naltatis
Slide 26
Klingel Group
5 teams from 4 software companies 15 brands, 12 countries, ~65 shops
26
Slide 27
Team Checkout Team Search
mini basket
category page
Team Decide wishlist
Team Inspire promotion inspiration
Team Account login status feedback support
Michael Geers / @naltatis
Slide 28
Team Checkout login page
Team Inspire
Team Account
recommendations
feedback support
Michael Geers / @naltatis
Slide 29
PayPal
Slide 30
PayPal
PayPal Egnineering Blog
Michael Geers / @naltatis
Slide 31
Who uses micro frontends?
logos link to the sources Michael Geers / @naltatis
What needs to be integrated?
illustration: Micro Frontends in Action
Michael Geers / @naltatis
Slide 35
composition with iframes
Spotify web player (until early 2019) & Desktop App https://labs.spotify.com/2019/03/25/building-spotifys-new-web-player/
Michael Geers / @naltatis
Slide 36
composition on the server using SSI or ESI
/red-tractor
<html> <em>0 items</em> <h1>Tractor</h1> <button>buy for 66 β¬</button> </html>
server Team Decide
<button> buy for 66 β¬ </button>
/checkout/buy
<em>0 items</em>
<html> <!β#include virtual=β/checkout/basketβ β> <h1>Tractor</h1> <!β#include virtual=β/checkout/buyβ β> </html>
/checkout/basket
/red-tractor
reverse-proxy (nginx, β¦)
server Team Checkout
Slide 37
<checkout-basket> </checkout-basket>
composition
in the browser with Custom Elements <inspire-reco sku=βt_redβ> </inspire-reco>
<checkout-buy sku=βt_redβ> </checkout-buy>
Michael Geers / @naltatis
Slide 38
page transitions using links Customer Journey 1
1
1
2
2 33 $ 66 $
$$
66 $
%%
99 $
home
list
Team Inspire
illustration: Micro Frontends in Action
detail
Team Decide
buy
basket
payment
confirm
Team Checkout
Michael Geers / @naltatis
Slide 39
page transitions between SPAs Linked Single Page Apps
fi
illustration: Micro Frontends in Action
Uni ed Single Page App
Michael Geers / @naltatis
Slide 40
jobs of the application shell? β£ β£ β£
illustration: Micro Frontends in Action
central entry point for the user can load, start and stop all SPAs switches between SPAs if necessary
Michael Geers / @naltatis
Slide 41
single-spa β£ β£ β£ β£ https://single-spa.js.org/
ready-to-use application shell most popular solution plugins for nearly all frameworks also supports composition Michael Geers / @naltatis
Slide 42
libraries & meta frameworks https://qiankun.umijs.org
Podium
Piral
icestark
https://piral.io
https://ice-lab.github.io/icestark/
https://podium-lib.io
Ara https://github.com/ara-framework https://github.com/opencomponents/oc
https://github.com/onerzafer/microfe-client
Luigi
meta-spa-router
https://github.com/manfredsteyer/meta-router
https://github.com/zalando/tailor
puzzle.js https://github.com/puzzle-js
https://github.com/SAP/luigi
ILC
https://github.com/namecheap/ilc Michael Geers / @naltatis
Slide 43
π§
Why would I use micro frontends?
Slide 44
π₯ faster feature development β¦
Slide 45
three 8-person teams are more effective than
one 24-person team Michael Geers / @naltatis
Slide 46
teams should be decoupled
Slide 47
Specialist Teams
Cross Functional Teams
Frontend
Content Service
Attributes Service
Payment Service Team Inspire
Business
Team Checkout
Operations Platform
grouped around a skill or technology illustration: Micro Frontends in Action
Team Decide
grouped around a use case or customer need Michael Geers / @naltatis
Slide 48
Specialist Teams
Cross Functional Teams
Frontend
Content Service
Attributes Service
Payment Service Team Inspire
Business
Team Decide
Team Checkout
Operations Platform
grouped around a skill or technology grouped around a use case or customer need β³ Meeting Developing a Features waiting for others s
Michael Geers / @naltatis
Slide 49
custome focu
s
r
direct feedback no pure API teams
Slide 50
fronten renovatio
n
d
without throwing everything away
Slide 51
technology change becomes a team decision
illustration: Micro Frontends in Action
Michael Geers / @naltatis
Analyses of loading performance (LCP) in German fashion e-commerce shops
all using a micro frontends architecture
π΄ micro frontend sites can be very fast
or slow - itβs mostly about good engineering
source: Textil Wirtschaft
Slide 58
π π but what about the redundancy? π
Slide 59
smaller tools mean less redundancy larger runtime hyperapp
π
small runtime
π¦ Michael Geers / @naltatis
Slide 60
β»
reusing vendor libraries between systems
with import maps lib-1
A
lib-2
B
with module federation
central library repository
C
applications can reference central libraries to reduce their bundle size https://github.com/systemjs/systemjs/blob/master/docs/import-maps.md
peer-to-peer approach
A lib-1
B
C lib-2
applications can reuse already loaded libraries from inside other applications https://module-federation.github.io
Slide 61
Iβve written a book Michael Geers
270 pages 143 illustrations 21 examples 64 listings 35% off with code ctwemerge21
MANNING
and all other books at manning.com
Michael Geers / @naltatis
Slide 62
book examples the-tractor.store
Slide 63
need more? micro-frontends.org article by Cam Jackson article by Gustaf Nilsson Kotte blogposts by Florian Rappl blogposts by Luca Mezzalira π awesomelist by Rajasegar Chandran Michael Geers / @naltatis
Slide 64
book recommendation about structuring your organisationβs
teams & systems
Michael Geers / @naltatis
Slide 65
thank you for listening! stay healthy
Michael Geers / @naltatis
Slide 66
image credits
Mirror Facade Jonas Ferlin
Man Welding Metal Kateryna Babaieva
https://www.pexels.com/photo/mirror-facade-of-tallbuilding-1963557/
https://www.pexels.com/photo/man-weldingmetal-2880871/
Monolith 1 Jeff Hendricks
Action Bicycling Roman Pohorecki
https://unsplash.com/photos/yIKdc86jNBs
https://www.pexels.com/photo/action-bicycling-bikebiking-287398/
Monolith 2 Rana Osman https://unsplash.com/photos/JcSsu-NF3qo
Running Kids (me)
Buildings Juhasz Imre
The Tool Guy Tirachard Kumtanom
https://www.pexels.com/photo/apartment-architecturebuildings-business-425047/
https://unsplash.com/photos/UuW4psOb388
Metal Blade Russ Ward
Woodshop Igor Ovsyannykov https://unsplash.com/photos/iXV0i4Wo4yc
https://unsplash.com/photos/aMlbxs8SYig
Tractors Manufactum https://www.manufactum.com/tin-toys-c193667/
s d n e t n o r f o r c i m h t i w t l i bu