SlideShare a Scribd company logo
Node.js BFFs -
our way to the
better/micro
frontends
1
Eugene Fidelin
Marktplaats Facts & Figures
2
With over 8 million unique visitors monthly and 18.7 million live ads at any given time,
Marktplaats is the largest trading platform in the Netherlands
New ads per day
350K
Visits per day
6.5M
Hits per day
(~4000 per second)
300-400M
Connected ads per day
100K
mFs - an architectural style where
independently deliverable
frontend applications are
composed into a greater whole
Cam Jakson, ThoughtWorks
Micro frontends livecycle
4
Cam Jakson, ThoughtWorks
How to compose micro frontends
Infrastructure
Have an HTTP server that
routes requests to multiple
frontends.
Runtime
Have a controller app
running on the browser
(and/or server) which
selects which script/app to
load.
Build time
Deploy components/apps
as npm packages, and use
them during the build time.
5
BFF – a pattern where each
frontend application has a
corresponding backend whose
purpose is solely to serve the
needs of that frontend
Cam Jakson, ThoughtWorks
Micro frontends and BFFs
Cam Jakson, ThoughtWorks
7
8
BFF is a best friend to the micro frontend that enables:
● Customizable API authentication/authorization
● Flexible a/b experiments setup
● Highly tailored data fetching and aggregation
● Server-side rendering on demand
Micro frontends and BFFs
9
● 3 huge monolithic frontends tightly coupled with
backend services
● No clear ownership of the frontend codebase
● Business logic leaking into the view layer
● No support for multiple tenants and languages
● Fragile builds because of huge amount of e2e tests
● Very long time to market
● Old and legacy JavaScript stack, JSP on the server
● Minimal developer happiness
Where we were 3 years ago
10
● > 25 small, loosely coupled but highly aligned BFFs
● Each BFF is owned by a specific team and tailored to a
specific step(s) of a user journey
● Downstream APIs don’t leak business logic to BFFs
● Support for multiple tenants and languages
● Stable builds due to more integration and unit tests and
less e2e tests
● Shorter time to market
● Modern JS, TS and frameworks on the server and client
● Higher developer happiness and productivity
Where we are now
Architectural changes
11
Design of the Web BFF
12
13
● Easy to run BFFs locally, no hard dependencies on other
services
● Locally BFF can use APIs from any other environment
● Frontend developers write both server and client code
● Swagger is the contract between BFFs and APIs
● Typescript allows to share types between server and
client side code
● Plenty of ready-to-use internal libraries,
Design System provides common components and styles
● Clear ownership and PR reviews agreements
Developer experience
Code share and reuse
Client side code
• Common styles, fonts and images
• React components (Buttons, Inputs, …)
• React applications (Header, Login
dialog, ..)
• Type definitions
Server infrastructure code
• Middlewares
• API clients
• HTML rendering
• Metrics, logging and tracing
• Type definitions
14
Testing trophy
15
Selenium
Jest, Supertest,
Cypress.io (wip)
Jest,
@testing-library/react
Stage of the
Docker build
Eslint,
Typescript
Kent C. Dodds, TestingJavaScript.com
Build and deploy
Build
• Shared build config (Webpack, Babel,
eslint, tsconfig)
• Shared multi-stage Docker build
• Automated dependency updates with
Renovate
• Automated builds for master and PR
• Automated security scans by Snyk.io
• Quality checks with SonarQube
Deploy
• Feature switches and a/b switches
• Canary releases
• One-click production rollback
• Overview of dependencies used on
production
16
17
● Each frontend app uses only its own BFF
● Keep BFF small and scale by increasing number of
instances
● SSR only for bots, app shell and user-critical content
● Experimenting with offloading SSR to a separate thread
● Calls to the downstream APIs are run in parallel
● Smart load balancing of API calls
● CDN to serve static resources with cache to reduce
downloaded bytes
Scale and performance
Alerting and monitoring
Client
• Error logs in Sentry
• Performance tests and real user
monitoring by Speedcurve
Server
• Access and error logs in Kibana
• Metrics in Graphana
• Node.js event loop, memory
usage, garbage collector
• Response status and latency
• Tracing in Jaeger
• Profile and monitor distributed
platform
18
Pros and Cons
Pros
• Huge improvement of time-to-market
for product features
• Smaller, more isolated and maintainable
codebases
• Good fit for the scalable organisation
with decoupled, autonomous teams
• Ability to update or rewrite parts of the
frontend in a more incremental fashion
Cons
• Duplicate dependencies and increasing
the number of bytes the users
downloads
• Team autonomy leads to platform
fragmentation and inconsistent
codebases / APIs
• Extra effort to keep all frontends
up-to-date
• CI/CD pipeline performance becomes a
bottleneck
19
How we make decisions
Frontend Chapter
Supports close
collaboration and
knowledge sharing among
all frontend developers.
Tech Radar
List of Techniques, Tools,
Platforms, Language &
frameworks we observe:
currently used, tested, under
research or put on hold.
ADRs
Capture an important
architectural decisions
made along with its context
and consequences.
20
21
1. Adopt runtime composition by Webpack Module
Federation
2. Make it work nicely together with React SSR
3. Build a PoC to collect metrics, learn, pinpoint risks and
obstacles
4. Achieve the following goals:
● make React app to be the minimal delivery artifact
instead of a complete page
● be able to update the shared features (like header)
with a single deploy
Plans for the future
22
● Micro Frontends (Cam Jackson)
● Pattern: Backends For Frontends (Sam Newman)
● Micro-frontend Architecture in Action with six ways
(Phodal Huang)
● Micro-frontends resources (Luca Mezzalira)
● How To Convert a Huge Frontend Monolith to a
Micro-frontend (Dream11 Engineering)
● Building Micro-Frontends (book by Luca Mezzalira)
Useful links
Thank you
23
Eugene Fidelin
Frontend Architect
Marktplaats.nl | Adevinta
linkedin.com/in/eugef
medium.com/@EugeneFidelin

More Related Content

What's hot

Mikrofrontend a Module Federation
Mikrofrontend a Module FederationMikrofrontend a Module Federation
Mikrofrontend a Module Federation
The Software House
 
Micro-frontend
Micro-frontendMicro-frontend
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
 
Micro Frontends Architecture
Micro Frontends ArchitectureMicro Frontends Architecture
Micro Frontends Architecture
Rag Dhiman
 
Micro frontends
Micro frontendsMicro frontends
Micro frontends
Assaf Gannon
 
Node.js BFFs: our way to better/micro frontends
Node.js BFFs: our way to better/micro frontendsNode.js BFFs: our way to better/micro frontends
Node.js BFFs: our way to better/micro frontends
Eugene Fidelin
 
Micro frontend
Micro frontendMicro frontend
Micro frontend
Amr Abd El Latief
 
Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019
Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019
Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019
Codemotion
 
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
DevDay.org
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
viniciusban
 
Micro-Frontend Architecture
Micro-Frontend ArchitectureMicro-Frontend Architecture
Micro-Frontend Architecture
Livares Technologies Pvt Ltd
 
Gitops Hands On
Gitops Hands OnGitops Hands On
Gitops Hands On
Brice Fernandes
 
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
Edureka!
 
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Tech Triveni
 
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai..."Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
Fwdays
 
Universal React apps in Next.js
Universal React apps in Next.jsUniversal React apps in Next.js
Universal React apps in Next.js
🐕 Łukasz Ostrowski
 
GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...
Weaveworks
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker, Inc.
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
dotCloud
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
Araf Karsh Hamid
 

What's hot (20)

Mikrofrontend a Module Federation
Mikrofrontend a Module FederationMikrofrontend a Module Federation
Mikrofrontend a Module Federation
 
Micro-frontend
Micro-frontendMicro-frontend
Micro-frontend
 
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 - ...
 
Micro Frontends Architecture
Micro Frontends ArchitectureMicro Frontends Architecture
Micro Frontends Architecture
 
Micro frontends
Micro frontendsMicro frontends
Micro frontends
 
Node.js BFFs: our way to better/micro frontends
Node.js BFFs: our way to better/micro frontendsNode.js BFFs: our way to better/micro frontends
Node.js BFFs: our way to better/micro frontends
 
Micro frontend
Micro frontendMicro frontend
Micro frontend
 
Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019
Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019
Ivan Jovanovic - Micro Frontends - Codemotion Rome_2019
 
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
 
Micro-Frontend Architecture
Micro-Frontend ArchitectureMicro-Frontend Architecture
Micro-Frontend Architecture
 
Gitops Hands On
Gitops Hands OnGitops Hands On
Gitops Hands On
 
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
 
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)
 
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai..."Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
 
Universal React apps in Next.js
Universal React apps in Next.jsUniversal React apps in Next.js
Universal React apps in Next.js
 
GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
 

Similar to Node.js BFFs - our way to the better/micro frontends

Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...
Design World
 
Mridul_Halder_Resume
Mridul_Halder_ResumeMridul_Halder_Resume
Mridul_Halder_ResumeMridul Halder
 
Maniteja_Professional_Resume
Maniteja_Professional_ResumeManiteja_Professional_Resume
Maniteja_Professional_ResumeVaddi Maniteja
 
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.jsAsynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Christian Heindel
 
Cloud Native Application Integration With APIs
Cloud Native Application Integration With APIsCloud Native Application Integration With APIs
Cloud Native Application Integration With APIs
Nirmal Fernando
 
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...WSPDC & FEDSPUG
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP Applications
Ronny López
 
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB
 
Delia_J_Micu_resume_arch_Jan_2015
Delia_J_Micu_resume_arch_Jan_2015Delia_J_Micu_resume_arch_Jan_2015
Delia_J_Micu_resume_arch_Jan_2015Delia J. Micu
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
IT Arena
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
Adam Mokan
 
Top 10 python frameworks for web development in 2020
Top 10 python frameworks for web development in 2020Top 10 python frameworks for web development in 2020
Top 10 python frameworks for web development in 2020
Alaina Carter
 
20160422 Speedy Framework Enterprise Application Development Platform
20160422 Speedy Framework Enterprise Application Development Platform20160422 Speedy Framework Enterprise Application Development Platform
20160422 Speedy Framework Enterprise Application Development Platform
Harezmi IT Solutions
 
Confluent Partner Tech Talk with Reply
Confluent Partner Tech Talk with ReplyConfluent Partner Tech Talk with Reply
Confluent Partner Tech Talk with Reply
confluent
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2
 
"Different software evolutions from Start till Release in PHP product" Oleksa...
"Different software evolutions from Start till Release in PHP product" Oleksa..."Different software evolutions from Start till Release in PHP product" Oleksa...
"Different software evolutions from Start till Release in PHP product" Oleksa...
Fwdays
 
PHPFrameworkDay 2020 - Different software evolutions from Start till Release ...
PHPFrameworkDay 2020 - Different software evolutions from Start till Release ...PHPFrameworkDay 2020 - Different software evolutions from Start till Release ...
PHPFrameworkDay 2020 - Different software evolutions from Start till Release ...
Alexandr Savchenko
 
Introduction to Backend Development (1).pptx
Introduction to Backend Development (1).pptxIntroduction to Backend Development (1).pptx
Introduction to Backend Development (1).pptx
OsuGodbless
 

Similar to Node.js BFFs - our way to the better/micro frontends (20)

Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...
 
Mridul_Halder_Resume
Mridul_Halder_ResumeMridul_Halder_Resume
Mridul_Halder_Resume
 
Maniteja_Professional_Resume
Maniteja_Professional_ResumeManiteja_Professional_Resume
Maniteja_Professional_Resume
 
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.jsAsynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
 
Cloud Native Application Integration With APIs
Cloud Native Application Integration With APIsCloud Native Application Integration With APIs
Cloud Native Application Integration With APIs
 
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP Applications
 
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
 
Delia_J_Micu_resume_arch_Jan_2015
Delia_J_Micu_resume_arch_Jan_2015Delia_J_Micu_resume_arch_Jan_2015
Delia_J_Micu_resume_arch_Jan_2015
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
 
Mannu_Kumar_CV
Mannu_Kumar_CVMannu_Kumar_CV
Mannu_Kumar_CV
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 
Top 10 python frameworks for web development in 2020
Top 10 python frameworks for web development in 2020Top 10 python frameworks for web development in 2020
Top 10 python frameworks for web development in 2020
 
20160422 Speedy Framework Enterprise Application Development Platform
20160422 Speedy Framework Enterprise Application Development Platform20160422 Speedy Framework Enterprise Application Development Platform
20160422 Speedy Framework Enterprise Application Development Platform
 
Confluent Partner Tech Talk with Reply
Confluent Partner Tech Talk with ReplyConfluent Partner Tech Talk with Reply
Confluent Partner Tech Talk with Reply
 
Chalam_JAVA_Portal
Chalam_JAVA_PortalChalam_JAVA_Portal
Chalam_JAVA_Portal
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
"Different software evolutions from Start till Release in PHP product" Oleksa...
"Different software evolutions from Start till Release in PHP product" Oleksa..."Different software evolutions from Start till Release in PHP product" Oleksa...
"Different software evolutions from Start till Release in PHP product" Oleksa...
 
PHPFrameworkDay 2020 - Different software evolutions from Start till Release ...
PHPFrameworkDay 2020 - Different software evolutions from Start till Release ...PHPFrameworkDay 2020 - Different software evolutions from Start till Release ...
PHPFrameworkDay 2020 - Different software evolutions from Start till Release ...
 
Introduction to Backend Development (1).pptx
Introduction to Backend Development (1).pptxIntroduction to Backend Development (1).pptx
Introduction to Backend Development (1).pptx
 

More from Eugene Fidelin

Testing: Do More With Less
Testing: Do More With LessTesting: Do More With Less
Testing: Do More With Less
Eugene Fidelin
 
Housekeeping the platform at scale
Housekeeping the platform at scaleHousekeeping the platform at scale
Housekeeping the platform at scale
Eugene Fidelin
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
Eugene Fidelin
 
Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practice
Eugene Fidelin
 
Безопасность Drupal сайтов
Безопасность Drupal сайтовБезопасность Drupal сайтов
Безопасность Drupal сайтов
Eugene Fidelin
 
Разработка и deploy Drupal сайтов с помощью Features.
Разработка и deploy Drupal сайтов с помощью Features.Разработка и deploy Drupal сайтов с помощью Features.
Разработка и deploy Drupal сайтов с помощью Features.
Eugene Fidelin
 
Работа с Views в Drupal 7
Работа с Views в Drupal 7Работа с Views в Drupal 7
Работа с Views в Drupal 7
Eugene Fidelin
 
Работа с полями (fields) в Drupal 7
Работа с полями (fields) в Drupal 7Работа с полями (fields) в Drupal 7
Работа с полями (fields) в Drupal 7
Eugene Fidelin
 
Работа с материалами (nodes) в Drupal 7
Работа с материалами (nodes) в Drupal 7Работа с материалами (nodes) в Drupal 7
Работа с материалами (nodes) в Drupal 7
Eugene Fidelin
 
Работа с БД в Drupal 7
Работа с БД в Drupal 7Работа с БД в Drupal 7
Работа с БД в Drupal 7
Eugene Fidelin
 
Фичи н-н-нада? Или почему стоит использовать модуль Features.
Фичи н-н-нада? Или почему стоит использовать модуль Features.Фичи н-н-нада? Или почему стоит использовать модуль Features.
Фичи н-н-нада? Или почему стоит использовать модуль Features.
Eugene Fidelin
 

More from Eugene Fidelin (11)

Testing: Do More With Less
Testing: Do More With LessTesting: Do More With Less
Testing: Do More With Less
 
Housekeeping the platform at scale
Housekeeping the platform at scaleHousekeeping the platform at scale
Housekeeping the platform at scale
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
 
Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practice
 
Безопасность Drupal сайтов
Безопасность Drupal сайтовБезопасность Drupal сайтов
Безопасность Drupal сайтов
 
Разработка и deploy Drupal сайтов с помощью Features.
Разработка и deploy Drupal сайтов с помощью Features.Разработка и deploy Drupal сайтов с помощью Features.
Разработка и deploy Drupal сайтов с помощью Features.
 
Работа с Views в Drupal 7
Работа с Views в Drupal 7Работа с Views в Drupal 7
Работа с Views в Drupal 7
 
Работа с полями (fields) в Drupal 7
Работа с полями (fields) в Drupal 7Работа с полями (fields) в Drupal 7
Работа с полями (fields) в Drupal 7
 
Работа с материалами (nodes) в Drupal 7
Работа с материалами (nodes) в Drupal 7Работа с материалами (nodes) в Drupal 7
Работа с материалами (nodes) в Drupal 7
 
Работа с БД в Drupal 7
Работа с БД в Drupal 7Работа с БД в Drupal 7
Работа с БД в Drupal 7
 
Фичи н-н-нада? Или почему стоит использовать модуль Features.
Фичи н-н-нада? Или почему стоит использовать модуль Features.Фичи н-н-нада? Или почему стоит использовать модуль Features.
Фичи н-н-нада? Или почему стоит использовать модуль Features.
 

Recently uploaded

Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 

Recently uploaded (20)

Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 

Node.js BFFs - our way to the better/micro frontends

  • 1. Node.js BFFs - our way to the better/micro frontends 1 Eugene Fidelin
  • 2. Marktplaats Facts & Figures 2 With over 8 million unique visitors monthly and 18.7 million live ads at any given time, Marktplaats is the largest trading platform in the Netherlands New ads per day 350K Visits per day 6.5M Hits per day (~4000 per second) 300-400M Connected ads per day 100K
  • 3. mFs - an architectural style where independently deliverable frontend applications are composed into a greater whole Cam Jakson, ThoughtWorks
  • 4. Micro frontends livecycle 4 Cam Jakson, ThoughtWorks
  • 5. How to compose micro frontends Infrastructure Have an HTTP server that routes requests to multiple frontends. Runtime Have a controller app running on the browser (and/or server) which selects which script/app to load. Build time Deploy components/apps as npm packages, and use them during the build time. 5
  • 6. BFF – a pattern where each frontend application has a corresponding backend whose purpose is solely to serve the needs of that frontend Cam Jakson, ThoughtWorks
  • 7. Micro frontends and BFFs Cam Jakson, ThoughtWorks 7
  • 8. 8 BFF is a best friend to the micro frontend that enables: ● Customizable API authentication/authorization ● Flexible a/b experiments setup ● Highly tailored data fetching and aggregation ● Server-side rendering on demand Micro frontends and BFFs
  • 9. 9 ● 3 huge monolithic frontends tightly coupled with backend services ● No clear ownership of the frontend codebase ● Business logic leaking into the view layer ● No support for multiple tenants and languages ● Fragile builds because of huge amount of e2e tests ● Very long time to market ● Old and legacy JavaScript stack, JSP on the server ● Minimal developer happiness Where we were 3 years ago
  • 10. 10 ● > 25 small, loosely coupled but highly aligned BFFs ● Each BFF is owned by a specific team and tailored to a specific step(s) of a user journey ● Downstream APIs don’t leak business logic to BFFs ● Support for multiple tenants and languages ● Stable builds due to more integration and unit tests and less e2e tests ● Shorter time to market ● Modern JS, TS and frameworks on the server and client ● Higher developer happiness and productivity Where we are now
  • 12. Design of the Web BFF 12
  • 13. 13 ● Easy to run BFFs locally, no hard dependencies on other services ● Locally BFF can use APIs from any other environment ● Frontend developers write both server and client code ● Swagger is the contract between BFFs and APIs ● Typescript allows to share types between server and client side code ● Plenty of ready-to-use internal libraries, Design System provides common components and styles ● Clear ownership and PR reviews agreements Developer experience
  • 14. Code share and reuse Client side code • Common styles, fonts and images • React components (Buttons, Inputs, …) • React applications (Header, Login dialog, ..) • Type definitions Server infrastructure code • Middlewares • API clients • HTML rendering • Metrics, logging and tracing • Type definitions 14
  • 15. Testing trophy 15 Selenium Jest, Supertest, Cypress.io (wip) Jest, @testing-library/react Stage of the Docker build Eslint, Typescript Kent C. Dodds, TestingJavaScript.com
  • 16. Build and deploy Build • Shared build config (Webpack, Babel, eslint, tsconfig) • Shared multi-stage Docker build • Automated dependency updates with Renovate • Automated builds for master and PR • Automated security scans by Snyk.io • Quality checks with SonarQube Deploy • Feature switches and a/b switches • Canary releases • One-click production rollback • Overview of dependencies used on production 16
  • 17. 17 ● Each frontend app uses only its own BFF ● Keep BFF small and scale by increasing number of instances ● SSR only for bots, app shell and user-critical content ● Experimenting with offloading SSR to a separate thread ● Calls to the downstream APIs are run in parallel ● Smart load balancing of API calls ● CDN to serve static resources with cache to reduce downloaded bytes Scale and performance
  • 18. Alerting and monitoring Client • Error logs in Sentry • Performance tests and real user monitoring by Speedcurve Server • Access and error logs in Kibana • Metrics in Graphana • Node.js event loop, memory usage, garbage collector • Response status and latency • Tracing in Jaeger • Profile and monitor distributed platform 18
  • 19. Pros and Cons Pros • Huge improvement of time-to-market for product features • Smaller, more isolated and maintainable codebases • Good fit for the scalable organisation with decoupled, autonomous teams • Ability to update or rewrite parts of the frontend in a more incremental fashion Cons • Duplicate dependencies and increasing the number of bytes the users downloads • Team autonomy leads to platform fragmentation and inconsistent codebases / APIs • Extra effort to keep all frontends up-to-date • CI/CD pipeline performance becomes a bottleneck 19
  • 20. How we make decisions Frontend Chapter Supports close collaboration and knowledge sharing among all frontend developers. Tech Radar List of Techniques, Tools, Platforms, Language & frameworks we observe: currently used, tested, under research or put on hold. ADRs Capture an important architectural decisions made along with its context and consequences. 20
  • 21. 21 1. Adopt runtime composition by Webpack Module Federation 2. Make it work nicely together with React SSR 3. Build a PoC to collect metrics, learn, pinpoint risks and obstacles 4. Achieve the following goals: ● make React app to be the minimal delivery artifact instead of a complete page ● be able to update the shared features (like header) with a single deploy Plans for the future
  • 22. 22 ● Micro Frontends (Cam Jackson) ● Pattern: Backends For Frontends (Sam Newman) ● Micro-frontend Architecture in Action with six ways (Phodal Huang) ● Micro-frontends resources (Luca Mezzalira) ● How To Convert a Huge Frontend Monolith to a Micro-frontend (Dream11 Engineering) ● Building Micro-Frontends (book by Luca Mezzalira) Useful links
  • 23. Thank you 23 Eugene Fidelin Frontend Architect Marktplaats.nl | Adevinta linkedin.com/in/eugef medium.com/@EugeneFidelin