choose your region: earth; cloudflare workers · * an incredibly simplified and not quite, but...

155
choose your region: Earth; Cloudflare Workers QConSF 2019

Upload: others

Post on 20-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

choose your region: Earth; Cloudflare Workers

QConSF 2019

Page 2: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

@ag_dubshi, i’m

Page 3: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 4: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

performance

Page 5: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

accessibility

Page 6: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

infrastructure

Page 7: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

how the internetworks?

Page 8: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

how the internetcould work?

Page 9: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

javascript’sjourney

Page 10: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

1970 1980 1990 2000 2010 2020

JavaScript (1995)

IE (1995)

Browser War I (1995-2001)

Netscape (1994)

HTML (1993)Wasm (2017)

Chrome (2008)Firefox (2002)

Safari (2003)Browser War II (2008-2017)

CSS (1996)

First Website (1991)

Page 11: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

JavaScript (1995)HTML (1993)

Wasm (2017)NodeJS (2009)

V8 (2008)

JQuery (2006)

React (2012)

1970 1980 1990 2000 2010 2020

Angular (2010)

Ember (2011)

Google Maps (2004)

CSS (1996)AJAX (2009)

SPA (2003)

TraceMonkey (2009)

First Website (1991)

Page 12: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

IE (1995)Netscape (1994) Chrome (2008)

Firefox (2002)Safari (2003)

JavaScript (1995)HTML (1993)

CSS (1996)

Wasm (2017)NodeJS (2009)

V8 (2008)

React (2012)

1970 1980 1990 2000 2010 2020

Angular (2010)

Ember (2011)

Google Maps (2004)

Adobe Flash (1996)NaCL (2011)Java Applets (1995)

JQuery (2006)

SPEED OF COMPUTATION IN THE BROWSER

AJAX (2009) TraceMonkey (2009)

SPA (2003)

First Website (1991)

Page 13: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

how much does itcost?

Page 14: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

accessability

Page 15: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

The web is bloated by user “experience”.

Addy Osmani

WE TRIED SO HARD AND GOT SO FAR BUT IN THE END…

Source: https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d4

Page 16: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Source: https://beta.httparchive.org/reports/state-of-javascript#bytesJs

Page 17: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

~9 secsmobile loading time

Source: https://beta.httparchive.org/reports/loading-speed#ttci

Page 18: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

unacceptable

Page 19: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

a big orange cloudi’m a systems engineer for

Page 20: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

infrastructure

Page 21: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 22: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

infrastructure

Page 23: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

hardware

Page 24: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 25: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

180+ datacenters

Page 26: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

theedge

Page 27: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

theedge?

Page 28: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

clientserver

Page 29: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

let’s talkabout PIZZA

Page 30: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

pizzadelivery

Page 31: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

pizzaaccessibility

Page 32: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

pizzaccessibility

Page 33: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

! your javascript program

💥 your javascript program executing

🍕 your javascript program’s generated output

$ your end user

🧺 a POP (point of presence), a cache node

Page 34: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client siderendering

Page 35: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client-side rendering

!

$

Page 36: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client-side rendering!$

Page 37: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client-side rendering!$💥

Page 38: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client-side rendering!$🍕

Page 39: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client-side rendering

!

$

Page 40: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client-side rendering!$

Page 41: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client-side rendering!$💥

Page 42: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client-side rendering!$🍕

Page 43: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client side+ cache

Page 44: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client-side + cache

!

$

🧺

Page 45: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

client-side + cache

!

$

🧺

Page 46: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

!

$

🧺!!!

client-side + cache

Page 47: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

!

$

🧺!!

!

client-side + cache

Page 48: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

!

$

🧺!!

!

client-side + cache💥

Page 49: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

!

$

🧺!!

!🍕

client-side + cache

Page 50: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

!

$

🧺!!

client-side + cache

Page 51: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

!

$

🧺!

!!

client-side + cache

Page 52: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

!

$

🧺!!

!

client-side + cache💥

Page 53: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

!

$

🧺!

!!🍕

client-side + cache

Page 54: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server siderendering

Page 55: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

10 years agoat JSConfEU

Page 56: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Ryan Dahl announces

Node.jsJSConfEU

2009:

Page 57: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

accessibleto JavaScript developers

Node.js made the server

Page 58: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side rendering

!

$

Page 59: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side rendering

!

$

💥

Page 60: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side rendering

!

$

🍕

Page 61: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side rendering

!

$🍕

Page 62: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side rendering

!

$

Page 63: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side rendering

!

$

💥

Page 64: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side rendering

!

$

🍕

Page 65: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side rendering

!

$🍕

Page 66: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side rendering

!

$

Page 67: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server side+ cache

Page 68: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side + cache

!

$

🧺

Page 69: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side + cache

!

$

🧺

💥

Page 70: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side + cache

!

$

🧺

🍕

Page 71: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side + cache

!

$

🧺🍕

Page 72: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side + cache

!

$

🧺🍕🍕🍕🍕

Page 73: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side + cache

!

$

🧺🍕🍕🍕

🍕

Page 74: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side + cache

!

$

🧺🍕🍕

🍕🍕

Page 75: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

server-side + cache

!

$

🧺🍕

🍕🍕🍕

Page 76: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

clientserver

Page 77: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

what is to be done?

Page 78: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

* an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺 🧺🧺

🧺

🧺

Page 79: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

* an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺 🧺🧺

🧺

🧺

what should we do with all these baskets???!!

Page 80: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

* an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺 🧺🧺

🧺

🧺

what should we do with all these baskets???!!

- Cloudflare**

** not really but sort of, yknow??

Page 81: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

clientserver

Page 82: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

clientserver

the edge

Page 83: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

Page 84: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺💥

Page 85: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺🍕

Page 86: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

🍕

Page 87: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

Page 88: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺💥

Page 89: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺🍕

Page 90: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

🍕

Page 91: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

!🧺

!🧺 $

$

!🧺

!🧺

$

$

Page 92: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

!🧺

!🧺 $

$

💥

💥

💥!🧺

!🧺

$

$💥

💥

Page 93: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

!🧺

!🧺 $

$

🍕🍕

🍕

!🧺

!🧺

$

$🍕

🍕

Page 94: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

!🧺

!🧺 $

$

🍕

🍕

🍕 !🧺

!🧺

$

$

🍕

🍕

Page 95: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

!🧺

!🧺 $

$

!🧺

!🧺

$

$

Page 96: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

!🧺

!🧺 $

$

💥

💥

💥!🧺

!🧺

$

$💥

💥

Page 97: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

!🧺

!🧺 $

$

🍕🍕

🍕

!🧺

!🧺

$

$🍕

🍕

Page 98: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

edge-side rendering

!

$

🧺

!🧺

!🧺 $

$

🍕

🍕

🍕 !🧺

!🧺

$

$

🍕

🍕

Page 99: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

how fast?

Page 100: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 101: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

worker: 143.47msgh-pages: 591.07ms

capetown, ZA

Page 102: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

worker: 44.33msgh-pages: 497.93ms

doha, Qatar

Page 103: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

worker: 208.08msgh-pages: 624.87ms

melbourne, AU

Page 104: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

worker: 34.70msgh-pages: 170.20ms

reykjavik, IS

Page 105: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

how does iteven?

Page 106: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

* an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺

🧺 🧺🧺

🧺

🧺

Page 107: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Traffic (requests): easy!

Tenants (apps): Hard

Scalability can mean…

Our network is huge and continues to grow

Every app needs to be in every location. And some places are very small.

Page 108: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

100x efficiency?

Page 109: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Code Footprint

VM: 10GB Container: 100MB Needed: <1MB

Page 110: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Memory Usage

VM: 1GB Container: 100MB Needed: <5MB

Page 111: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

the edge is nota large place

Page 112: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Context Switching

VM: low Container: medium Needed: high

Page 113: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

each server only has to run the requests local to it!

we need to be able to switch back and forth

between apps quickly!

Page 114: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Startup Time

VM: 10s Container: 500ms Needed: <5ms

Page 115: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

we need to be able to kick people out!

we need to be able to start them back up quickly!

Page 116: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Other Use Cases… APIs Run client code directly on the server.

Big Data Processing Run code where data lives.

Web Browsers Run code from visited sites.

Page 117: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

WEB BROWSERS ARE

AWESOME

Page 118: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Server technology is too slow for our use case…

… we have been overlooking the power of client side

tech!

Page 119: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Browsers are optimized for: Small Downloads Fast startup Many tabs and frames Secure Isolation

Page 120: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Web browsers have been the most hostile security environment… for quite some time.

Kenton Varda

PLEASE UPDATE YOUR VERSION OF ADOBE FLASH

Page 121: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

* this talk is not sponsored or affiliated with V8 beverages or the Campbell’s Soup Company

Page 122: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 123: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

class v8::isolate

Page 124: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

Application Application Application

Libraries LibrariesUncommon Libraries

Web Platform APIs

Language Runtime Language Runtime JS Runtime

Operating System Operating System Operating System

Hardware (virtualized) Hardware Hardware

Provided by Host Provided by Guest

VMs Containers Isolates

Page 125: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 126: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

fetch API +ServiceWorker API

Page 127: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 128: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

webassembly!heck yeah

Page 129: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

this is a lot like anoperating system

Page 130: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 131: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

but is this agood idea?

Page 132: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

👻👻👻

Page 133: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 134: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

no (local) timersat all.

Page 135: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

no (local)concurrency

Page 136: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

freedom toreschedule

Page 137: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

how can iuse this?

Page 138: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

accessability

Page 139: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

developerexperience

Page 140: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 141: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

> npm i @cloudflare/wrangler -g

yeeeeeehaww

Page 142: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

> wrangler generate hello > wrangler subdomain world

> cd world > wrangler publish

Successfully published https://hello.world.workers.dev

Page 143: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

demotime

Page 144: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 145: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 146: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 147: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 148: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 149: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 150: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 151: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 152: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

workers.cloudflare.com

go forth and build awesome, accessible things…

for the whole world!

Page 153: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

hold upi’m not done

Page 154: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %
Page 155: choose your region: Earth; Cloudflare Workers · * an incredibly simplified and not quite, but close to, accurate representation of Cloudflare’s 180+ data centers % % % % % % %

thanks!@ag_dubs

workers.cloudflare.com