SlideShare una empresa de Scribd logo
1 de 39
Descargar para leer sin conexión
...a lazy developer’s guide
Tim Burt
Presented by
Dorset Digital
Silverstripe in the
Serverless Age
Today's Topics
1.What this isn’t
2. What’s the point then?
3. Right, what’s all this ‘Serverless’ nonsense?
4. ...so how can I use it?
5. Does it work?
6. What next?
7. Questions?
What this isn’t
What this isn’t
•This is not a cure-all solution to your hosting
needs
•This is not an beautifully engineered solution!
•Not a replacement for your existing hosting
systems (yet) – especially on highly dynamic /
interactive sites
•Not a live demo ;-)
What’s the point then?
What’s the point?
•Make a quicker, more resilient and scalable hosting
environment
•Create a Proof of Concept
•Start thinking about site delivery in a different way
•Take advantage of existing technologies
•Do as little work as possible :-)
•Don’t spend a fortune on hosting!
•Make something that can be retro-fitted to an existing
site
Right, what’s all this
‘Serverless’ nonsense?
Familiar models
Simple server model
Add some redundancy
Go big – deploy globally
A note about DNS
•DNS is the key
•More specifically, ‘anycast’ DNS is the key
Enough already!
What’s this got to do with
“Serverless”?
This:
...so how can I use it?
The steps to (almost) Serverless
Step 1: Move your assets
•With Silverstripe CMS 4, assets can be stored in
a remote location
•A single, common store for site content
• https://github.com/silverstripe/silverstripe-s3
Step 2: Improve distribution
•Add a CDN such as Cloudfront, StackPath, etc.
•Reduces latency, improves performance
• https://github.com/DorsetDigital/silverstripe-url-rewriter
Simple middleware to replace S3 URLs with CDN versions, eg:
https://s3.eu-west-2.amazonaws.com/stripecon.dorset-digital.net/public/image.jpg
BECOMES
https://d1bj1kucw3tvqr.cloudfront.net/public/image.jpg
Step 3: Site resources
•Serve site resources (CSS, JS, etc.) from a CDN
such as Cloudfront, StackPath, etc.
•Reduces latency, improves performance
• https://github.com/DorsetDigital/silverstripe-cdnrewrite
Simple middleware to replace site asset URLs with CDN versions, eg:
https://www.example.com/_resources/css/styles.css
BECOMES
https://cdn.example.com/_resources/css/styles.css
Step 4: Static publishing
•Big performance gains
•Fine for non-transactional pages
• https://github.com/silverstripe/silverstripe-staticpublishqueue
Nearly there!
(I promise)
Step 5: Living on the edge
•Deal with web requests at the edge locations
•Most traffic never reaches the origin server
•Fast responses
Step 5: Workers
•Cloudflare Technology for running edge code
•Runs V8 engine
•Use Rust, Typescript
•Can respond to specific URL patterns
•Low cost
•Can contain conditional logic, can modify
requests and responses
Step 5: Workers KV
•Cloudflare Technology for storing data in their
network
•Simple Key→Value storage
•Keys up to 512 Bytes
•Values up to 2MB
•Can be given TTL for automatic expiry
Step 5: Our edge worker
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
});
async function handleRequest(request) {
request = new Request(request);
let requestedURL = new URL(request.url);
let urlPath = trimByChar(requestedURL.pathname, '/');
if (urlPath === '/') {
urlPath = 'index'
}
const kvdata = await kvstore.get(urlPath);
if (kvdata !== null) {
var requestTimestamp = new Date().toUTCString();
var myHeaders = new Headers({
'Content-Type': 'text/html; charset=utf-8',
'vary': 'X-Forwarded-Protocol,Accept-Encoding',
'server': 'Edge Hosting',
'date': requestTimestamp,
'x-worker-debug': 'KV Active'
});
return new Response(kvdata, {headers: myHeaders})
} else {
let originResponse = await fetch(request);
let response = new Response(originResponse.body, originResponse);
response.headers.set('x-worker-debug', 'Origin Active');
response.headers.set('x-path', urlPath);
return response
}
}
function trimByChar(string, character) {
const first = [...string].findIndex(char => char !== character);
const last = [...string].reverse().findIndex(char => char !== character);
return string.substring(first, string.length - last);
}
Step 5: Pushing the data
•We need to push the page data to our KV store
• https://github.com/DorsetDigital/silverstripe-edgepublisher
A publishing backend for the Silverstripe staticpublishqueue module
Utilises the existing processes for the selection, creation and storing of the
statically generated pages.
Can be used to interface with Cloudflare KV or AWS DynamoDB
Deals with the creation of KV namespaces via the Cloudflare API
Sends data directly to the edge data store when pages are published,
deleted, etc.
Does it work?
Yes.. so far!
•This is an alternative approach to distributed
hosting.
•Costs compared to a fully redundant,
geographically distributed hosting system on
Google Compute or AWS are extremely
favourable!
•Massively scalable, highly resilient
•More controllable than relying on HTTP proxies /
caching
In the real world..
(sort of)
https://stripecon.dorset-digital.net
https://stripecon.dorset-digital.net
https://stripecon.dorset-digital.net
Performance tests
• On a domestic broadband connection, response time of the first
request (TTFB) usually between 100-200ms (vs. 1-2 seconds on
the shared host)
• Repeat requests from same node TTFB generally under 50ms !
• Lightweight pages fully load very fast (even with browser caches
disabled)
Performance tests
•Image-heavy pages are almost as fast, once the CDN
(Cloudfront) has the images in it’s edge caches
Performance tests
•PageSpeed (mobile):
Performance tests
•PageSpeed (Desktop):
What next?
References
•Test site: https://stripecon.dorset-digital.net
•V8: https://v8.dev
•Cloudflare Workers:
https://developers.cloudflare.com/workers/
•AWS Lambda Edge:
https://aws.amazon.com/lambda/edge/
Questions?
Thanks for listening!
tim@dorset-digital.net
@DorsetDigital on Slack / Community forum
Contact:

Más contenido relacionado

La actualidad más candente

Kenshoo - Use Hadoop, One Week, No Coding
Kenshoo - Use Hadoop, One Week, No CodingKenshoo - Use Hadoop, One Week, No Coding
Kenshoo - Use Hadoop, One Week, No CodingMapR Technologies
 
AWS Cloud experience concepts tips and tricks
AWS Cloud experience concepts tips and tricksAWS Cloud experience concepts tips and tricks
AWS Cloud experience concepts tips and tricksDirk Harms-Merbitz
 
Cloud Costing Services
Cloud Costing Services Cloud Costing Services
Cloud Costing Services InnoTech
 
When all you have is a nail
When all you have is a nailWhen all you have is a nail
When all you have is a nailAdam Friedman
 
Learn WordPress - Live Session 2 Slides
Learn WordPress - Live Session 2 SlidesLearn WordPress - Live Session 2 Slides
Learn WordPress - Live Session 2 SlidesAhmed Mohammed Nagdy
 
Reducing Database Costs via Shard Consolidation
Reducing Database Costs via Shard ConsolidationReducing Database Costs via Shard Consolidation
Reducing Database Costs via Shard ConsolidationAmazon Web Services
 
The cloud is my laboratory
The cloud is my laboratoryThe cloud is my laboratory
The cloud is my laboratoryAdam Friedman
 
Nosql taxonomy with new nugget
Nosql taxonomy with new nuggetNosql taxonomy with new nugget
Nosql taxonomy with new nuggetMatt Ingenthron
 
Day of Cloud: Amazon EC2
Day of Cloud: Amazon EC2Day of Cloud: Amazon EC2
Day of Cloud: Amazon EC2cmcavoy
 
SnapDish&CloudSearch@aws
SnapDish&CloudSearch@awsSnapDish&CloudSearch@aws
SnapDish&CloudSearch@awsFumikazu Kiyota
 
Cloud Computing: Amazon AWS and EC2
Cloud Computing: Amazon AWS and EC2Cloud Computing: Amazon AWS and EC2
Cloud Computing: Amazon AWS and EC2Teamskunkworks
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Amazon Web Services
 
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...AWS Chicago
 

La actualidad más candente (19)

Kenshoo - Use Hadoop, One Week, No Coding
Kenshoo - Use Hadoop, One Week, No CodingKenshoo - Use Hadoop, One Week, No Coding
Kenshoo - Use Hadoop, One Week, No Coding
 
AWS Cloud experience concepts tips and tricks
AWS Cloud experience concepts tips and tricksAWS Cloud experience concepts tips and tricks
AWS Cloud experience concepts tips and tricks
 
Cloud Costing Services
Cloud Costing Services Cloud Costing Services
Cloud Costing Services
 
When all you have is a nail
When all you have is a nailWhen all you have is a nail
When all you have is a nail
 
Learn WordPress - Live Session 2 Slides
Learn WordPress - Live Session 2 SlidesLearn WordPress - Live Session 2 Slides
Learn WordPress - Live Session 2 Slides
 
Reducing Database Costs via Shard Consolidation
Reducing Database Costs via Shard ConsolidationReducing Database Costs via Shard Consolidation
Reducing Database Costs via Shard Consolidation
 
Lessons Learnt from Guanyu
Lessons Learnt from GuanyuLessons Learnt from Guanyu
Lessons Learnt from Guanyu
 
The cloud is my laboratory
The cloud is my laboratoryThe cloud is my laboratory
The cloud is my laboratory
 
Nosql taxonomy with new nugget
Nosql taxonomy with new nuggetNosql taxonomy with new nugget
Nosql taxonomy with new nugget
 
Deploying On EC2
Deploying On EC2Deploying On EC2
Deploying On EC2
 
Day of Cloud: Amazon EC2
Day of Cloud: Amazon EC2Day of Cloud: Amazon EC2
Day of Cloud: Amazon EC2
 
Chugalug
ChugalugChugalug
Chugalug
 
Ec2onrails
Ec2onrailsEc2onrails
Ec2onrails
 
SnapDish&CloudSearch@aws
SnapDish&CloudSearch@awsSnapDish&CloudSearch@aws
SnapDish&CloudSearch@aws
 
Cloud Computing: Amazon AWS and EC2
Cloud Computing: Amazon AWS and EC2Cloud Computing: Amazon AWS and EC2
Cloud Computing: Amazon AWS and EC2
 
Hadoop in a Windows Shop - CHUG - 20120416
Hadoop in a Windows Shop - CHUG - 20120416Hadoop in a Windows Shop - CHUG - 20120416
Hadoop in a Windows Shop - CHUG - 20120416
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
 
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...
 
ECS위에 Log Server 구축하기
ECS위에 Log Server 구축하기ECS위에 Log Server 구축하기
ECS위에 Log Server 구축하기
 

Similar a StripeCon 2019 talk - Serverless and Silverstripe

Monkeytalk Fall 2012 - Responsive Web Design
Monkeytalk Fall 2012 - Responsive Web DesignMonkeytalk Fall 2012 - Responsive Web Design
Monkeytalk Fall 2012 - Responsive Web DesignSerge Hufkens
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonNeotys
 
Yow Conference Dec 2013 Netflix Workshop Slides with Notes
Yow Conference Dec 2013 Netflix Workshop Slides with NotesYow Conference Dec 2013 Netflix Workshop Slides with Notes
Yow Conference Dec 2013 Netflix Workshop Slides with NotesAdrian Cockcroft
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedDataStax Academy
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
How to Build a Bespoke Page Builder in WordPress
How to Build a Bespoke Page Builder in WordPressHow to Build a Bespoke Page Builder in WordPress
How to Build a Bespoke Page Builder in WordPressGerald Glynn
 
SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Stra...
SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Stra...SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Stra...
SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Stra...Matt Ray
 
Rapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with BootstrapRapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with BootstrapJosh Jeffryes
 
Mapping Life Science Informatics to the Cloud
Mapping Life Science Informatics to the CloudMapping Life Science Informatics to the Cloud
Mapping Life Science Informatics to the CloudChris Dagdigian
 
Beyond Relational
Beyond RelationalBeyond Relational
Beyond RelationalLynn Langit
 
Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...
Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...
Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...Jason Himmelstein
 
First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNA
First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNAFirst Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNA
First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNATomas Cervenka
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on RailsAvi Kedar
 
GDG Ternopil TechTalks Web #1 2015 - Data storages in Microsoft Azure
GDG Ternopil TechTalks Web #1 2015 - Data storages in Microsoft AzureGDG Ternopil TechTalks Web #1 2015 - Data storages in Microsoft Azure
GDG Ternopil TechTalks Web #1 2015 - Data storages in Microsoft AzureAndriy Deren'
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersAmazon Web Services
 
Simpler, faster, cheaper Enterprise Apps using only Spring Boot on GCP
Simpler, faster, cheaper Enterprise Apps using only Spring Boot on GCPSimpler, faster, cheaper Enterprise Apps using only Spring Boot on GCP
Simpler, faster, cheaper Enterprise Apps using only Spring Boot on GCPDaniel Zivkovic
 
Nuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloudNuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloudDavid Veksler
 

Similar a StripeCon 2019 talk - Serverless and Silverstripe (20)

performance.ppt
performance.pptperformance.ppt
performance.ppt
 
Monkeytalk Fall 2012 - Responsive Web Design
Monkeytalk Fall 2012 - Responsive Web DesignMonkeytalk Fall 2012 - Responsive Web Design
Monkeytalk Fall 2012 - Responsive Web Design
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark Tomlinson
 
Yow Conference Dec 2013 Netflix Workshop Slides with Notes
Yow Conference Dec 2013 Netflix Workshop Slides with NotesYow Conference Dec 2013 Netflix Workshop Slides with Notes
Yow Conference Dec 2013 Netflix Workshop Slides with Notes
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Create cloud service on AWS
Create cloud service on AWSCreate cloud service on AWS
Create cloud service on AWS
 
Windows Azure Essentials V3
Windows Azure Essentials V3Windows Azure Essentials V3
Windows Azure Essentials V3
 
How to Build a Bespoke Page Builder in WordPress
How to Build a Bespoke Page Builder in WordPressHow to Build a Bespoke Page Builder in WordPress
How to Build a Bespoke Page Builder in WordPress
 
SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Stra...
SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Stra...SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Stra...
SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Stra...
 
Rapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with BootstrapRapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with Bootstrap
 
Mapping Life Science Informatics to the Cloud
Mapping Life Science Informatics to the CloudMapping Life Science Informatics to the Cloud
Mapping Life Science Informatics to the Cloud
 
Beyond Relational
Beyond RelationalBeyond Relational
Beyond Relational
 
Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...
Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...
Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...
 
First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNA
First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNAFirst Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNA
First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNA
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
GDG Ternopil TechTalks Web #1 2015 - Data storages in Microsoft Azure
GDG Ternopil TechTalks Web #1 2015 - Data storages in Microsoft AzureGDG Ternopil TechTalks Web #1 2015 - Data storages in Microsoft Azure
GDG Ternopil TechTalks Web #1 2015 - Data storages in Microsoft Azure
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
 
Simpler, faster, cheaper Enterprise Apps using only Spring Boot on GCP
Simpler, faster, cheaper Enterprise Apps using only Spring Boot on GCPSimpler, faster, cheaper Enterprise Apps using only Spring Boot on GCP
Simpler, faster, cheaper Enterprise Apps using only Spring Boot on GCP
 
Nuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloudNuts and bolts of running a popular site in the aws cloud
Nuts and bolts of running a popular site in the aws cloud
 

Último

2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...nilamkumrai
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.soniya singh
 
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft DatingDubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Datingkojalkojal131
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...SUHANI PANDEY
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...SUHANI PANDEY
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceEscorts Call Girls
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls DubaiEscorts Call Girls
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...SUHANI PANDEY
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceDelhi Call girls
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...roncy bisnoi
 

Último (20)

valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
 
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft DatingDubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 

StripeCon 2019 talk - Serverless and Silverstripe

  • 1. ...a lazy developer’s guide Tim Burt Presented by Dorset Digital Silverstripe in the Serverless Age
  • 2. Today's Topics 1.What this isn’t 2. What’s the point then? 3. Right, what’s all this ‘Serverless’ nonsense? 4. ...so how can I use it? 5. Does it work? 6. What next? 7. Questions?
  • 4. What this isn’t •This is not a cure-all solution to your hosting needs •This is not an beautifully engineered solution! •Not a replacement for your existing hosting systems (yet) – especially on highly dynamic / interactive sites •Not a live demo ;-)
  • 6. What’s the point? •Make a quicker, more resilient and scalable hosting environment •Create a Proof of Concept •Start thinking about site delivery in a different way •Take advantage of existing technologies •Do as little work as possible :-) •Don’t spend a fortune on hosting! •Make something that can be retro-fitted to an existing site
  • 7. Right, what’s all this ‘Serverless’ nonsense?
  • 11. Go big – deploy globally
  • 12. A note about DNS •DNS is the key •More specifically, ‘anycast’ DNS is the key
  • 13. Enough already! What’s this got to do with “Serverless”?
  • 14. This:
  • 15. ...so how can I use it?
  • 16. The steps to (almost) Serverless
  • 17. Step 1: Move your assets •With Silverstripe CMS 4, assets can be stored in a remote location •A single, common store for site content • https://github.com/silverstripe/silverstripe-s3
  • 18. Step 2: Improve distribution •Add a CDN such as Cloudfront, StackPath, etc. •Reduces latency, improves performance • https://github.com/DorsetDigital/silverstripe-url-rewriter Simple middleware to replace S3 URLs with CDN versions, eg: https://s3.eu-west-2.amazonaws.com/stripecon.dorset-digital.net/public/image.jpg BECOMES https://d1bj1kucw3tvqr.cloudfront.net/public/image.jpg
  • 19. Step 3: Site resources •Serve site resources (CSS, JS, etc.) from a CDN such as Cloudfront, StackPath, etc. •Reduces latency, improves performance • https://github.com/DorsetDigital/silverstripe-cdnrewrite Simple middleware to replace site asset URLs with CDN versions, eg: https://www.example.com/_resources/css/styles.css BECOMES https://cdn.example.com/_resources/css/styles.css
  • 20. Step 4: Static publishing •Big performance gains •Fine for non-transactional pages • https://github.com/silverstripe/silverstripe-staticpublishqueue
  • 22. Step 5: Living on the edge •Deal with web requests at the edge locations •Most traffic never reaches the origin server •Fast responses
  • 23. Step 5: Workers •Cloudflare Technology for running edge code •Runs V8 engine •Use Rust, Typescript •Can respond to specific URL patterns •Low cost •Can contain conditional logic, can modify requests and responses
  • 24. Step 5: Workers KV •Cloudflare Technology for storing data in their network •Simple Key→Value storage •Keys up to 512 Bytes •Values up to 2MB •Can be given TTL for automatic expiry
  • 25. Step 5: Our edge worker addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)) }); async function handleRequest(request) { request = new Request(request); let requestedURL = new URL(request.url); let urlPath = trimByChar(requestedURL.pathname, '/'); if (urlPath === '/') { urlPath = 'index' } const kvdata = await kvstore.get(urlPath); if (kvdata !== null) { var requestTimestamp = new Date().toUTCString(); var myHeaders = new Headers({ 'Content-Type': 'text/html; charset=utf-8', 'vary': 'X-Forwarded-Protocol,Accept-Encoding', 'server': 'Edge Hosting', 'date': requestTimestamp, 'x-worker-debug': 'KV Active' }); return new Response(kvdata, {headers: myHeaders}) } else { let originResponse = await fetch(request); let response = new Response(originResponse.body, originResponse); response.headers.set('x-worker-debug', 'Origin Active'); response.headers.set('x-path', urlPath); return response } } function trimByChar(string, character) { const first = [...string].findIndex(char => char !== character); const last = [...string].reverse().findIndex(char => char !== character); return string.substring(first, string.length - last); }
  • 26. Step 5: Pushing the data •We need to push the page data to our KV store • https://github.com/DorsetDigital/silverstripe-edgepublisher A publishing backend for the Silverstripe staticpublishqueue module Utilises the existing processes for the selection, creation and storing of the statically generated pages. Can be used to interface with Cloudflare KV or AWS DynamoDB Deals with the creation of KV namespaces via the Cloudflare API Sends data directly to the edge data store when pages are published, deleted, etc.
  • 28. Yes.. so far! •This is an alternative approach to distributed hosting. •Costs compared to a fully redundant, geographically distributed hosting system on Google Compute or AWS are extremely favourable! •Massively scalable, highly resilient •More controllable than relying on HTTP proxies / caching
  • 29. In the real world.. (sort of)
  • 33. Performance tests • On a domestic broadband connection, response time of the first request (TTFB) usually between 100-200ms (vs. 1-2 seconds on the shared host) • Repeat requests from same node TTFB generally under 50ms ! • Lightweight pages fully load very fast (even with browser caches disabled)
  • 34. Performance tests •Image-heavy pages are almost as fast, once the CDN (Cloudfront) has the images in it’s edge caches
  • 38. References •Test site: https://stripecon.dorset-digital.net •V8: https://v8.dev •Cloudflare Workers: https://developers.cloudflare.com/workers/ •AWS Lambda Edge: https://aws.amazon.com/lambda/edge/