SlideShare a Scribd company logo
1 of 47
Download to read offline
Making Static Sites More Dynamic
With Serverless
By Rouven Weßling
Rouven Weßling
Web Developer, lover of APIs, cake and whisky
@RouvenWessling
Don’t let a CMS get in the way of
shipping software.
Contentful provides a content infrastructure that enables
teams to power content in any digital product.
What we’ll do today
• A brief history of static website
• Why static sites are awesome
• Why and how to combine static sites and serverless
WebsitesStatic
A brief history
THE FIRST WEBSITE

WAS A STATIC SITE
• Every website was static
• Layout wasn’t a thing -
everything was one
vertical flow.
• Link management was
manual
LET’S DEVELOP
LIKE ITS 1991
DeveloperWorkstationWebserverBrowser
FIRST WEBSEARCH
FIRST WEBCOMIC
Photo by Pamela Saunders on Unsplash
• CGI was introduced in 1994
• Rasmus Lerdorf releases his
“Personal Home Page Tools”
in 1995
• Brendan Eich writes the
prototype for JavaScript in
1995
THINGS

GOT DYNAMIC
DeveloperWorkstationWebserverBrowser
Database
E-COMMERCE IS TAKING OFF
YOUR OWN SPACE
Photo by rawpixel.com on Unsplash
• Microsoft ASP was releases
in 1996, Sun JSP in 1999
• Hosting a dynamic, CMS,
based website became easy
• Microsoft FrontPage and
Marcomedia Dreamweaver
released in 1996 and 1997
IT’S A

BUSINESS NOW
DeveloperLoad balancerBrowser
DatabaseApplication server
Editors
SCM
APPS ON THE WEB
Photo by Brooke Lark on Unsplash
• XMLHttpRequest was part
of IE5 in 1999
• SPA have been discussed
since 2003
• jQuery was published in
2006, AngularJS in 2009
I GOT THE POWER
Modern static site builders
GITHUB
Static Site HostBrowser Build server
Developers
SCM
Editors
Middleman Hexo
IT JUST MAKES YOUR LIFE EASIER
CDNs are trivial to set up. Since every
file gets delivered to every user as-is,
no complex logic is necessary.
Trivial caching
Shuffling bytes from storage to the
network is what servers are great at.
Great performance
Without a server-side application or
database the attack surface is minimal.
No Security issues
No random 500 errors, no dropped
database connections.
Easy maintenance
“This project is too complex.
A static site won’t do.“
Common requirements
01
“Our editors don’t know git,
they need a GUI.”
02
“We have a lot of content,
we need full-text search.”
04
“We’re running an online
shop. You can’t do that with
a static site.”
03
“Our contact forms needs
to send an email.”
Photo by Štefan Štefančík on Unsplash
• AWS got started in 2002,

Lambda added in 2014
• Roy Fielding defines REST
in his 2000 PhD dissertation
• Twilio was founded in 2007;
Stripe in 2011
A CLOUD AND AN

API WALK INTO

A BAR
Photo by Stanford Smith on Unsplash
Serverless Architectures
Source: https://martinfowler.com/bliki/Serverless.html
A NEW BREED OF STATIC SITE GENERATORS
Seamlessly combining static sites and single page applications
Blazing-fast static site
generator for React
Universal Vue.js Applications
How does that solve anything?
With great services
3 WAYS OF ACCESSING A SERVICE
BrowserBuild Function
A content infrastructure service - or a headless CMS - gives editors
the graphical interface they need. You content becomes just an API.
01
“Our editors don’t know git,
they need a GUI.”
BrowserBuild Function
Static Site HostBrowser Build server DevelopersSCM
EditorsContent Infrastructure
Using a Search-as-a-Service provider not only saves you from running your own
search infrastructure but also allows integrating multiple content providers into one
search.
02
“We have a lot of content,
we need full-text search.”
BrowserBuild
Static Site HostBrowser Build server DevelopersSCM
Editors
Cloud email services are a de facto standard in modern architectures but they’re not
accessible from the client. A tiny bit of glue code hosted on a FaaS platform bridges
the gap.
03
“Our contact forms needs
to send an email.”
Browser Function
AWS Lambda
const sendGridConfig = {api_user: 'SENDGRID_USERNAME', api_key: 'SENDGRID_PASSWORD'};
const transporter = nodemailer.createTransport(sgTransport({auth: sendGridConfig}));
const sendMail = pify(transporter.sendMail);
exports.handler = function(event, context) {
const templateDir = path.join(__dirname, 'templates', event.template);
const template = new EmailTemplate(templateDir);
const render = pify(template.render);
template.render(event.context)
.then(result => {
event.text = result.text;
event.html = result.html;
return sendMailAsync(event);
})
.then(() => context.done(null, {message: 'Yaay success'})))
.catch(() => context.done(new Error('Something went wrong!')));
};
HOW TINY?
Static Site HostBrowser Build server
Developers
SCM
Editors
SendgridAWS Lambda
Combing a payment processing service and a shopping cart platform allows you to
run your entire business off a static site.
04
“We’re running an online
shop. You can’t do that with
a static site.”
BrowserBuild Function
Static Site HostBrowser Build server
Developers
SCM
Editors
Snipcart
Bringing it all together
Static Site HostBrowser Build server DevelopersSCM
EditorsContent Infrastructure
Sendgrid
AWS Lambda Snipcart
AND MANY MORE
COMBINING STATIC SITES AND SERVERLESS
Dynamic resources are hidden behind
APIs and well defined routes -
everything else can be cached.
Easy caching
Static things are instant; dynamic
things are fast.
Great performance
Every dynamic function is a limited
service with only the necessary
permissions.
Isolated services improve security
Most services can be handled by 3rd
parties requiring no maintenance.
Easy maintenance
Visit our booth and win
Daily End-of-show
ROUVEN WEßLING
Twitter: @RouvenWessling
Email: rouven@contentful.com
GitHub: @realityking

More Related Content

Recently uploaded

The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Recently uploaded (20)

The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Making Static Websites More Dynamic With Serverless

  • 1. Making Static Sites More Dynamic With Serverless By Rouven Weßling
  • 2. Rouven Weßling Web Developer, lover of APIs, cake and whisky @RouvenWessling
  • 3. Don’t let a CMS get in the way of shipping software. Contentful provides a content infrastructure that enables teams to power content in any digital product.
  • 4. What we’ll do today • A brief history of static website • Why static sites are awesome • Why and how to combine static sites and serverless
  • 6. THE FIRST WEBSITE
 WAS A STATIC SITE
  • 7. • Every website was static • Layout wasn’t a thing - everything was one vertical flow. • Link management was manual LET’S DEVELOP LIKE ITS 1991
  • 11. Photo by Pamela Saunders on Unsplash • CGI was introduced in 1994 • Rasmus Lerdorf releases his “Personal Home Page Tools” in 1995 • Brendan Eich writes the prototype for JavaScript in 1995 THINGS
 GOT DYNAMIC
  • 15. Photo by rawpixel.com on Unsplash • Microsoft ASP was releases in 1996, Sun JSP in 1999 • Hosting a dynamic, CMS, based website became easy • Microsoft FrontPage and Marcomedia Dreamweaver released in 1996 and 1997 IT’S A
 BUSINESS NOW
  • 17. APPS ON THE WEB
  • 18. Photo by Brooke Lark on Unsplash • XMLHttpRequest was part of IE5 in 1999 • SPA have been discussed since 2003 • jQuery was published in 2006, AngularJS in 2009 I GOT THE POWER
  • 19. Modern static site builders
  • 21.
  • 22. Static Site HostBrowser Build server Developers SCM Editors
  • 24. IT JUST MAKES YOUR LIFE EASIER CDNs are trivial to set up. Since every file gets delivered to every user as-is, no complex logic is necessary. Trivial caching Shuffling bytes from storage to the network is what servers are great at. Great performance Without a server-side application or database the attack surface is minimal. No Security issues No random 500 errors, no dropped database connections. Easy maintenance
  • 25. “This project is too complex. A static site won’t do.“
  • 26. Common requirements 01 “Our editors don’t know git, they need a GUI.” 02 “We have a lot of content, we need full-text search.” 04 “We’re running an online shop. You can’t do that with a static site.” 03 “Our contact forms needs to send an email.” Photo by Štefan Štefančík on Unsplash
  • 27. • AWS got started in 2002,
 Lambda added in 2014 • Roy Fielding defines REST in his 2000 PhD dissertation • Twilio was founded in 2007; Stripe in 2011 A CLOUD AND AN
 API WALK INTO
 A BAR Photo by Stanford Smith on Unsplash
  • 30. A NEW BREED OF STATIC SITE GENERATORS Seamlessly combining static sites and single page applications Blazing-fast static site generator for React Universal Vue.js Applications
  • 31. How does that solve anything? With great services
  • 32. 3 WAYS OF ACCESSING A SERVICE BrowserBuild Function
  • 33. A content infrastructure service - or a headless CMS - gives editors the graphical interface they need. You content becomes just an API. 01 “Our editors don’t know git, they need a GUI.” BrowserBuild Function
  • 34. Static Site HostBrowser Build server DevelopersSCM EditorsContent Infrastructure
  • 35. Using a Search-as-a-Service provider not only saves you from running your own search infrastructure but also allows integrating multiple content providers into one search. 02 “We have a lot of content, we need full-text search.” BrowserBuild
  • 36. Static Site HostBrowser Build server DevelopersSCM Editors
  • 37. Cloud email services are a de facto standard in modern architectures but they’re not accessible from the client. A tiny bit of glue code hosted on a FaaS platform bridges the gap. 03 “Our contact forms needs to send an email.” Browser Function AWS Lambda
  • 38. const sendGridConfig = {api_user: 'SENDGRID_USERNAME', api_key: 'SENDGRID_PASSWORD'}; const transporter = nodemailer.createTransport(sgTransport({auth: sendGridConfig})); const sendMail = pify(transporter.sendMail); exports.handler = function(event, context) { const templateDir = path.join(__dirname, 'templates', event.template); const template = new EmailTemplate(templateDir); const render = pify(template.render); template.render(event.context) .then(result => { event.text = result.text; event.html = result.html; return sendMailAsync(event); }) .then(() => context.done(null, {message: 'Yaay success'}))) .catch(() => context.done(new Error('Something went wrong!'))); }; HOW TINY?
  • 39. Static Site HostBrowser Build server Developers SCM Editors SendgridAWS Lambda
  • 40. Combing a payment processing service and a shopping cart platform allows you to run your entire business off a static site. 04 “We’re running an online shop. You can’t do that with a static site.” BrowserBuild Function
  • 41. Static Site HostBrowser Build server Developers SCM Editors Snipcart
  • 42. Bringing it all together
  • 43. Static Site HostBrowser Build server DevelopersSCM EditorsContent Infrastructure Sendgrid AWS Lambda Snipcart
  • 45. COMBINING STATIC SITES AND SERVERLESS Dynamic resources are hidden behind APIs and well defined routes - everything else can be cached. Easy caching Static things are instant; dynamic things are fast. Great performance Every dynamic function is a limited service with only the necessary permissions. Isolated services improve security Most services can be handled by 3rd parties requiring no maintenance. Easy maintenance
  • 46. Visit our booth and win Daily End-of-show
  • 47. ROUVEN WEßLING Twitter: @RouvenWessling Email: rouven@contentful.com GitHub: @realityking