Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

Rover (not to scale) Interplanetary Computation

Slide 3

Slide 3 text

Satellite Mars Base (not to scale) Rover Interplanetary Computation

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

Flexible Architectures

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

Slower without Re-Architecture

Slide 19

Slide 19 text

Slower without Re-Architecture …based on my experience…

Slide 20

Slide 20 text

Today’s Architectures web-specific

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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?

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

Web Workers ● What’s your use case?

Slide 28

Slide 28 text

New Architectures ● Every few years ● . ● . ● . ● . ● . ● . ● . ● . ● . ● . ● NEW!

Slide 29

Slide 29 text

Borderless Code you don’t care where it runs

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

No Framework Necessary you can do it without a framework

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

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)

Slide 34

Slide 34 text

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