Flexible Architectures for Web Performance Presentation

SergeyChernyshev 10 views 34 slides May 24, 2024
Slide 1
Slide 1 of 34
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34

About This Presentation

Today in the web performance space we have a lot of technologies that were invented to speed up various parts of the applications. Many of them are successful when they can be just put in place without changing anything in the applications or at least with minimal changes, like network protocols or ...


Slide Content

Flexible
Architectures
Sergey Chernyshev
NY Web Performance Meetup
May 21, 2024

Rover
(not to scale)
Interplanetary Computation

Satellite
Mars Base
(not to scale)
Rover
Interplanetary Computation

Orbit Station
Moon
Base
Satellite
Rover
Mars
Base
“Cloud”
Mission
Control
Center
Satellites
Latency
(not to scale)
Interplanetary Computation

Close to Earth
What plant is it?
Check it!
Scan the plant with
your camera and
click the button to…

Close to Earth
Server
What plant is it?
Check it!
Scan the plant with
your camera and
click the button to…

Close to Earth


Main Thread
Server
Service
Worker
Web
Worker
Rendering
What plant is it?
Check it!
Scan the plant with
your camera and
click the button to…
JS

Main Thread
Close to Earth


Main Thread
Server
Service
Worker
Web
Worker
Rendering
What plant is it?
Check it!
Scan the plant with
your camera and
click the button to…
JS

More Layers: CDN


Main Thread
Server
Service
Worker
Web
Worker
Rendering
What plant is it?
Check it!
Scan the plant with
your camera and
click the button to…
JS

Serverless


Main Thread
Server
Service
Worker
Web
Worker
Rendering
What plant is it?
Check it!
Scan the plant with
your camera and
click the button to…
JS

Services


Main Thread
Server
Service
Worker
Web
Worker
Rendering
What plant is it?
Check it!
Scan the plant with
your camera and
click the button to…
JS

Edge Compute


Main Thread
Server
Service
Worker
Web
Worker
Rendering
What plant is it?
Check it!
Scan the plant with
your camera and
click the button to…
JS

Interconnected


Main Thread
Server
Service
Worker
Web
Worker
Rendering
What plant is it?
Check it!
Scan the plant with
your camera and
click the button to…
JS

Flexible
Architectures

Why do we need it?
today’s architectures are rigid

All or Nothing
●Having many architectures is rarely possible
●Search is usually an exception
●“Everything is dynamic” is a usual excuse

New Technologies are Hard
●Introducing new workflows is hard
●SPAs were a decade in the making
●Static Generators are often perceived
as “Static is NOT Dynamic”
●PWAs, Edge Compute and etc are still
a mystery to most developers

Slower without Re-Architecture

Slower without Re-Architecture
…based on my experience…

Today’s
Architectures
web-specific

●PHP
●Java
●Python
●NodeJS
Web Pages
CC BY atoach
https://www.flickr.com/photos/atoach/25370605889

Single Page Applications (SPA)
●CSR - Browser
●SSR - Server
●Hydration
CC BY Studio Iloinen Liftari
https://commons.wikimedia.org/wiki/File:Flamingo_Spa_%26_Wellness.jpg


Where?

Static Generators
Where? When?
CC BY JonahPtak
https://www.deviantart.com/jonahptak/art/MCU-T
imeline-Thing-v1-1b-2020-05-14-864229532

Cloud Functions & Services
●Amazon Lambda
●Google Cloud Functions
●+ cloud services

Edge Workers & CDNs
●Cloudflare Edge workers
●Fastly Edge Compute
●Amazon Lambda at Edge

Service Workers and PWAs
●Frameworks?
●Who manually
rolled Service
Worker code?
CC BY Diego González-Zúñiga
https://github.com/webmaxru/progressive-web-apps-logo

Web Workers
●What’s your use case?

New Architectures
●Every few years
●.
●.
●.
●.
●.
●.
●.
●.
●.
●.

NEW!

Borderless Code
you don’t care where it runs

DEMO
https://github.com/BorderlessFramework
not much to demo

No Framework
Necessary
you can do it without a framework

What should I do today?
●Use progressive enhancement
●Breakdown apps into parts / layers with different
requirements
●Make architecture choices appropriate to those
requirements
●Don’t make rigid choices that are hard to change
●Use more declarative configurations outside of core logic

Notable Developments
●Universal Javascript (already old)
●Event-driven data (also old)
●WASM execution environments (Fastly)
●Edge services - distributed by default, scalable, etc
●Cross-compatible frameworks like Hono
●Framework-defined Infrastructure (Vercel)
●Edge RPC abstractions (Cloudflare)
●RUM and distributed tracing
●AI (everyone)

Thank You!
Sergey Chernyshev
@[email protected]
https://www.sergeychernyshev.com/
Q&A