Verticalized Systems and Micro Frontends

Verticalized Systems and Micro Frontends

Voxxed Days Athen (Athen, Greece)

https://voxxeddays.com/athens/

E6c61f085d7aceaf97b7bd00e9195514?s=128

SQUER Solutions

June 07, 2019
Tweet

Transcript

  1. 3.

    @duffleit leitner.io “the idea of micro frontends is to extend

    the concept of micro services to the frontend world.”
  2. 4.

    @duffleit leitner.io Secret 1: That's fine in 80 % of

    the cases. SPA API Gateway Microservice Microservice Microservice DB DB DB
  3. 8.

    @duffleit leitner.io Why autonomous? ✔ Independent Deployments ✔ Distinct Operations

    ✔ Technology Agnostic ✔ Model around Business Domains ✔ Small Interface Surface ✔ Parallel development
  4. 9.

    @duffleit leitner.io Microservice API Gateway SPA Microservice Microservice DB DB

    DB ❌ Independent Deployments ❌ Distinct Operations ❌ Technology Agnostic ❌ Small Interface Surface ❌ Parallel development Frontend Monolith
  5. 11.

    @duffleit leitner.io μService Ordering μService DB μService μService DB DB

    Catalogue Profile μService DB DB Hyperlink Hyperlink
  6. 12.

    @duffleit leitner.io ✔ Independent Deployments ✔ Distinct Operations ✔ Technology

    Agnostic ✔ Small Interface Surface ✔ Model around Business Domains ✔ Parallel development Based on the assumption to have fully verticalized systems. μService Ordering μService DB μService μService DB DB Catalogue Profile μService DB DB Hyperlink Hyperlink Approach 1: Hyperlink Connected Applications
  7. 13.

    @duffleit leitner.io μService Ordering μService DB μService μService DB DB

    Catalogue Profile μService DB DB Hyperlink Hyperlink Dashboard Hyperlink μService DB ⛔ Overfetching ⛔ Overrequesting Approach 1: Hyperlink Connected Applications
  8. 14.

    @duffleit leitner.io Approach 1: Hyperlink Connected Applications with Backend for

    Frontends μService Ordering μService DB μService μService DB DB Catalogue Profile μService DB DB Hyperlink Hyperlink Dashboard Hyperlink μService DB BFF Service BFF Service BFF Service BFF Service https://samnewman.io/patterns/architectural/bff/ Presentation Process Flow Domain Logic Data Presentation Process Flow Domain Logic Data
  9. 15.

    @duffleit leitner.io Approach 1: Hyperlink Connected Applications with GraphQL μService

    Ordering μService DB μService μService DB DB Catalogue Profile μService DB DB Hyperlink Hyperlink Dashboard Hyperlink μService DB GraphQL Presentation Process Flow Domain Logic Data
  10. 16.

    @duffleit leitner.io The more coarse-grained you can go, the more

    coarse-grained you should go. Or: Think big.
  11. 20.

    @duffleit leitner.io μService Ordering μService DB μService μService DB DB

    Catalogue Profile μService DB DB Hyperlink Hyperlink Dashboard Hyperlink μService DB View Aggregation Layer Horizontal Layer Ripple Effect
  12. 21.

    @duffleit leitner.io Dashboard Profile Profile μService DB Catalogue μService DB

    Catalogue Ordering Ordering μService DB Dashboard μService DB
  13. 22.

    @duffleit leitner.io Dashboard Profile Catalogue Ordering Ordering Catalogue Hyperlink Hyperlink

    Dashboard How to slice? One “Micro Frontend” per page. 2...n Micro Frontends per page.
  14. 24.

    @duffleit leitner.io Repository Build & Deploy Server Browser Composed Application

    Micro Frontend Build Time Integration Server Side Integration Runtime Integration
  15. 25.

    @duffleit leitner.io Repository Build & Deploy Server Browser Mono Repo

    package.json Composed Application Micro Frontend Build Time Integration MonoRepo ✔ Allows extensive code sharing and reuse. ✔ Simplifies Dependency Management. Angular Workspaces
  16. 26.

    @duffleit leitner.io Repository Build & Deploy Server Browser Composed Application

    Micro Frontend Build Time Integration ❌ Independent Deployments ❌ Distinct Operations ❌ Technology Agnostic ✔ Small Interface Surface ✔ Model around Business Domains ✔ Parallel development
  17. 27.

    @duffleit leitner.io Repository Build & Deploy Server Browser Composed Application

    Micro Frontend Server Side Integration Project Mosaic
  18. 28.

    @duffleit leitner.io Based on the concept of Server Side Includes

    or Edge Side Includes ⛔ JS and CSS global scoped ⛔ Round-Trips are needed
  19. 29.

    @duffleit leitner.io Tailor is a Layout Server header fragment μService

    account fragment μService catalogue fragment μService maps your request to a template checkout-template.html ... dashboard.template.html profile-template.html
  20. 31.

    @duffleit leitner.io supports Javascript-Isolation account fragment μService html script styles

    1...n init(fragment-dom){ ... } isolate CSS: naming-convention like BEM
  21. 32.

    @duffleit leitner.io Repository Build & Deploy Server Browser Composed Application

    Micro Frontend Server Side Integration ✔ Independent Deployments ✔ Distinct Operations ✔ Technology Agnostic ✔ Small Interface Surface ✔ Model around Business Domains ✔ Parallel development
  22. 33.

    @duffleit leitner.io Repository Build & Deploy Server Browser Composed Application

    Micro Frontend Runtime Integration Aggregating UI Routing, Templates, Lazy Loading
  23. 36.

    @duffleit leitner.io the aggregation and configuration is done on a

    single point. immutablewebapps.org index.html https://12factor.net/
  24. 37.

    @duffleit leitner.io Repository Build & Deploy Server Browser Composed Application

    Micro Frontend ✔ Independent Deployments ✔ Distinct Operations ✔ Technology Agnostic ✔ Small Interface Surface ✔ Model around Business Domains ✔ Parallel development Runtime Integration
  25. 39.

    @duffleit leitner.io Server Browser Server Side Integration Runtime Integration Request

    Response Model Interactions between different Verticals are done on the Backend. Longliving App State in the frontend & verticals need to interact with each other.
  26. 42.

    @duffleit leitner.io 1 Micro-Frontend per Page Hyperlink Integration n Micro-Frontends

    per Page Buildtime Integration Serverside Integration Runtime Integration
  27. 44.

    @duffleit leitner.io Micro Frontends in a nutshell Integration and Slicing

    Is your application big?* Frontend Monolith no Are UI/Domain Parts strongly independent? yes Applications integrated with Hyperlinks yes Server Side Integration no Are Server-Roundtrips a problem? no Runtime Integration yes * an application is big enough to justify using micro frontends, if slight UI/UX differences between the two most unrelated subpages are acceptable.
  28. 45.

    @duffleit leitner.io Mix and Match Landing Shop Ordering hyperlink hyperlink

    <!–- SSIs --> <!--#include … --> <!--#include … --> APP SHELL Header Footer