SlideShare uma empresa Scribd logo
1 de 47
Baixar para ler offline
Micro FrontEnd
The microservices puzzle extended to frontend
Classic Study Case
An History of Evolution
Front-End
Back-End
Database
Monolith
Front-End
Front & Back
Front &
Microservices
Back-End
Database
Product
service
Search
Service
Checkout
service
Front-End
It’s Not Only About Architecture
Front-End
Back-End
Database
Monolith
Front-End
Front & Back
Front &
Microservices
Back-End
Database
Product
service
Search
Service
Checkout
service
Front-End
The Pet Store
Team
The Front End
Team
The Back End
Team
The Front End
Team
Product
Team
Search
Team
Checkout
Team
42
1 5
Microservices Benefits
Small &
Specialized
Teams
Easier to
scale
Micro
Services
Freedom in
stack’s
choices
Easier to
deploy
3
4
Front & Microservices: The perfect match?
Front &
Microservices
Product
service
Search
Service
Checkout
service
Front-End
The Front End
Team
Product
Team
Search
Team
Checkout
Team
Next Step of Evolution
Product Team Search Team Checkout Team
Front-End
Back-End
Database
Front-End
Back-End
Database
Front-End
Back-End
Database
Classic E-Commerce Approach
The Petstore Reloaded
Search Team
Product Team
Checkout Team
Customer Focused Teams
Product Team Search Team Checkout Team
Front-End
Back-End
Database
Front-End
Back-End
Database
Front-End
Back-End
Database
Customer Focused Teams
Product Team Search Team Checkout Team
Front-End
Back-End
Database
Front-End
Back-End
Database
Front-End
Back-End
Database
Mission:
present the
product in a clear
way
Mission:
help finding the
right product
quickly
Mission:
make the
checkout
experience easy
3
4
5
2
1
Micro Frontend Benefits
Freedom in
stack’s
choices
Small
Customer
Centric
Teams
Autonomous
development Autonomous
release of
features
Application’s
evolution
made easier
Micro
Frontend
Real Life Study Case
July 2015
Manager
March 2017
Governance
August 2017
Operations
: Data Fabric
Real Life Study Case: Data Fabric
V2 is coming
Time to reorganize
the team!
OCT
2017
December 2017
Layout
March 2018
Galaxy
July 2018
Layout-as-lib
Data Fabric V2
Design System (aka saagie-ui)
Try #1: Saagie-Layout
Try #1: Saagie-Layout
What’s a Web Component?
Custom Elements
Shadow Dom HTML Template
ES Modules
<my-component>
My-component.js Index.html
class MyComponent extends HTMLElement {
connectedCallback() {
// element has been attached to the DOM
}
disconnectedCallback() {
// element has been detached from the DOM
}
attributeChangedCallback() {
// an attribute value has changed
}
render() {
this.innerHTML = `<div> … </div>`;
}
}
customElements.define('my-component', MyComponent);
<html lang="en">
<head>
<title>My application</title>
</head>
<body>
</body>
</html>
<script type="module"
src="my-component.js">
</script>
<my-component></my-component>
<script
src="/lib/document-register-element.js">
</script>
Talking about support...
source
Saagie-Layout
Saagie-Layout
From an Application To a Web Component
class DataManager extends HTMLElement {
constructor() {
this.render();
}
render() {
this.platform = this.getAttribute('platform');
this.innerHTML =
}
}
angular
.module('data-manager')
.controller('AppController',
AppController);
AppController.$inject = ['$scope',
'$rootScope', '$state', … ];
function AppController($scope,
$rootScope, $state, ...) {
…
}
app-controller.js data-manager.js
customElements.define('saagie-data-manager',DataManager);
`<div ng-app="data-manager"
ng-controller="AppController">
<platform-nav platform=${this.platform}>
</platform-nav>
</div>`;
From an Application To a Web Component
class DataGovernance extends HTMLElement {
connectedCallback() {
this.render();
}
render() {
this.apiPath = this.getAttribute('datagov-url');
this.innerHTML =
}
}
@Component({
selector:
'data-governance’,
templateUrl:
'./app.component.html',
providers:
[]
})
export class AppComponent {
…
}
app-component.js data-governance.js
`<data-governance
id="data-governance"
datagov-url=${this.apiPath}>
</data-governance>`;
customElements.define('saagie-data-governance',
DataGovernance);
Saagie-Layout
index.html
<html lang="en">
<head>
</head>
<body>
</body>
</html>
<link rel="stylesheet" href="/saagie-ui/src/index.css">
<script src="/data-governance/web-components/data-governance.js">
</script>
<script src="/data-fabric/web-components/data-manager.js">
</script>
<sla-board></sla-board>
Saagie-Layout
class Board extends HTMLElement {
render(path, user) {
const page = this.getPage(path);
this.innerHTML =
}
…
getPage(path) {
let page;
switch (path) {
case PROJECTS :
page = `<saagie-data-manager
id="data-manager"
platform=${getSelectedPlatform()}>
</saagie-data-manager>`;
break;
case GOVERNANCE :
page = `<saagie-data-governance
id="data-governance"
datagov-url="${this.dataGovUrl}">
</saagie-data-governance>`;
break;
}
}
}
board.js
`<div class="sui-l-app-layout">
<sla-topbar currentPage="${path}">
</sla-topbar>
<account-menu currentUser="${user}">
</account-menu>
<primary-nav></primary-nav>
<div class="sui-l-app-layout__page">
${page}
</div>
</div>`;
customElements.define('sla-board', Board);
Pros & Cons
ConsPros
● consistent user experience ● not a true SPA
● high dependencies on
libraries between apps
● bad performances
● routers management
● implies to run the entire
stack locally
● possibility to display several
components on the same
page
● independent deployment
Try #2: Galaxy
Pros & Cons
ConsPros
● possibility to share
components between
applications
● still high dependencies on
libraries between apps
● centralized routing system
● but also between React’s
versions
Try #3: Layout-as-Lib
Layout-as-Lib
<html>
<head>
<title>Saagie Governance</title>
</head>
<body id="sui-root">
<data-governance-angular
class="sui-l-app-layout__subapp">
</data-governance-angular>
</body>
</html>
index.html
import {AppModule} from './app/app.module';
import {LoadLayoutData} from 'saagie-layout-lib';
platformBrowserDynamic().bootstrapModule(AppModule);
main.ts
<saagie-layout
current-platform-object='{"loading": true}'
hide="true">
</saagie-layout>
const legacy = window
.location
.pathname.startsWith('/datagovernance');
if (!legacy) {
const hrefParameters =
window.location.href.split('platform/');
new LoadLayoutData().init('governance',
parseInt(hrefParameters[1], 10));
const layout = document.querySelector('saagie-layout');
layout.removeAttribute('hide');
}
Layout-as-Lib
import '@webcomponents/custom-elements';
import './web-components/Layout';
import './web-components/PrimaryNav';
import './web-components/Topbar';
index.js
export default class LoadLayoutData {
…
LoadLayoutData.js
import LoadLayoutData from
'./services/LoadLayoutData';
export default {
LoadLayoutData
}; async loadData(layoutComponent, currentApp,
currentPlatformId) {
await this.loadRights();
await this.loadJobsData();
await this.loadProfile();
}
init(currentApp, currentPlatformId) {
const layoutComponent =
document.querySelector('saagie-layout');
return this.loadData(layoutComponent,
currentApp, currentPlatformId);
}}
Layout-as-Lib
import '@webcomponents/custom-elements';
import './web-components/Layout';
import './web-components/PrimaryNav';
import './web-components/Topbar';
index.js
export default class LoadLayoutData {
…
LoadLayoutData.js
import LoadLayoutData from
'./services/LoadLayoutData';
export default {
LoadLayoutData
};
async loadRights(){
const rights = await fetch(apiRightsUrl);
this.login = rights.login;
this.setUser({ login: this.login });
this.setPlatforms(rights.platforms));
}
setPlatforms(platforms) {
this.layoutComponent
.setAttribute('platforms-list-object',
JSON.stringify({platforms}));
}
Layout-as-Lib
layout.js
class Layout extends HTMLElement { …
initRender() {
this.innerHTML =
`<div class="sui-l-app-layout"
id="sui-root">
<saagie-topbar
class="sui-o-topbar">
</saagie-topbar>
<saagie-primary-nav
class="sui-o-primary-nav">
</saagie-primary-nav>
${this.innerHTML}
</div>`;
}
}
connectedCallback() {
this.initRender();
…
}
attributeChangedCallback(name, oldValue,
newValue) {
switch (name) {
case 'current-app':
this.changeChildAttribute
('saagie-topbar', name, newValue);
this.changeChildAttribute
('saagie-primary-nav', name, newValue);
break;
case 'current-platform-object':
…
if(!customElements.get('saagie-layout')){
customElements.define('saagie-layout', Layout);
}
Pros & Cons
ConsPros
● not an SPA at all
● no components
aggregation possible
Page Transitions
Page Transitions
Page Transitions
Page Transitions
Pros & Cons
ConsPros
● way more faster
● easier to integrate
● breaking changes implies to
update each application
● possible inconsistent user
experience
● independent deployment
AND development
● no more libraries conflict
● can be run on its own
Data Fabric
July 2015
Manager
March 2017
Governance
August 2017
Operations
Data Fabric V2
V2 is coming
Time to reorganize
the team!
OCT
2017
December 2017
Layout
March 2018
Galaxy
May 2018
Security
Data Fabric V2
September 2018
Project & Jobs
July 2018
App Store
December 2018
Dataset Access
June 2018
Layout-as-lib
Best practices, tips & tricks
Think usecase first Take care of your
design
Share ressources,
not runtime!
Aggregation of components
or aggregation of SPA?
Design system, optimistic UI,
skeletons ...
Build independent and self
contained apps
Share libraries and common
services
● Micro-frontends.org
https://github.com/neuland/micro-frontends
Micro Frontends talk by Michael Geers at Web Rebels, Oslo 2018 @nataltis
● Experiences Using Micro FrontEnds at IKEA
https://www.infoq.com/news/2018/08/experiences-micro-frontends
● Project Mosaic (Zalando)
https://www.mosaic9.org/
● Single SPA
https://single-spa.js.org/
To go further
Thank you!

Mais conteúdo relacionado

Mais procurados

Micro Frontends Architecture
Micro Frontends ArchitectureMicro Frontends Architecture
Micro Frontends ArchitectureRag Dhiman
 
Building applications in a Micro-frontends way
Building applications in a Micro-frontends wayBuilding applications in a Micro-frontends way
Building applications in a Micro-frontends wayPrasanna Venkatesan
 
Mikrofrontend a Module Federation
Mikrofrontend a Module FederationMikrofrontend a Module Federation
Mikrofrontend a Module FederationThe Software House
 
Micro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniMicro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniSandeep Soni
 
Globant development week / Micro frontend
Globant development week / Micro frontendGlobant development week / Micro frontend
Globant development week / Micro frontendGlobant
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitecturePaul Mooney
 
"Micro-frontends, web development", Oleksandr Khivrych
"Micro-frontends, web development", Oleksandr Khivrych"Micro-frontends, web development", Oleksandr Khivrych
"Micro-frontends, web development", Oleksandr KhivrychFwdays
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMiki Lombardi
 
Microservices
MicroservicesMicroservices
MicroservicesSmartBear
 
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...Shift Conference
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureAbdelghani Azri
 
Micro frontend de um jeito que você nunca viu
Micro frontend de um jeito que você nunca viuMicro frontend de um jeito que você nunca viu
Micro frontend de um jeito que você nunca viuWagner Souza
 

Mais procurados (20)

Micro frontends
Micro frontendsMicro frontends
Micro frontends
 
Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?
 
Micro Frontends Architecture
Micro Frontends ArchitectureMicro Frontends Architecture
Micro Frontends Architecture
 
Building applications in a Micro-frontends way
Building applications in a Micro-frontends wayBuilding applications in a Micro-frontends way
Building applications in a Micro-frontends way
 
Mikrofrontend a Module Federation
Mikrofrontend a Module FederationMikrofrontend a Module Federation
Mikrofrontend a Module Federation
 
Micro Frontends
Micro FrontendsMicro Frontends
Micro Frontends
 
Micro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniMicro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoni
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Micro frontend
Micro frontendMicro frontend
Micro frontend
 
Globant development week / Micro frontend
Globant development week / Micro frontendGlobant development week / Micro frontend
Globant development week / Micro frontend
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
"Micro-frontends, web development", Oleksandr Khivrych
"Micro-frontends, web development", Oleksandr Khivrych"Micro-frontends, web development", Oleksandr Khivrych
"Micro-frontends, web development", Oleksandr Khivrych
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
Microservices
MicroservicesMicroservices
Microservices
 
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Micro frontend de um jeito que você nunca viu
Micro frontend de um jeito que você nunca viuMicro frontend de um jeito que você nunca viu
Micro frontend de um jeito que você nunca viu
 
Microservices
MicroservicesMicroservices
Microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Introduction to MERN
Introduction to MERNIntroduction to MERN
Introduction to MERN
 

Semelhante a Micro frontend: The microservices puzzle extended to frontend

Creating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with ChaperoneCreating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with ChaperoneGary Wisniewski
 
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018Bhavesh Surani
 
LvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design SystemLvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design SystemVlad Fedosov
 
Folio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP YiiFolio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP YiiFolio3 Software
 
Open Social In The Enterprise
Open Social In The EnterpriseOpen Social In The Enterprise
Open Social In The EnterpriseTim Moore
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyMarcos Labad
 
How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...Katia Aresti
 
File Repository on GAE
File Repository on GAEFile Repository on GAE
File Repository on GAElynneblue
 
GraphQL Advanced
GraphQL AdvancedGraphQL Advanced
GraphQL AdvancedLeanIX GmbH
 
James Jara Portfolio 2014 Part 1
James Jara Portfolio 2014 Part 1James Jara Portfolio 2014 Part 1
James Jara Portfolio 2014 Part 1James Jara
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalabilityTwinbit
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery GuideMark Rackley
 
An Introduction to Microservices
An Introduction to MicroservicesAn Introduction to Microservices
An Introduction to MicroservicesAd van der Veer
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015Pushkar Chivate
 

Semelhante a Micro frontend: The microservices puzzle extended to frontend (20)

Creating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with ChaperoneCreating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with Chaperone
 
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018
 
LvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design SystemLvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design System
 
XPages Mobile, #dd13
XPages Mobile, #dd13XPages Mobile, #dd13
XPages Mobile, #dd13
 
Folio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP YiiFolio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP Yii
 
Open Social In The Enterprise
Open Social In The EnterpriseOpen Social In The Enterprise
Open Social In The Enterprise
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing Company
 
How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...
 
File Repository on GAE
File Repository on GAEFile Repository on GAE
File Repository on GAE
 
GraphQL Advanced
GraphQL AdvancedGraphQL Advanced
GraphQL Advanced
 
James Jara Portfolio 2014 Part 1
James Jara Portfolio 2014 Part 1James Jara Portfolio 2014 Part 1
James Jara Portfolio 2014 Part 1
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Portafolio
PortafolioPortafolio
Portafolio
 
Pyramid patterns
Pyramid patternsPyramid patterns
Pyramid patterns
 
Iac d.damyanov 4.pptx
Iac d.damyanov 4.pptxIac d.damyanov 4.pptx
Iac d.damyanov 4.pptx
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalability
 
Elastic-Engineering
Elastic-EngineeringElastic-Engineering
Elastic-Engineering
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide
 
An Introduction to Microservices
An Introduction to MicroservicesAn Introduction to Microservices
An Introduction to Microservices
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015
 

Mais de Audrey Neveu

WEBHOOKS VS WEBSUB - COMMENT STREAMER VOS ÉVÉNEMENTS EN TEMPS RÉEL ?
WEBHOOKS VS WEBSUB - COMMENT STREAMER VOS ÉVÉNEMENTS EN TEMPS RÉEL ?WEBHOOKS VS WEBSUB - COMMENT STREAMER VOS ÉVÉNEMENTS EN TEMPS RÉEL ?
WEBHOOKS VS WEBSUB - COMMENT STREAMER VOS ÉVÉNEMENTS EN TEMPS RÉEL ?Audrey Neveu
 
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...Audrey Neveu
 
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...Audrey Neveu
 
The end of polling : why and how to transform a REST API into a Data Streamin...
The end of polling : why and how to transform a REST API into a Data Streamin...The end of polling : why and how to transform a REST API into a Data Streamin...
The end of polling : why and how to transform a REST API into a Data Streamin...Audrey Neveu
 
The end of polling : why and how to transform a REST API into a Data Streamin...
The end of polling : why and how to transform a REST API into a Data Streamin...The end of polling : why and how to transform a REST API into a Data Streamin...
The end of polling : why and how to transform a REST API into a Data Streamin...Audrey Neveu
 
Ionic, le framework mobile hybride carrément addictif - Devoxx France 2016
Ionic, le framework mobile hybride carrément addictif - Devoxx France 2016Ionic, le framework mobile hybride carrément addictif - Devoxx France 2016
Ionic, le framework mobile hybride carrément addictif - Devoxx France 2016Audrey Neveu
 
Search API - Google Cloud Platform
Search API - Google Cloud PlatformSearch API - Google Cloud Platform
Search API - Google Cloud PlatformAudrey Neveu
 
Moteurs de recherche : un oeil sous le capot avec Elastic Search
Moteurs de recherche : un oeil sous le capot avec Elastic SearchMoteurs de recherche : un oeil sous le capot avec Elastic Search
Moteurs de recherche : un oeil sous le capot avec Elastic SearchAudrey Neveu
 

Mais de Audrey Neveu (8)

WEBHOOKS VS WEBSUB - COMMENT STREAMER VOS ÉVÉNEMENTS EN TEMPS RÉEL ?
WEBHOOKS VS WEBSUB - COMMENT STREAMER VOS ÉVÉNEMENTS EN TEMPS RÉEL ?WEBHOOKS VS WEBSUB - COMMENT STREAMER VOS ÉVÉNEMENTS EN TEMPS RÉEL ?
WEBHOOKS VS WEBSUB - COMMENT STREAMER VOS ÉVÉNEMENTS EN TEMPS RÉEL ?
 
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
 
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
Le Streaming d'API : pourquoi et comment transformer vos APIs statiques en do...
 
The end of polling : why and how to transform a REST API into a Data Streamin...
The end of polling : why and how to transform a REST API into a Data Streamin...The end of polling : why and how to transform a REST API into a Data Streamin...
The end of polling : why and how to transform a REST API into a Data Streamin...
 
The end of polling : why and how to transform a REST API into a Data Streamin...
The end of polling : why and how to transform a REST API into a Data Streamin...The end of polling : why and how to transform a REST API into a Data Streamin...
The end of polling : why and how to transform a REST API into a Data Streamin...
 
Ionic, le framework mobile hybride carrément addictif - Devoxx France 2016
Ionic, le framework mobile hybride carrément addictif - Devoxx France 2016Ionic, le framework mobile hybride carrément addictif - Devoxx France 2016
Ionic, le framework mobile hybride carrément addictif - Devoxx France 2016
 
Search API - Google Cloud Platform
Search API - Google Cloud PlatformSearch API - Google Cloud Platform
Search API - Google Cloud Platform
 
Moteurs de recherche : un oeil sous le capot avec Elastic Search
Moteurs de recherche : un oeil sous le capot avec Elastic SearchMoteurs de recherche : un oeil sous le capot avec Elastic Search
Moteurs de recherche : un oeil sous le capot avec Elastic Search
 

Último

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Micro frontend: The microservices puzzle extended to frontend

  • 1. Micro FrontEnd The microservices puzzle extended to frontend
  • 3. An History of Evolution Front-End Back-End Database Monolith Front-End Front & Back Front & Microservices Back-End Database Product service Search Service Checkout service Front-End
  • 4. It’s Not Only About Architecture Front-End Back-End Database Monolith Front-End Front & Back Front & Microservices Back-End Database Product service Search Service Checkout service Front-End The Pet Store Team The Front End Team The Back End Team The Front End Team Product Team Search Team Checkout Team
  • 5. 42 1 5 Microservices Benefits Small & Specialized Teams Easier to scale Micro Services Freedom in stack’s choices Easier to deploy 3 4
  • 6. Front & Microservices: The perfect match? Front & Microservices Product service Search Service Checkout service Front-End The Front End Team Product Team Search Team Checkout Team
  • 7. Next Step of Evolution Product Team Search Team Checkout Team Front-End Back-End Database Front-End Back-End Database Front-End Back-End Database
  • 9. The Petstore Reloaded Search Team Product Team Checkout Team
  • 10. Customer Focused Teams Product Team Search Team Checkout Team Front-End Back-End Database Front-End Back-End Database Front-End Back-End Database
  • 11. Customer Focused Teams Product Team Search Team Checkout Team Front-End Back-End Database Front-End Back-End Database Front-End Back-End Database Mission: present the product in a clear way Mission: help finding the right product quickly Mission: make the checkout experience easy
  • 12. 3 4 5 2 1 Micro Frontend Benefits Freedom in stack’s choices Small Customer Centric Teams Autonomous development Autonomous release of features Application’s evolution made easier Micro Frontend
  • 13. Real Life Study Case July 2015 Manager March 2017 Governance August 2017 Operations : Data Fabric
  • 14. Real Life Study Case: Data Fabric V2 is coming Time to reorganize the team! OCT 2017 December 2017 Layout March 2018 Galaxy July 2018 Layout-as-lib
  • 16. Design System (aka saagie-ui)
  • 19. What’s a Web Component? Custom Elements Shadow Dom HTML Template ES Modules
  • 20. <my-component> My-component.js Index.html class MyComponent extends HTMLElement { connectedCallback() { // element has been attached to the DOM } disconnectedCallback() { // element has been detached from the DOM } attributeChangedCallback() { // an attribute value has changed } render() { this.innerHTML = `<div> … </div>`; } } customElements.define('my-component', MyComponent); <html lang="en"> <head> <title>My application</title> </head> <body> </body> </html> <script type="module" src="my-component.js"> </script> <my-component></my-component> <script src="/lib/document-register-element.js"> </script>
  • 24. From an Application To a Web Component class DataManager extends HTMLElement { constructor() { this.render(); } render() { this.platform = this.getAttribute('platform'); this.innerHTML = } } angular .module('data-manager') .controller('AppController', AppController); AppController.$inject = ['$scope', '$rootScope', '$state', … ]; function AppController($scope, $rootScope, $state, ...) { … } app-controller.js data-manager.js customElements.define('saagie-data-manager',DataManager); `<div ng-app="data-manager" ng-controller="AppController"> <platform-nav platform=${this.platform}> </platform-nav> </div>`;
  • 25. From an Application To a Web Component class DataGovernance extends HTMLElement { connectedCallback() { this.render(); } render() { this.apiPath = this.getAttribute('datagov-url'); this.innerHTML = } } @Component({ selector: 'data-governance’, templateUrl: './app.component.html', providers: [] }) export class AppComponent { … } app-component.js data-governance.js `<data-governance id="data-governance" datagov-url=${this.apiPath}> </data-governance>`; customElements.define('saagie-data-governance', DataGovernance);
  • 26. Saagie-Layout index.html <html lang="en"> <head> </head> <body> </body> </html> <link rel="stylesheet" href="/saagie-ui/src/index.css"> <script src="/data-governance/web-components/data-governance.js"> </script> <script src="/data-fabric/web-components/data-manager.js"> </script> <sla-board></sla-board>
  • 27. Saagie-Layout class Board extends HTMLElement { render(path, user) { const page = this.getPage(path); this.innerHTML = } … getPage(path) { let page; switch (path) { case PROJECTS : page = `<saagie-data-manager id="data-manager" platform=${getSelectedPlatform()}> </saagie-data-manager>`; break; case GOVERNANCE : page = `<saagie-data-governance id="data-governance" datagov-url="${this.dataGovUrl}"> </saagie-data-governance>`; break; } } } board.js `<div class="sui-l-app-layout"> <sla-topbar currentPage="${path}"> </sla-topbar> <account-menu currentUser="${user}"> </account-menu> <primary-nav></primary-nav> <div class="sui-l-app-layout__page"> ${page} </div> </div>`; customElements.define('sla-board', Board);
  • 28. Pros & Cons ConsPros ● consistent user experience ● not a true SPA ● high dependencies on libraries between apps ● bad performances ● routers management ● implies to run the entire stack locally ● possibility to display several components on the same page ● independent deployment
  • 30. Pros & Cons ConsPros ● possibility to share components between applications ● still high dependencies on libraries between apps ● centralized routing system ● but also between React’s versions
  • 32. Layout-as-Lib <html> <head> <title>Saagie Governance</title> </head> <body id="sui-root"> <data-governance-angular class="sui-l-app-layout__subapp"> </data-governance-angular> </body> </html> index.html import {AppModule} from './app/app.module'; import {LoadLayoutData} from 'saagie-layout-lib'; platformBrowserDynamic().bootstrapModule(AppModule); main.ts <saagie-layout current-platform-object='{"loading": true}' hide="true"> </saagie-layout> const legacy = window .location .pathname.startsWith('/datagovernance'); if (!legacy) { const hrefParameters = window.location.href.split('platform/'); new LoadLayoutData().init('governance', parseInt(hrefParameters[1], 10)); const layout = document.querySelector('saagie-layout'); layout.removeAttribute('hide'); }
  • 33. Layout-as-Lib import '@webcomponents/custom-elements'; import './web-components/Layout'; import './web-components/PrimaryNav'; import './web-components/Topbar'; index.js export default class LoadLayoutData { … LoadLayoutData.js import LoadLayoutData from './services/LoadLayoutData'; export default { LoadLayoutData }; async loadData(layoutComponent, currentApp, currentPlatformId) { await this.loadRights(); await this.loadJobsData(); await this.loadProfile(); } init(currentApp, currentPlatformId) { const layoutComponent = document.querySelector('saagie-layout'); return this.loadData(layoutComponent, currentApp, currentPlatformId); }}
  • 34. Layout-as-Lib import '@webcomponents/custom-elements'; import './web-components/Layout'; import './web-components/PrimaryNav'; import './web-components/Topbar'; index.js export default class LoadLayoutData { … LoadLayoutData.js import LoadLayoutData from './services/LoadLayoutData'; export default { LoadLayoutData }; async loadRights(){ const rights = await fetch(apiRightsUrl); this.login = rights.login; this.setUser({ login: this.login }); this.setPlatforms(rights.platforms)); } setPlatforms(platforms) { this.layoutComponent .setAttribute('platforms-list-object', JSON.stringify({platforms})); }
  • 35. Layout-as-Lib layout.js class Layout extends HTMLElement { … initRender() { this.innerHTML = `<div class="sui-l-app-layout" id="sui-root"> <saagie-topbar class="sui-o-topbar"> </saagie-topbar> <saagie-primary-nav class="sui-o-primary-nav"> </saagie-primary-nav> ${this.innerHTML} </div>`; } } connectedCallback() { this.initRender(); … } attributeChangedCallback(name, oldValue, newValue) { switch (name) { case 'current-app': this.changeChildAttribute ('saagie-topbar', name, newValue); this.changeChildAttribute ('saagie-primary-nav', name, newValue); break; case 'current-platform-object': … if(!customElements.get('saagie-layout')){ customElements.define('saagie-layout', Layout); }
  • 36. Pros & Cons ConsPros ● not an SPA at all ● no components aggregation possible
  • 41. Pros & Cons ConsPros ● way more faster ● easier to integrate ● breaking changes implies to update each application ● possible inconsistent user experience ● independent deployment AND development ● no more libraries conflict ● can be run on its own
  • 42. Data Fabric July 2015 Manager March 2017 Governance August 2017 Operations
  • 43. Data Fabric V2 V2 is coming Time to reorganize the team! OCT 2017 December 2017 Layout March 2018 Galaxy May 2018 Security
  • 44. Data Fabric V2 September 2018 Project & Jobs July 2018 App Store December 2018 Dataset Access June 2018 Layout-as-lib
  • 45. Best practices, tips & tricks Think usecase first Take care of your design Share ressources, not runtime! Aggregation of components or aggregation of SPA? Design system, optimistic UI, skeletons ... Build independent and self contained apps Share libraries and common services
  • 46. ● Micro-frontends.org https://github.com/neuland/micro-frontends Micro Frontends talk by Michael Geers at Web Rebels, Oslo 2018 @nataltis ● Experiences Using Micro FrontEnds at IKEA https://www.infoq.com/news/2018/08/experiences-micro-frontends ● Project Mosaic (Zalando) https://www.mosaic9.org/ ● Single SPA https://single-spa.js.org/ To go further