SlideShare a Scribd company logo
1 of 37
Download to read offline
1
Micro-frontends
Architecture
@lucamezzalira
Ciao :)
Luca Mezzalira
VP of Architecture at DAZN
Google Developer Expert
London Javascript Community Manager
2
1. From monolith to micro…
2. What is a Micro-frontend?
3. Technical implementations
Agenda
3
DISCLAIMER
4
This presentation could mine many of your believes
on software development, please be
open minded and think at scale
1.
From monolith to micro…
EVERYTHING!
Moving towards the micro-world!
5
6
Scaling our applications
DB
Monolith
SPA
SPA
DB
Microservice
DB
Microservice
DB
Microservice
API
Gateway
???
7
Impact within our teams
SPA
DB
Microservice
DB
Microservice
DB
Microservice
API
Gateway
▧ Frontend uses the same
codebase for all the
teams
▧ Communication
overhead for managing
different part of the UI
▧ Infrastructure,
Microservices and DBs
almost autonomous
8
Scaling our applications with micro-frontends
SPA
DB
Microservice
DB
Microservice
DB
Microservice
API
Gateway
9
Scaling our applications with micro-frontends
Microfrontend
DB
Microservice
DB
Microservice
DB
Microservice
API
Gateway
Microfrontend Microfrontend
Routing
On the edge,
Server side
Or Client side
*
API
Gateway
10
Impact within our teams
▧ End to end autonomy
within a business domain
▧ Freedom and
responsibility
▧ Innovation without
affecting the entire
application
DB
Microservice
Microfrontend
API Gateway
DB
Microservice
11
Impact within our organization
+ =
Cross-functional
team
Product
team
Business
Domain
2.
What is a Micro-frontend?
Let’s connect the dots...
12
“
Micro-frontends are the technical
representation of a business subdomain,
they allow independent implementations with same
or different technology choices, finally
they avoid sharing logic with other subdomains and they
are own by a single team
13
From Domain
Driven Design
(DDD)
Domain and Subdomains
(DDD)
14
15
Domain and Subdomains
The domain is the problem to be addressed with
a software effort.
A domain can be decomposed into subdomains
which typically reflect some organizational
structure.
A common example of a sub-domain is Product
Catalog
16
Subdomains
There are 3 different type of subdomains:
Core
subdomain
Supporting
subdomain
Generic
subdomain
https://bit.ly/2Au5Lio
Place your screenshot here
Share nothing… and I mean NOTHING
Avoid to share components or code across different
bounded contexts, abstraction could make our code more
complex to maintain in the long run, the communication
overhead could become a bottleneck for our
organizations
17
3.
Technical implementation
The journey of a thousand miles begins
with one step
18
Let’s review some potential approaches
Iframes
An iframes composition is
the choice made by
Spotify with an event bus
for coordinating the
events across different
iframes.
The desktop application
mixes Web technologies
with C++ codebase for the
low-level operations
Components
Opentable developers
experience team created
Open Components, an
open source project
composed by a registry of
components where
frontend and backend
logics are wrapped inside
small, self-contained units
usable inside any view of
their website
OpenComponent is
providing tools for quickly
create new components
like a CLI, more info:
opencomponents.github.io
Server-side
composition
Zalando was one of the
pioneers on microfrontends
with Mosaic9
(www.mosaic9.org) in
particular we need to
highlight Tailor.js, an open
source system for
assembling the components
on-demand on a backend
layer written in Go.
At the end of 2018 Zalando
moves to a server-side
include system called
“Interface framework”
19
20
DAZN implementation
Landing Pages
Authentication
Discovery and
Playback
Customers
Support
My Account
Bootstrap
Bootstrap is responsible for:
. application startup
. I/O operations
. routing between micro-frontends
. sharing configurations across multiple micro-frontends
21
DAZN implementation
Microfrontend
▧ Each Micro-frontend represents a
subdomain matching the business
structure
▧ It’s technology/framework agnostic
▧ A Micro-frontend is AUTONOMOUS
▧ Inside a Micro-frontend the team can
share components, code, styles or any
other asset
▧ Independent building systems
▧ 1 Micro-frontend loaded per time
22
Micro-frontend structure
index.html
</>
app.js
{...}
vendor.js
{...}
style.css
.div
23
How bootstrap works
<html>
<head>
<script src=”./bootstrap.js” />
</head>
<body>
...
</body>
</html>
▧ Bootstrap loaded as first
element and always
available
▧ Tiny JS layer responsible
to load micro-frontends
▧ Exposes APIs for
different micro-frontends
24
How bootstrap works
</>
{...}
….
<html>
<head>
<script src=”./bootstrap.js” />
<style type=”text/css”>...</style>
</head>
<body>
<div>
…
</div>
<script src=”./catalogue.js” />
<script src=”./cat-vendor.js” />
</body>
</html>
25
How bootstrap works
Window.DAZN = {
Lifecycle: {
OnLoad: function(){...}
OnunLoad: function(){...}
},
Localstorage: {...},
...
}
▧ DAZN object exposes
methods and properties
for all the micro-frontends
▧ Each micro-frontend has
lifecycle callbacks available
▧ This object abstracts the
platform exposing
common APIs
Components
26
{...}
▧ Components available on NPM
private repos
▧ Components need to work with
any framework
▧ They expose a contract for the
micro-frontend to interact with
▧ Components are own by specific
teams
▧ They can be shared within same
team
27
Deployment
2.0 1.0
cloudfront
▧ Based on some scenarios
I can redirect the user to a
version or another
▧ Don’t need to do a big
bang deployment
▧ Canary releases or Blue
Green deployment on
Frontend!
https://bit.ly/2Afy44t
5 teams
Onboarded on the same projects in 3 weeks
100%
Innovation, freedom and responsibility for
each team!!!
Over 100 developers
Working on the same project
28
“
The main challenges with scaling frontend
applications are scaling the teams,
reducing the communication overhead
and innovate!
29
Microfrontends frameworks
30
Single-SPA
single-spa.js.org
FrintJS
frint.js.org
Single SPA
31
appA.js
single-spa
appB.js
▧ Each SPA reacts to
lifecycle methods
(mount/unmount and
bootstrap)
▧ Framework agnostic,
helpers available for
major frameworks
▧ Single-spa-config with
method for registering
different SPAs
Frint.js
32
frint.js.org
Frint.js
33
▧ React focused
▧ Very very opinionated
▧ Component-based architecture
▧ Reactive framework with Rx.JS
▧ Lazy loading of modules inside the Root app
▧ Provides a set of libraries to use in conjunction with
the core library (routing or state management for
instance)
▧ Routing is happening at URL level
DDD resources
34
Decompose by subdomain
https://bit.ly/2DUTQ1v
Subdomains and bounded
context in DDD
https://bit.ly/1BPZfIW
Learning, testing and sharing
35
. Micro-frontends FREE report
for O’Reilly (~80 pages)
. 28th February 3 hours online
workshop on Safari Books
Online: bit.ly/2BjfhFw
#OReillySACon
Rate today’s session
Session page on oreillysacon.com/ny O’Reilly Events App
Thank YOU
You can find me at:
@lucamezzalira
luca.mezzalira@dazn.com
37
#OReillySACon

More Related Content

Similar to Scaling frontend applications with micro-frontends Presentation.pdf

Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidConAmir Zuker
 
Developer cloud roadmap keynote
Developer cloud roadmap keynoteDeveloper cloud roadmap keynote
Developer cloud roadmap keynoteMoaid Hathot
 
Architecting for speed: How agile innovators accelerate growth through micros...
Architecting for speed: How agile innovators accelerate growth through micros...Architecting for speed: How agile innovators accelerate growth through micros...
Architecting for speed: How agile innovators accelerate growth through micros...Jesper Nordström
 
Architecting for speed - how agile innovators accelerate growth through micro...
Architecting for speed - how agile innovators accelerate growth through micro...Architecting for speed - how agile innovators accelerate growth through micro...
Architecting for speed - how agile innovators accelerate growth through micro...3gamma
 
Platform governance, gestire un ecosistema di microservizi a livello enterprise
Platform governance, gestire un ecosistema di microservizi a livello enterprisePlatform governance, gestire un ecosistema di microservizi a livello enterprise
Platform governance, gestire un ecosistema di microservizi a livello enterpriseGiulio Roggero
 
Dipping Your Toes Into Cloud Native Application Development
Dipping Your Toes Into Cloud Native Application DevelopmentDipping Your Toes Into Cloud Native Application Development
Dipping Your Toes Into Cloud Native Application DevelopmentMatthew Farina
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
RTP Bluemix Meetup April 20th 2016
RTP Bluemix Meetup April 20th 2016RTP Bluemix Meetup April 20th 2016
RTP Bluemix Meetup April 20th 2016Tom Boucher
 
The DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkitThe DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkitMarco Ferrigno
 
The DevOps Paradigm
The DevOps ParadigmThe DevOps Paradigm
The DevOps ParadigmNaLUG
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMiki Lombardi
 
Cookbook for Building An App
Cookbook for Building An AppCookbook for Building An App
Cookbook for Building An AppManish Jain
 
UGIdotNET App Modernisation Keynote
UGIdotNET App Modernisation KeynoteUGIdotNET App Modernisation Keynote
UGIdotNET App Modernisation KeynoteLorenzo Barbieri
 
What is the next generation of .Net?
What is the next generation of  .Net?What is the next generation of  .Net?
What is the next generation of .Net?Faiyneen Shaikh
 
Cloudify your applications: microservices and beyond
Cloudify your applications: microservices and beyondCloudify your applications: microservices and beyond
Cloudify your applications: microservices and beyondUgo Landini
 
Microservice Best Practices The 8020 Way.pdf
Microservice Best Practices The 8020 Way.pdfMicroservice Best Practices The 8020 Way.pdf
Microservice Best Practices The 8020 Way.pdfSimform
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021NeerajKumar1965
 
CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018Krishna-Kumar
 

Similar to Scaling frontend applications with micro-frontends Presentation.pdf (20)

Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidCon
 
Developer cloud roadmap keynote
Developer cloud roadmap keynoteDeveloper cloud roadmap keynote
Developer cloud roadmap keynote
 
Architecting for speed: How agile innovators accelerate growth through micros...
Architecting for speed: How agile innovators accelerate growth through micros...Architecting for speed: How agile innovators accelerate growth through micros...
Architecting for speed: How agile innovators accelerate growth through micros...
 
Architecting for speed - how agile innovators accelerate growth through micro...
Architecting for speed - how agile innovators accelerate growth through micro...Architecting for speed - how agile innovators accelerate growth through micro...
Architecting for speed - how agile innovators accelerate growth through micro...
 
Cloud to Edge
Cloud to EdgeCloud to Edge
Cloud to Edge
 
Platform governance, gestire un ecosistema di microservizi a livello enterprise
Platform governance, gestire un ecosistema di microservizi a livello enterprisePlatform governance, gestire un ecosistema di microservizi a livello enterprise
Platform governance, gestire un ecosistema di microservizi a livello enterprise
 
Dipping Your Toes Into Cloud Native Application Development
Dipping Your Toes Into Cloud Native Application DevelopmentDipping Your Toes Into Cloud Native Application Development
Dipping Your Toes Into Cloud Native Application Development
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
RTP Bluemix Meetup April 20th 2016
RTP Bluemix Meetup April 20th 2016RTP Bluemix Meetup April 20th 2016
RTP Bluemix Meetup April 20th 2016
 
The DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkitThe DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkit
 
The DevOps Paradigm
The DevOps ParadigmThe DevOps Paradigm
The DevOps Paradigm
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
Cookbook for Building An App
Cookbook for Building An AppCookbook for Building An App
Cookbook for Building An App
 
UGIdotNET App Modernisation Keynote
UGIdotNET App Modernisation KeynoteUGIdotNET App Modernisation Keynote
UGIdotNET App Modernisation Keynote
 
The Future of Cloud Innovation, featuring Adrian Cockcroft
The Future of Cloud Innovation, featuring Adrian CockcroftThe Future of Cloud Innovation, featuring Adrian Cockcroft
The Future of Cloud Innovation, featuring Adrian Cockcroft
 
What is the next generation of .Net?
What is the next generation of  .Net?What is the next generation of  .Net?
What is the next generation of .Net?
 
Cloudify your applications: microservices and beyond
Cloudify your applications: microservices and beyondCloudify your applications: microservices and beyond
Cloudify your applications: microservices and beyond
 
Microservice Best Practices The 8020 Way.pdf
Microservice Best Practices The 8020 Way.pdfMicroservice Best Practices The 8020 Way.pdf
Microservice Best Practices The 8020 Way.pdf
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021
 
CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018
 

Recently uploaded

AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 

Recently uploaded (20)

AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 

Scaling frontend applications with micro-frontends Presentation.pdf

  • 2. Ciao :) Luca Mezzalira VP of Architecture at DAZN Google Developer Expert London Javascript Community Manager 2
  • 3. 1. From monolith to micro… 2. What is a Micro-frontend? 3. Technical implementations Agenda 3
  • 4. DISCLAIMER 4 This presentation could mine many of your believes on software development, please be open minded and think at scale
  • 5. 1. From monolith to micro… EVERYTHING! Moving towards the micro-world! 5
  • 7. 7 Impact within our teams SPA DB Microservice DB Microservice DB Microservice API Gateway ▧ Frontend uses the same codebase for all the teams ▧ Communication overhead for managing different part of the UI ▧ Infrastructure, Microservices and DBs almost autonomous
  • 8. 8 Scaling our applications with micro-frontends SPA DB Microservice DB Microservice DB Microservice API Gateway
  • 9. 9 Scaling our applications with micro-frontends Microfrontend DB Microservice DB Microservice DB Microservice API Gateway Microfrontend Microfrontend Routing On the edge, Server side Or Client side * API Gateway
  • 10. 10 Impact within our teams ▧ End to end autonomy within a business domain ▧ Freedom and responsibility ▧ Innovation without affecting the entire application DB Microservice Microfrontend API Gateway DB Microservice
  • 11. 11 Impact within our organization + = Cross-functional team Product team Business Domain
  • 12. 2. What is a Micro-frontend? Let’s connect the dots... 12
  • 13. “ Micro-frontends are the technical representation of a business subdomain, they allow independent implementations with same or different technology choices, finally they avoid sharing logic with other subdomains and they are own by a single team 13 From Domain Driven Design (DDD)
  • 15. 15 Domain and Subdomains The domain is the problem to be addressed with a software effort. A domain can be decomposed into subdomains which typically reflect some organizational structure. A common example of a sub-domain is Product Catalog
  • 16. 16 Subdomains There are 3 different type of subdomains: Core subdomain Supporting subdomain Generic subdomain https://bit.ly/2Au5Lio
  • 17. Place your screenshot here Share nothing… and I mean NOTHING Avoid to share components or code across different bounded contexts, abstraction could make our code more complex to maintain in the long run, the communication overhead could become a bottleneck for our organizations 17
  • 18. 3. Technical implementation The journey of a thousand miles begins with one step 18
  • 19. Let’s review some potential approaches Iframes An iframes composition is the choice made by Spotify with an event bus for coordinating the events across different iframes. The desktop application mixes Web technologies with C++ codebase for the low-level operations Components Opentable developers experience team created Open Components, an open source project composed by a registry of components where frontend and backend logics are wrapped inside small, self-contained units usable inside any view of their website OpenComponent is providing tools for quickly create new components like a CLI, more info: opencomponents.github.io Server-side composition Zalando was one of the pioneers on microfrontends with Mosaic9 (www.mosaic9.org) in particular we need to highlight Tailor.js, an open source system for assembling the components on-demand on a backend layer written in Go. At the end of 2018 Zalando moves to a server-side include system called “Interface framework” 19
  • 20. 20 DAZN implementation Landing Pages Authentication Discovery and Playback Customers Support My Account Bootstrap Bootstrap is responsible for: . application startup . I/O operations . routing between micro-frontends . sharing configurations across multiple micro-frontends
  • 21. 21 DAZN implementation Microfrontend ▧ Each Micro-frontend represents a subdomain matching the business structure ▧ It’s technology/framework agnostic ▧ A Micro-frontend is AUTONOMOUS ▧ Inside a Micro-frontend the team can share components, code, styles or any other asset ▧ Independent building systems ▧ 1 Micro-frontend loaded per time
  • 23. 23 How bootstrap works <html> <head> <script src=”./bootstrap.js” /> </head> <body> ... </body> </html> ▧ Bootstrap loaded as first element and always available ▧ Tiny JS layer responsible to load micro-frontends ▧ Exposes APIs for different micro-frontends
  • 24. 24 How bootstrap works </> {...} …. <html> <head> <script src=”./bootstrap.js” /> <style type=”text/css”>...</style> </head> <body> <div> … </div> <script src=”./catalogue.js” /> <script src=”./cat-vendor.js” /> </body> </html>
  • 25. 25 How bootstrap works Window.DAZN = { Lifecycle: { OnLoad: function(){...} OnunLoad: function(){...} }, Localstorage: {...}, ... } ▧ DAZN object exposes methods and properties for all the micro-frontends ▧ Each micro-frontend has lifecycle callbacks available ▧ This object abstracts the platform exposing common APIs
  • 26. Components 26 {...} ▧ Components available on NPM private repos ▧ Components need to work with any framework ▧ They expose a contract for the micro-frontend to interact with ▧ Components are own by specific teams ▧ They can be shared within same team
  • 27. 27 Deployment 2.0 1.0 cloudfront ▧ Based on some scenarios I can redirect the user to a version or another ▧ Don’t need to do a big bang deployment ▧ Canary releases or Blue Green deployment on Frontend! https://bit.ly/2Afy44t
  • 28. 5 teams Onboarded on the same projects in 3 weeks 100% Innovation, freedom and responsibility for each team!!! Over 100 developers Working on the same project 28
  • 29. “ The main challenges with scaling frontend applications are scaling the teams, reducing the communication overhead and innovate! 29
  • 31. Single SPA 31 appA.js single-spa appB.js ▧ Each SPA reacts to lifecycle methods (mount/unmount and bootstrap) ▧ Framework agnostic, helpers available for major frameworks ▧ Single-spa-config with method for registering different SPAs
  • 33. Frint.js 33 ▧ React focused ▧ Very very opinionated ▧ Component-based architecture ▧ Reactive framework with Rx.JS ▧ Lazy loading of modules inside the Root app ▧ Provides a set of libraries to use in conjunction with the core library (routing or state management for instance) ▧ Routing is happening at URL level
  • 34. DDD resources 34 Decompose by subdomain https://bit.ly/2DUTQ1v Subdomains and bounded context in DDD https://bit.ly/1BPZfIW
  • 35. Learning, testing and sharing 35 . Micro-frontends FREE report for O’Reilly (~80 pages) . 28th February 3 hours online workshop on Safari Books Online: bit.ly/2BjfhFw #OReillySACon
  • 36. Rate today’s session Session page on oreillysacon.com/ny O’Reilly Events App
  • 37. Thank YOU You can find me at: @lucamezzalira luca.mezzalira@dazn.com 37 #OReillySACon