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

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, 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
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
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
 
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
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
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
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
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
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
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
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
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
 
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
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
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
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
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
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
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
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 

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