Herdy Handoko
Well-rounded developer focusing on web technologies. Distributed computing, concurrency, and the actor model. Scala, Play, Akka, and Kotlin.
BukaMeetup, Microfrontends - 20th March 2019
_hhandoko
hhandoko
hhandoko.com
Overview of microfrontend architecture:
Microfrontends at Standard Chartered:
Core ideas:
Notes:
[1] - https://micro-frontends.org/#what-are-micro-frontends
Also known as:
Comparable concepts:
Extends the concept of microservices to the frontend.
Notes:
[1] - https://micro-frontends.org/ressources/diagrams/organisational/monolith-frontback-microservices.png
Notes:
[1] - https://micro-frontends.org/ressources/diagrams/organisational/verticals-headline.png
Notes:
[1] - https://micro-frontends.org/ressources/screen/three-teams.png
Microfrontend is an architectural goal, not technology stacks
Customers:
Development Teams:
Reinvention(s):
Too much coupling:
Lack of coupling:
Restructuring teams around business domains and capabilities:
Knowledge on specific domain can be transferable across regions and markets.
Team composition remains fluid, but enable better continuity from project to project.
Feature development happens on one vertical until the point of integration.
Bugs easier to troubleshoot as complexity can be contained in one vertical.
Tests are 'cheaper' to run.
Each vertical can set its own development cadence and release schedule.
Customer requirements indicate that we were going to build a content-heavy web application, with only limited interactivity.
Notes:
[1] - https://cdn-images-1.medium.com/max/1600/1*NJMQCgyMShhjYx6dE_pbRw.png
[2] - https://medium.com/@areai51/microfrontends-an-approach-to-building-scalable-web-apps-e8678e2acdd6
[3] - https://2018.ar.al/notes/the-documents-to-applications-continuum/
Complexity lies in data sourcing and aggregation:
Offline first and PWAs:
skatejs:
node-tailor:
markojs:
Notes:
[1] - https://skatejs.netlify.com/
[2] - https://github.com/zalando/tailor
[3] - https://markojs.com/
Server Side Rendering:
Edge Side Includes:
Notes:
[1] - https://en.wikipedia.org/wiki/Edge_Side_Includes
[2] - https://medium.com/walmartlabs/the-benefits-of-server-side-rendering-over-client-side-rendering-5d07ff2cefe8
Customisations:
Replaced `good-guy-http` with Axios for consistency with the rest of the apps, contextual logging, tuneable retry strategy, and Bearer token header embeds.
Subset of ESI standard with a Promise-based interface.
Notes:
[1] - https://github.com/Schibsted-Tech-Polska/nodesi
<esi:include src="http://example.com/1.html"
alt="http://bak.example.com/2.html"
onerror="continue"/>
Stacks:
Build Tools:
Infrastructure:
Others:
Optimise for Time to First Render:
Other considerations:
Notes:
[1] - https://github.com/spdy-http2/node-spdy
[2] - https://github.com/patrick-steele-idem/morphdom
Optimise for clarity:
Optimise for fast response and small payload:
Other considerations:
Notes:
[1] - https://github.com/fizzed/rocker
[2] - https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#spring-webflux
[3] - https://micronaut.io/
[4] - https://typelevel.org/cats-effect/datatypes/io.html
Progressive enhancements:
Agreed conventions:
Other considerations:
Implicit assumptions from modern web and mobile apps:
Monorepo for each vertical:
Services are broken down into small modules which are shared by runtime artifacts (i.e. apps).
End to end development within a (domain) boundary.
Various environment-specific configurations:
Service mocks and API-compatible alternatives:
Promote shared resource as a library:
Three types of resource available:
HTML page format is used during development to provide an indication how the component will look and behave.
HTML fragments are the resource used for embedding in the web application.
By Herdy Handoko
Presentation on Server-side microfrontends, prepared for BukaMeetup on 20 March 2019. Link: https://slides.com/hhandoko/server-side-microfrontends-buka-meetup
Well-rounded developer focusing on web technologies. Distributed computing, concurrency, and the actor model. Scala, Play, Akka, and Kotlin.