The Almighty JAMstack

A presentation at Middlesbrough Front End in September 2019 in Middlesbrough, UK by Jamie Bradley

Slide 1

Slide 1

THE ALMIGHTY JAMSTACK Jamie Bradley @jamiebradley234 https://jamiebradley.dev https://endeavour.digital

Slide 2

Slide 2

HELLO!

Slide 3

Slide 3

HELLO! UI Engineer

Slide 4

Slide 4

HELLO! UI Engineer Failed Musician

Slide 5

Slide 5

HELLO! UI Engineer Failed Musician Founder of Endeavour Digital

Slide 6

Slide 6

HELLO! UI Engineer Failed Musician Founder of Endeavour Digital Huge fan of JAMstack!

Slide 7

Slide 7

Slide 8

Slide 8

WHAT WE’LL BE COVERING

Slide 9

Slide 9

WHAT WE’LL BE COVERING What is JAMstack?

Slide 10

Slide 10

WHAT WE’LL BE COVERING What is JAMstack? Advantages/Disadvantages

Slide 11

Slide 11

WHAT WE’LL BE COVERING What is JAMstack? Advantages/Disadvantages Examples of JAMstack

Slide 12

Slide 12

WHAT WE’LL BE COVERING What is JAMstack? Advantages/Disadvantages Examples of JAMstack How to Get Started with JAMstack

Slide 13

Slide 13

WHAT IS JAMSTACK?

Slide 14

Slide 14

WHAT IS JAMSTACK ” A modern architecture — Create fast and secure sites and dynamic apps with JavaScript, APIs, and prerendered Markup, served without web servers. ” https://jamstack.org

Slide 15

Slide 15

JAMSTACK JAMSTACK

Slide 16

Slide 16

“…SERVED WITHOUT WEB SERVERS”

Slide 17

Slide 17

Slide 18

Slide 18

SERVED WITHOUT WEBSERVERS

Slide 19

Slide 19

SERVED WITHOUT WEBSERVERS Web Apps/Websites are Hosted on a Global CDN

Slide 20

Slide 20

SERVED WITHOUT WEBSERVERS Web Apps/Websites are Hosted on a Global CDN Not managing a dedicated Web Server(s)

Slide 21

Slide 21

SERVED WITHOUT WEBSERVERS Web Apps/Websites are Hosted on a Global CDN Not managing a dedicated Web Server(s) Content is immediately distributed to the user No server side rendering to generate dynamic content at runtime

Slide 22

Slide 22

SERVED WITHOUT WEBSERVERS Web Apps/Websites are Hosted on a Global CDN Not managing a dedicated Web Server(s) Content is immediately distributed to the user No server side rendering to generate dynamic content at runtime What about server side API requests? Serverless functions (Functions As A Service) So long dedicated API Proxy!

Slide 23

Slide 23

WHAT ISN’T A JAMSTACK WEBSITE

Slide 24

Slide 24

EXAMPLE: TYPICAL CMS DRIVEN WEBSITE

Slide 25

Slide 25

THE GOOD

Slide 26

Slide 26

THE GOOD Content Managed Website

Slide 27

Slide 27

THE GOOD Content Managed Website Instant Feedback

Slide 28

Slide 28

THE GOOD Content Managed Website Instant Feedback Huge array of Plugins

Slide 29

Slide 29

THE NOT SO GOOD

Slide 30

Slide 30

THE NOT SO GOOD Content retrieved at runtime

Slide 31

Slide 31

THE NOT SO GOOD Content retrieved at runtime Bigger surface area of attack

Slide 32

Slide 32

THE NOT SO GOOD Content retrieved at runtime Bigger surface area of attack The more data we have the slower the page load

Slide 33

Slide 33

THE NOT SO GOOD Content retrieved at runtime Bigger surface area of attack The more data we have the slower the page load Those shiny plugins can feck up the site

Slide 34

Slide 34

THE NOT SO GOOD Content retrieved at runtime Bigger surface area of attack The more data we have the slower the page load Those shiny plugins can feck up the site Cost more money to scale

Slide 35

Slide 35

THE NOT SO GOOD Content retrieved at runtime Bigger surface area of attack The more data we have the slower the page load Those shiny plugins can feck up the site Cost more money to scale Provision more servers Introduce load balancers Move assets to a CDN

Slide 36

Slide 36

THE NOT SO GOOD Content retrieved at runtime Bigger surface area of attack The more data we have the slower the page load Those shiny plugins can feck up the site Cost more money to scale Provision more servers Introduce load balancers Move assets to a CDN It could be simpli ed

Slide 37

Slide 37

WHAT’S THE ALTERNATIVE?

Slide 38

Slide 38

WE’RE GONNA TURN TO THE BROWSER AND ABSTRACT THE UI LAYER

Slide 39

Slide 39

NOTHING NEW HERE. THINK OF THE IPHONE Imagine a mobile app where UI is reloaded from a server each time an action was taken Why not treat Web Apps in the same way?

Slide 40

Slide 40

JAMSTACK JAMSTACK

Slide 41

Slide 41

Slide 42

Slide 42

JAVASCRIPT

Slide 43

Slide 43

JAVASCRIPT Dynamic programming during the request/response cycle is handled by JavaScript Frameworks: React, Angular, Vue etc Vanilla JavaScript

Slide 44

Slide 44

JAVASCRIPT Dynamic programming during the request/response cycle is handled by JavaScript Frameworks: React, Angular, Vue etc Vanilla JavaScript Routing UI Logic Dynamic behaviour

Slide 45

Slide 45

API’S

Slide 46

Slide 46

API’S Server-side processes or database actions are abstracted into reusable APIs, accessed over HTTPS with JavaScript.

Slide 47

Slide 47

API’S Server-side processes or database actions are abstracted into reusable APIs, accessed over HTTPS with JavaScript. Leveraging third-party services: Fetching Content (Contentful/Sanity), Handling Payments (Stripe) Custom-build services: User Authentication, Product Inventory

Slide 48

Slide 48

MARKUP

Slide 49

Slide 49

MARKUP Templated markup should be prebuilt at deploy time, usually using a site generator for content sites, or a build tool for web apps.

Slide 50

Slide 50

MARKUP Templated markup should be prebuilt at deploy time, usually using a site generator for content sites, or a build tool for web apps. Headless CMS Sanity Contentful Prismic Forestry Ghost 🎉

Slide 51

Slide 51

ISN’T THIS JUST A STATIC WEBSITE?

Slide 52

Slide 52

ISN’T THIS JUST A STATIC WEBSITE? Well yeah…kinda

Slide 53

Slide 53

ISN’T THIS JUST A STATIC WEBSITE? Well yeah…kinda The only static part is the output of our pre-compiled pages/templates (at build time) that are distributed to the user.

Slide 54

Slide 54

ISN’T THIS JUST A STATIC WEBSITE? Well yeah…kinda The only static part is the output of our pre-compiled pages/templates (at build time) that are distributed to the user. We can still deliver dynamic content.

Slide 55

Slide 55

HOW DO WE DO IT?

Slide 56

Slide 56

Slide 57

Slide 57

Slide 58

Slide 58

Slide 59

Slide 59

Slide 60

Slide 60

Slide 61

Slide 61

ABSTRACTING THE FRONT END LAYER GIVES US SOME ADDED BENEFITS

Slide 62

Slide 62

BETTER PERFORMANCE

Slide 63

Slide 63

MORE SECURE

Slide 64

Slide 64

HOW ARE WE GOING TO HOST IT?

Slide 65

Slide 65

HOW ARE WE GOING TO HOST IT? Content Delivery Network (CDN) - no web servers Manually publish Automatically publish code/content changes Automatic HTTPS upon initial deployment Incorporated within our GIT work ow

Slide 66

Slide 66

IS THERE A SERVICE THAT CAN DO ALL THAT?

Slide 67

Slide 67

😎 ABSO-FECKIN-LUTELY

Slide 68

Slide 68

Slide 69

Slide 69

NETLIFY SIMPLIFIES DEV OPS FOR FOLKS LIKE ME WHO JUST WANT TO FOCUS ON FRONT END CODE.

Slide 70

Slide 70

REAL LIFE EXAMPLES

Slide 71

Slide 71

SMASHING MAGAZINE ” SmashingMagazine.com is now much faster, they went from 800 ms time to rst load to 80 ms. Smashing’s users will have a smoother experience due to the easier integrations, speed, and better performance. ” https://www.netlify.com/blog/2017/03/16/smashing-magazine-just-got-10x-faster/

Slide 72

Slide 72

CORNERSTONE ONDEMAND ” …Cornerstone OnDemand, a talent management company, migrated from an outdated, monolithic CMS architecture to the JAMstack, powered by Netlify, Gatsby, and Sanity.io. As a result, page loads are 25% faster and time to market with new web pages and content has improved 30%. As a bonus, the team has also greatly improved its ability to retain and attract new talent. ” https://www.netlify.com/blog/2019/07/02/cornerstone-ondemand-delivers-web-projects30-faster-with-netlify/

Slide 73

Slide 73

STRIVECTIN - GATSBY & SHOPIFY (PREV. MAGENTO) ” …We have seen an immediate and sustained increase of 20% in organic traf c to the site. ” https://www.gatsbyjs.org/blog/2019-08-14-strivectin-case-study/

Slide 74

Slide 74

GETITNG STARTED WITH JAMSTACK

Slide 75

Slide 75

GETTING STARTED WITH JAMSTACK Use a generator like Stackbit (https://stackbit.com)

Slide 76

Slide 76

GETTING STARTED WITH JAMSTACK Use a generator like Stackbit (https://stackbit.com) Pick a theme

Slide 77

Slide 77

GETTING STARTED WITH JAMSTACK Use a generator like Stackbit (https://stackbit.com) Pick a theme Pick a Static Site Generator

Slide 78

Slide 78

GETTING STARTED WITH JAMSTACK Use a generator like Stackbit (https://stackbit.com) Pick a theme Pick a Static Site Generator Pick a Headless CMS

Slide 79

Slide 79

GETTING STARTED WITH JAMSTACK Use a generator like Stackbit (https://stackbit.com) Pick a theme Pick a Static Site Generator Pick a Headless CMS It deploys the package to Netlify

Slide 80

Slide 80

GETTING STARTED WITH JAMSTACK Use a generator like Stackbit (https://stackbit.com) Pick a theme Pick a Static Site Generator Pick a Headless CMS It deploys the package to Netlify Create your own themes! (Great for Agencies)

Slide 81

Slide 81

GETTING STARTED WITH JAMSTACK Use a generator like Stackbit (https://stackbit.com) Pick a theme Pick a Static Site Generator Pick a Headless CMS It deploys the package to Netlify Create your own themes! (Great for Agencies) Check out Jason Lengstorf’s YouTube Series “Learn with Jason”

Slide 82

Slide 82

GETTING STARTED WITH JAMSTACK Use a generator like Stackbit (https://stackbit.com) Pick a theme Pick a Static Site Generator Pick a Headless CMS It deploys the package to Netlify Create your own themes! (Great for Agencies) Check out Jason Lengstorf’s YouTube Series “Learn with Jason” Visit https://jamstack.org

Slide 83

Slide 83

GETTING STARTED WITH JAMSTACK Use a generator like Stackbit (https://stackbit.com) Pick a theme Pick a Static Site Generator Pick a Headless CMS It deploys the package to Netlify Create your own themes! (Great for Agencies) Check out Jason Lengstorf’s YouTube Series “Learn with Jason” Visit https://jamstack.org Checkout the JAMstack O’reily Book

Slide 84

Slide 84

THANK YOU.