Introduction to Jamstack

A presentation at FreeCodeCamp - Jamstack course in March 2020 in by Phil Hawksworth

Slide 1

Slide 1

INTRODUCTION TO JAMSTACK PHIL HAWKSWORTH

Slide 2

Slide 2

y n a m e r a e r the APPROACHES TO DELIVERING WEBSITES

Slide 3

Slide 3

ASK FOR STUFF

Slide 4

Slide 4

ASK FOR STUFF GET STUFF

Slide 5

Slide 5

ASK FOR STUFF DO STUFF GET STUFF

Slide 6

Slide 6

LOAD BALANCER WEB SERVERS DB SERVERS

Slide 7

Slide 7

CDN LOAD BALANCER WEB SERVERS DB SERVERS

Slide 8

Slide 8

IT GOT COMPLICATED

Slide 9

Slide 9

y l i k c u l but WE’VE BEEN LEARNING AND BUILDING NEW TOOLS

Slide 10

Slide 10

BROWSERS GOT MORE CAPABLE PROCESSES MATURED TOOLING IMPROVED

Slide 11

Slide 11

WHAT IS THE JAMSTACK?

Slide 12

Slide 12

s e o d t a h w k c a t s jam s e o d t a h w k c a t s jam STAND FOR? MEAN?

Slide 13

Slide 13

k c a t s m ja JAVASCRIPT / API / MARKUP

Slide 14

Slide 14

k c sta the layers of technology which deliver your web site or application

Slide 15

Slide 15

s e o d t a h w k c a t s jam s e o d t a h w k c a t s jam STAND FOR? MEAN?

Slide 16

Slide 16

k c a t s m a j Fast and secure sites and apps delivered by pre-rendering files and serving them directly from a CDN, removing the requirement to manage or run web servers.

Slide 17

Slide 17

STACKS FOR DAYZ AN / LAMP / MAMP / XAMP / ROR / WISA / MEA WISA / MEAN / LAMP / MAMP / XAMP / ROR /

Slide 18

Slide 18

LAMPSTACK

Slide 19

Slide 19

APACHE PHP HTTP ROUTING AND SERVING PREPROCESSING MYSQL DATA ACCESS LINUX OPERATING SYSTEM WEB SERVER

Slide 20

Slide 20

APACHE PHP HTTP ROUTING AND SERVING PREPROCESSING MYSQL DATA ACCESS LINUX OPERATING SYSTEM WEB SERVER

Slide 21

Slide 21

JAMSTACK

Slide 22

Slide 22

APIs JAVASCRIPT DATA ACCESS RUNTIME MARKUP BROWSER STATIC SERVER / CDN HTTP ROUTING AND SERVING

Slide 23

Slide 23

k c a t s m ja PRE-RENDERED LEVERAGE THE BROWSER WITHOUT A WEBSERVER

Slide 24

Slide 24

APACHE PHP MYSQL LINUX WEB SERVER WITH JAMSTACK THE STACK HAS MOVED UP A LEVEL TO THE BROWSER APIs JAVASCRIPT MARKUP BROWSER

Slide 25

Slide 25

ASK FOR STUFF GET STUFF

Slide 26

Slide 26

BAKE, DON’T FRY – Aaron Swartz http://www.aaronsw.com/weblog/000404

Slide 27

Slide 27

r o f s e v i t o m PRE-RENDERING

Slide 28

Slide 28

DOING THE WORK NOW, SO YOUR SERVERS DON’T HAVE TO LATER

Slide 29

Slide 29

PUT DISTANCE BETWEEN THE COMPLEXITY AND THE USER

Slide 30

Slide 30

n a c s i th SIMPLIFY DEPLOYMENTS

Slide 31

Slide 31

l a n o i it d a r t CDN LOAD BALANCER WEB SERVERS DB SERVERS

Slide 32

Slide 32

l a n o i it d a r t CDN LOAD BALANCER WEB SERVERS DB SERVERS

Slide 33

Slide 33

k c a t s m ja CDN

Slide 34

Slide 34

r o F VERSION CONTROL EVERYTHING

Slide 35

Slide 35

JAMSTACK ADVANTAGES SECURITY PERFORMANCE SCALE

Slide 36

Slide 36

SECURITY

Slide 37

Slide 37

A GREATLY REDUCED SURFACE AREA

Slide 38

Slide 38

l a n o i it d a r t k c a t s m ja CDN LOAD BALANCER WEB SERVERS DB SERVERS

Slide 39

Slide 39

FAR FEWER MOVING PARTS TO ATTACK

Slide 40

Slide 40

PERFORMANCE

Slide 41

Slide 41

TRADITIONAL STACKS ADD STATIC LAYERS IN ORDER TO IMPROVE PERFORMANCE

Slide 42

Slide 42

CACHING

Slide 43

Slide 43

l a n o i it d a r t k c a t s m ja CDN LOAD BALANCER WEB SERVERS DB SERVERS

Slide 44

Slide 44

SCALE

Slide 45

Slide 45

TRADITIONAL STACKS ADD INFRASTRUCTURE IN ORDER TO SCALE

Slide 46

Slide 46

l a n o i it d a r t k c a t s m ja CDN LOAD BALANCER WEB SERVERS DB SERVERS

Slide 47

Slide 47

… t u b , k o

Slide 48

Slide 48

ASK FOR STUFF GET STUFF

Slide 49

Slide 49

y l i k c u l but WE’VE BEEN LEARNING AND BUILDING NEW TOOLS

Slide 50

Slide 50

s r e l b a en STATIC SITE GENERATORS TOOLING AN AUTOMATION BROWSER CAPABILITIES SERVICES AND THE API ECONOMY

Slide 51

Slide 51

wh 1. 2. 3. 4. 5. 6. 7. ? e k a m e w l l i w at SIMPLY A STATIC SITE (32:14) JAVASCRIPT TO RENDER CONTENT (40:40) TEMPLATING AND ABSTRACTION WITH A STATIC SITE GENERATOR (52:21) CONTENT SOURCED FROM AN API AT BUILD TIME (1:24:09) LOCALISED CONTENT RENDERED AT BUILD TIME, ROUTED AT THE CDN (2:02:17 CLIENT-SIDE RENDER OF TARGETED CONTENT WITH BROWSER AND CONTENT APIS (2:28:08) BONUS: HOW TO GRADUALLY INTRODUCE THE JAMSTACK TO YOUR EXISTING INFRA (3:19:50)

Slide 52

Slide 52

EXAMPLE NUMBER 1 - ALL STATIC FINDTHAT.AT / JAMSTACK / EX1

Slide 53

Slide 53

k c a t s m a j Fast and secure sites and apps delivered by pre-rendering files and serving them directly from a CDN, removing the requirement to manage or run web servers.

Slide 54

Slide 54

k c a t s m ja JAVASCRIPT / API / MARKUP

Slide 55

Slide 55

BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD

Slide 56

Slide 56

WAS THAT JAMSTACK? A QUICK SENSE CHECK

Slide 57

Slide 57

k c a t s m ja JAVASCRIPT / API / MARKUP

Slide 58

Slide 58

k c a t s m a j Fast and secure sites and apps delivered by pre-rendering files and serving them directly from a CDN, removing the requirement to manage or run web servers.

Slide 59

Slide 59

WAS THAT JAMSTACK? A QUICK SENSE CHECK ! p ye

Slide 60

Slide 60

EXAMPLE NUMBER 2 - ADDING JAVASCRIPT FINDTHAT.AT / JAMSTACK / EX2

Slide 61

Slide 61

k c a t s m ja JAVASCRIPT / API / MARKUP

Slide 62

Slide 62

RENDERING

Slide 63

Slide 63

CLIENT-SIDE RENDERING SERVER-SIDE RENDERING (REQUEST TIME) SERVER-SIDE RENDERING (BUILD TIME)

Slide 64

Slide 64

CLIENT-SIDE RENDERING JAVASCRIPT IN THE BROWSER MANIPULATES THE DOM SERVER-SIDE RENDERING (REQUEST TIME) SERVER-SIDE RENDERING (BUILD TIME)

Slide 65

Slide 65

CLIENT-SIDE RENDERING JAVASCRIPT IN THE BROWSER MANIPULATES THE DOM SERVER-SIDE RENDERING (REQUEST TIME) GENERATE MARKUP ON REQUEST IN THE SERVER AND TRANSMIT TO THE CLIENT SERVER-SIDE RENDERING (BUILD TIME)

Slide 66

Slide 66

BROWSER WEBSERVER DATABASE MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD / UPDATE

Slide 67

Slide 67

CLIENT-SIDE RENDERING JAVASCRIPT IN THE BROWSER MANIPULATES THE DOM SERVER-SIDE RENDERING (REQUEST TIME) GENERATE MARKUP ON REQUEST IN THE SERVER AND TRANSMIT TO THE CLIENT SERVER-SIDE RENDERING (BUILD TIME)

Slide 68

Slide 68

CLIENT-SIDE RENDERING JAVASCRIPT IN THE BROWSER MANIPULATES THE DOM SERVER-SIDE RENDERING (REQUEST TIME) SERVER-SIDE RENDERING (BUILD TIME) GENERATE MARKUP ON REQUEST IN THE SERVER AND TRANSMIT TO THE CLIENT GENERATE MARKUP AT BUILD TIME SO THAT IT IS READY TO TRANSMIT TO THE CLIENT WHEN NEEDED

Slide 69

Slide 69

BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD

Slide 70

Slide 70

CLIENT-SIDE RENDERING JAVASCRIPT IN THE BROWSER MANIPULATES THE DOM SERVER-SIDE RENDERING (REQUEST TIME) SERVER-SIDE RENDERING (BUILD TIME) GENERATE MARKUP ON REQUEST IN THE SERVER AND TRANSMIT TO THE CLIENT GENERATE MARKUP AT BUILD TIME SO THAT IT IS READY TO TRANSMIT TO THE CLIENT WHEN NEEDED

Slide 71

Slide 71

WAS THAT JAMSTACK? A QUICK SENSE CHECK

Slide 72

Slide 72

k c a t s m ja JAVASCRIPT / API / MARKUP

Slide 73

Slide 73

k c a t s m a j Fast and secure sites and apps delivered by pre-rendering files and serving them directly from a CDN, removing the requirement to manage or run web servers.

Slide 74

Slide 74

WAS THAT JAMSTACK? A QUICK SENSE CHECK ! p ye

Slide 75

Slide 75

EXAMPLE NUMBER 3 - BUILDING WITH AN SSG FINDTHAT.AT / JAMSTACK / EX3

Slide 76

Slide 76

PREREQUISITES GIT INSTALLED (FREE) GITHUB ACCOUNT (FREE) NODEJS INSTALLED (FREE) NETLIFY ACCOUNT (FREE) NODEJS.ORG NETLIFY.COM GIT-SCM.COM GITHUB.COM

Slide 77

Slide 77

BROWSER WEBSERVER DATABASE MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD / UPDATE

Slide 78

Slide 78

BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD

Slide 79

Slide 79

CLIENT-SIDE RENDERING JAVASCRIPT IN THE BROWSER MANIPULATES THE DOM SERVER-SIDE RENDERING (REQUEST TIME) SERVER-SIDE RENDERING (BUILD TIME) GENERATE MARKUP ON REQUEST IN THE SERVER AND TRANSMIT TO THE CLIENT GENERATE MARKUP AT BUILD TIME SO THAT IT IS READY TO TRANSMIT TO THE CLIENT WHEN NEEDED

Slide 80

Slide 80

BUILD AUTOMATION a g n usi STATIC SITE GENERATOR

Slide 81

Slide 81

HOW TO CHOOSE? t h g i r e h t SSG

Slide 82

Slide 82

STATICGEN.COM

Slide 83

Slide 83

LANGUAGE WORKFLOW PERFORMANCE ARCHITECTURE OUTPUT CONTROL ADOPTION

Slide 84

Slide 84

OUR SSG FOR TODAY ELEVENTY 👋

Slide 85

Slide 85

WHY ELEVENTY? LOGICAL ARCHITECTURE FLEXIBLE TEMPLATING NOTHING YOU DON’T ASK FOR JAVASCRIPT ALL THE WAY DOWN

Slide 86

Slide 86

WAS THAT JAMSTACK? A QUICK SENSE CHECK

Slide 87

Slide 87

k c a t s m ja JAVASCRIPT / API / MARKUP

Slide 88

Slide 88

k c a t s m a j Fast and secure sites and apps delivered by pre-rendering files and serving them directly from a CDN, removing the requirement to manage or run web servers.

Slide 89

Slide 89

BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD

Slide 90

Slide 90

WAS THAT JAMSTACK? A QUICK SENSE CHECK ! p ye

Slide 91

Slide 91

EXAMPLE NUMBER 4 - BUILDING WITH DATA FROM AN API FINDTHAT.AT / JAMSTACK / EX4

Slide 92

Slide 92

BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD

Slide 93

Slide 93

BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD

Slide 94

Slide 94

DATA SOURCE BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD

Slide 95

Slide 95

DATA SOURCE BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME API BUILD

Slide 96

Slide 96

  1. USE DATA IN OUR SSG 2. REQUEST DATA FROM AND API 3. GET DATA IN DEV AND IN OUR DEPLOYMENTS

Slide 97

Slide 97

DATA SOURCE BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME API BUILD

Slide 98

Slide 98

k c a t s m ja JAVASCRIPT / API / MARKUP

Slide 99

Slide 99

PERSONALIZATION

Slide 100

Slide 100

BROWSER WEBSERVER DATABASE MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD / UPDATE

Slide 101

Slide 101

s c i t sta s r o t a r e n e g ite APPLY STRUCTURED DATA TO TEMPLATES IN ORDER TO CREATE VIEWS AND ASSETS

Slide 102

Slide 102

BROWSER WEBSERVER DATABASE MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD / UPDATE

Slide 103

Slide 103

DATA SOURCE BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME API BUILD

Slide 104

Slide 104

UNIVERSAL PERSONALIZED

Slide 105

Slide 105

UNIVERSAL LOCALIZED TARGETED PERSONALIZED

Slide 106

Slide 106

s r e l b a n e AUTOMATION TOOLS & SERVICES THE API ECONOMY

Slide 107

Slide 107

DATA SOURCE BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME API BUILD

Slide 108

Slide 108

BROWSER WEBSERVER DATABASE MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD / UPDATE

Slide 109

Slide 109

BROWSER CDN WEBSERVER MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME BUILD / UPDATE DATABASE

Slide 110

Slide 110

DATA SOURCE BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME API BUILD

Slide 111

Slide 111

EXAMPLE NUMBER 5 - GENERATING LOCALIZED CONTENT FINDTHAT.AT / JAMSTACK / EX5

Slide 112

Slide 112

  1. GENERATE VIEWS FOR MANY LOCALES 2. ROUTE TRAFFIC AT THE CDN 3. GENERATE OUR CDN CONFIG

Slide 113

Slide 113

UNIVERSAL LOCALIZED TARGETED PERSONALIZED

Slide 114

Slide 114

WAS THAT JAMSTACK? A QUICK SENSE CHECK

Slide 115

Slide 115

k c a t s m ja JAVASCRIPT / API / MARKUP

Slide 116

Slide 116

k c a t s m a j Fast and secure sites and apps delivered by pre-rendering files and serving them directly from a CDN, removing the requirement to manage or run web servers.

Slide 117

Slide 117

WAS THAT JAMSTACK? A QUICK SENSE CHECK ! p ye

Slide 118

Slide 118

CLIENT-SIDE RENDERING JAVASCRIPT IN THE BROWSER MANIPULATES THE DOM SERVER-SIDE RENDERING (REQUEST TIME) SERVER-SIDE RENDERING (BUILD TIME) GENERATE MARKUP ON REQUEST IN THE SERVER AND TRANSMIT TO THE CLIENT GENERATE MARKUP AT BUILD TIME SO THAT IT IS READY TO TRANSMIT TO THE CLIENT WHEN NEEDED

Slide 119

Slide 119

DATA SOURCE BROWSER CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME API BUILD

Slide 120

Slide 120

DATA SOURCES BROWSER API CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME API BUILD

Slide 121

Slide 121

  1. CLIENT-SIDE RENDERING 2. CLIENT-SIDE API CALLS 3. BROWSER APIS 4. SERVERLESS APIS …USING PROGRESSIVE ENHANCEMENT

Slide 122

Slide 122

PROGRESSIVE ENHANCEMENT 1. DECIDE ON WHAT IS CRITICAL TO THE EXPERIENCE 2. DELIVER AS MUCH AS POSSIBLE USING A LITTLE AS POSSIBLE 3. DETECT SUPPORTED FEATURES AND ENHANCE WHERE POSSIBLE

Slide 123

Slide 123

EXAMPLE NUMBER 6 - CLIENT-SIDE API CALLS FINDTHAT.AT / JAMSTACK / EX6

Slide 124

Slide 124

DATA SOURCES BROWSER API CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME API BUILD

Slide 125

Slide 125

CLIENT-SIDE RENDERING JAVASCRIPT IN THE BROWSER MANIPULATES THE DOM SERVER-SIDE RENDERING (REQUEST TIME) SERVER-SIDE RENDERING (BUILD TIME) GENERATE MARKUP ON REQUEST IN THE SERVER AND TRANSMIT TO THE CLIENT GENERATE MARKUP AT BUILD TIME SO THAT IT IS READY TO TRANSMIT TO THE CLIENT WHEN NEEDED

Slide 126

Slide 126

k c a t s m a j Fast and secure sites and apps delivered by pre-rendering files and serving them directly from a CDN, removing the requirement to manage or run web servers.

Slide 127

Slide 127

WAS THAT JAMSTACK? A QUICK SENSE CHECK ! p ye

Slide 128

Slide 128

TIME a r o f RECAP

Slide 129

Slide 129

? e k a m e w d i d t a wh 1. 2. 3. 4. 5. 6. SIMPLY A STATIC SITE JAVASCRIPT TO RENDER CONTENT TEMPLATING AND ABSTRACTION WITH A STATIC SITE GENERATOR CONTENT SOURCED FROM AN API AT BUILD TIME LOCALISED CONTENT RENDERED AT BUILD TIME, ROUTED AT THE CDN CLIENT-SIDE RENDER OF TARGETED CONTENT WITH BROWSER AND CONTENT APIS

Slide 130

Slide 130

k c a t s m ja JAVASCRIPT / API / MARKUP

Slide 131

Slide 131

k c a t s m a j Fast and secure sites and apps delivered by pre-rendering files and serving them directly from a CDN, removing the requirement to manage or run web servers.

Slide 132

Slide 132

EASIER TO REASON ABOUT

Slide 133

Slide 133

DATA SOURCES BROWSER API CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME API BUILD

Slide 134

Slide 134

s r e l b a n e AUTOMATION TOOLS & SERVICES THE API ECONOMY

Slide 135

Slide 135

THE GROWING ECOSYSTEM OF TOOLS AND SERVICES MOVES US BEYOND STATIC

Slide 136

Slide 136

https://medium.com/memory-leak/the-jamstack-its-pretty-sweet-e0834e4e6bb7

Slide 137

Slide 137

… t bu HOW DO WE GET THERE?

Slide 138

Slide 138

LET’S NOT TRY TO BOIL THE OCEAN https://unsplash.com/photos/0_UvKStn3iQ

Slide 139

Slide 139

THE FIRST STEP NEED NOT BE A GIANT LEAP https://unsplash.com/photos/wKlqqfNTLsI

Slide 140

Slide 140

DATA SOURCES BROWSER API CDN MARKUP JAVASCRIPT APIS REQUEST TIME BUILD TIME API BUILD

Slide 141

Slide 141

RESOURCES FINDTHAT.AT / JAMSTACK / EX1 FINDTHAT.AT / JAMSTACK / EX2 FINDTHAT.AT / JAMSTACK / EX3 FINDTHAT.AT / JAMSTACK / EX4 FINDTHAT.AT / JAMSTACK / EX5 FINDTHAT.AT / JAMSTACK / EX6 FINDTHAT.AT / JAMSTACK / FCC FINDTHAT.AT / JAMSTACK / BOOK FINDTHAT.AT / JAMSTACK / SLACK

Slide 142

Slide 142

FINDTHAT.AT / JAMSTACK / FCC THANKS @PHILHAWKSWORTH