1 of 61

Event Driven Frontends

WHAT, WHY & HOW

(not necessarily in that order)

Matthew Cox

Software Engineer with

linkedin.com/in/matthewcoxlondon

@matt-matters.bsky.social

2 of 61

First… some caveats

  • Fits within an Event Driven Architecture
    • Not browser events (click, mouseover etc) but business events (Eg Reservation Created)
  • Pushes the browser hard (sometimes close to breaking point)
  • Not applicable everywhere. Most suited for returning / invested users
  • We’re still experimenting!

3 of 61

The Why

4 of 61

Example�Reporting in a Property Management System (PMS)

PMS

Customer A�THE GRAND HOTEL

Customer B�COMFORT STAY HOTEL

Customer C�LAKESIDE INN

5 of 61

Example�Reporting in a Property Management System (PMS)

PMS

Customer A�THE GRAND HOTEL

Customer B�COMFORT STAY HOTEL

Customer C�LAKESIDE INN

Revenue Manager

6 of 61

Why

7 of 61

Why

8 of 61

Why

9 of 61

Why

10 of 61

Why

Problems to solve

  1. High cost of infrastructure

11 of 61

Why

12 of 61

Why

Backend team

Frontend team

13 of 61

Why

14 of 61

Why

Problems to solve

  1. High cost of infrastructure
  2. Painful development cycles

15 of 61

The How

16 of 61

How

17 of 61

How

calcOccupancyForecast {}

JS

18 of 61

How

19 of 61

How

Problems to solve

  1. High cost of infrastructure
  2. Painful development cycles

20 of 61

How

Problems to solve

  1. High cost of infrastructure
  2. Painful development cycles

21 of 61

How

Problems to solve

  1. High cost of infrastructure
  2. Painful development cycles

22 of 61

How

Problems to solve

  1. High cost of infrastructure
  2. Painful development cycles

  • Offline / Local First

23 of 61

The What

24 of 61

Event Driven Microservices Architecture

25 of 61

Event Driven Microservices Architecture

26 of 61

Event Driven Microservices Architecture

27 of 61

Event Driven Microservices Architecture�Event Sourcing

28 of 61

Event Driven Microservices Architecture�Event Sourcing

29 of 61

Event Driven Microservices Architecture�Event Sourcing

30 of 61

Event Driven Microservices Architecture�Event Sourcing – Key Benefits

Historic state

Debugging

Memory image

31 of 61

What. Events…

32 of 61

What? Events… in the browser

Write JS to create whatever state you like. Interrogate it to create your models on-the-fly.

33 of 61

What

This is obviously potentially huge!

34 of 61

What�Customer Partitioned Event Sourcing

35 of 61

What�Customer Partitioned Event Sourcing

Reservation events log file for Customer A

36 of 61

What�Snapshotting

Reservations event log for Customer A

Beginning of time

37 of 61

What�Snapshotting

38 of 61

What�Snapshotting

Event-Carried State Transfer

39 of 61

What�Snapshotting

Event-Carried State Transfer

40 of 61

What�Snapshotting

41 of 61

What�Snapshotting

42 of 61

What�Snapshotting

43 of 61

What

44 of 61

What

45 of 61

What

46 of 61

What

Default VFS

SyncAccessHandle Pool

47 of 61

What

Default VFS

SyncAccessHandle Pool

48 of 61

What

Two big advantages to using OPFS

  1. Persistence

49 of 61

What

Two big advantages to using OPFS

  1. Persistence

50 of 61

What

Two big advantages to using OPFS

  1. Persistence

51 of 61

What

Two big advantages to using OPFS

  1. Persistence
  2. Memory

52 of 61

What

Two big advantages to using OPFS

  1. Persistence
  2. Memory

53 of 61

What

Two big advantages to using OPFS

  1. Persistence
  2. Memory

54 of 61

What

Two big advantages to using OPFS

  1. Persistence
  2. Memory

55 of 61

What

Two big advantages to using OPFS

  1. Persistence
  2. Memory

56 of 61

What

Do fetching and processing inside web workers

57 of 61

What

Do fetching and processing inside web workers

58 of 61

What

Do fetching and processing inside web workers

59 of 61

Final thoughts

  • Poor experience for some users
  • Security concerns
  • Mobile networks and devices

60 of 61

Final thoughts

  • Very efficient use of resources
  • Empowers frontend devs to do more
  • Huge benefit to explorative development leading to better products

61 of 61

Event Driven Frontends

WHAT, WHY & HOW

Matthew Cox

Software Engineer with

linkedin.com/in/matthewcoxlondon

@matt-matters.bsky.social