SlideShare ist ein Scribd-Unternehmen logo
1 von 67
Downloaden Sie, um offline zu lesen
About me
Yoav Abrahami
Head of Wix Code, Wix.com
https://www.linkedin.com/in/yoavabrahami/
https://www.slideshare.net/yoavaa/
@yoavabrahami
What we will be talking about?
● What is Serverless
● What we at Wix learned by building a serverless platform
● The potential
● The Technology Challenges
● Disruption
2013, The Cloud Space
2013, The Cloud Space
We have identified a gap
in the cloud platforms space.
No platform aimed at Web Apps
No platform aimed at Websites
Mobile
2013, The Cloud Space
We set out to build Wix Code
A Serverless Platform for
Web Apps and Websites
Mobile
So...
What is Serverless?
Amazon Lambda
var AWS = require('aws-sdk');
exports.handler = function(event, context) {
handleEvent(event, context);
};
function handleEvent(event, context) {
var cloudSearchDomain = new AWS.CloudSearchDomain({endpoint: config.SearchEndpoint});
var params = {query: event.searchTerm, size: 10, start: 0 };
cloudSearchDomain.search(params, function(err, data) {
if (err) {
context.fail(new Error('Error'));
} else {
context.succeed(processSearchResults(data));
}
});
}
Triggered by:
● S3 upload event
● Kinesis stream
● DynamoDB data change
● API Gateway for Mobile
● API Gateway for Web Apps
Amazon Lambda
var AWS = require('aws-sdk');
exports.handler = function(event, context) {
handleEvent(event, context);
};
function handleEvent(event, context) {
var cloudSearchDomain = new AWS.CloudSearchDomain({endpoint: config.SearchEndpoint});
var params = {query: event.searchTerm, size: 10, start: 0 };
cloudSearchDomain.search(params, function(err, data) {
if (err) {
context.fail(new Error('Error'));
} else {
context.succeed(processSearchResults(data));
}
});
}
Amazon Specific APIs
Triggered by:
● S3 upload event
● Kinesis stream
● DynamoDB data change
● API Gateway for Mobile
● API Gateway for Web Apps
Google Functions
// HTTP functions
exports.helloHttp = function helloHttp (req, res) {
res.send(`Hello ${req.body.name || 'World'}!`);
};
// background functions
exports.helloBackground = function helloBackground (event, callback) {
callback(null, `Hello ${event.data.name || 'World'}!`);
};
Triggered by:
● HTTP triggers
● Cloud Pub/Sub
● Cloud Storage Triggers
Google Functions
// HTTP functions
exports.helloHttp = function helloHttp (req, res) {
res.send(`Hello ${req.body.name || 'World'}!`);
};
// background functions
exports.helloBackground = function helloBackground (event, callback) {
callback(null, `Hello ${event.data.name || 'World'}!`);
};
Google Specific APIs
Triggered by:
● HTTP triggers
● Cloud Pub/Sub
● Cloud Storage Triggers
Microsoft Azure Functions
module.exports.hello = (context, req) => {
const res = {};
if (req.query.name || (req.body && req.body.name)) {
const name = req.query.name || req.body.name;
res.body = `Hello ${name}`;
} else {
res.status = 400;
res.body = 'Please pass a name on the query string or in the request body';
}
context.done(null, res);
};
// another example
module.exports.hello = function(context, item) {
context.log("Received item: ${item}");
context.done();
};
Triggered by:
● Data Processing
● Schedule
● Web Hook
Microsoft Azure Functions
module.exports.hello = (context, req) => {
const res = {};
if (req.query.name || (req.body && req.body.name)) {
const name = req.query.name || req.body.name;
res.body = `Hello ${name}`;
} else {
res.status = 400;
res.body = 'Please pass a name on the query string or in the request body';
}
context.done(null, res);
};
// another example
module.exports.hello = function(context, item) {
context.log("Received item: ${item}");
context.done();
};
Azure Specific APIs
Triggered by:
● Data Processing
● Schedule
● Web Hook
Twilio Functions
exports.handler = function(context, event, callback) {
const response = new Twilio.Response();
response.setBody({
hello: 'world'
});
response.appendHeader('Content-Type', 'application/json');
response.appendHeader('MyHeader', 'MyContent');
callback(null, response);
};
Triggered by:
● Incoming Voice calls
● Incoming Messages
Twilio Functions
exports.handler = function(context, event, callback) {
const response = new Twilio.Response();
response.setBody({
hello: 'world'
});
response.appendHeader('Content-Type', 'application/json');
response.appendHeader('MyHeader', 'MyContent');
callback(null, response);
};
Twilio Specific APIs
Triggered by:
● Incoming Voice calls
● Incoming Messages
Wix Code - Web Modules
// server code - calculator.jsw
export function calculateLoad(latency, concurrency, traffic) {
let opsPerMinite = 60000 / latency;
return {
idle: Math.max((1 - traffic / opsPerMinite), 0),
utilization: traffic / opsPerMinite / concurrency
};
}
// client code
import {calculateLoad} from 'backend/calculator';
function doLoadCalculation() {
calculateLoad($w('#latency').value, $w('#concurrency').value, $w('#traffic').value)
.then(res => {
$w('#utilized').text = `${toPercent(res.utilization)} Utilized`;
$w('#idle').text = `${toPercent(res.idle)} Idle`;
});
}
Wix Code - HTTP Functions
// server code
import {ok} from 'wix-functions';
export function get_calculateLoad(request) {
let latency = request.query.latency;
let concurrency = request.query.concurrency;
let traffic = request.query.traffic;
let opsPerMinite = 60000 / latency;
return ok({
body: {
idle: Math.max((1 - traffic / opsPerMinite), 0),
utilization: traffic / opsPerMinite / concurrency
}
});
}
// a call from a client
curl https://yoav68.wixsite.com/load-calculator/_functions-dev/calculateLoad?latency=10&
concurrency=20&traffic=1000
… Server-Side logic ...
… written by the application developer …
... run in stateless compute containers ...
... event-triggered, ephemeral (...),
and fully managed by a 3rd party
-- Martin Fowler quoting ThoughtWorks
The Magic Pitch
● No Servers to Manage
● Magic Scaling
● Pay only for what you use
● Just throw your code
Almost sounds like:
Serverless is the DevOps holy grail - Just throw your code over the wall...
The Trade
Going Serverless means a trade:
You trade your Freedom for a Managed Service
Sign here
to use my
Serverless
The Trade
You trade your Freedom for a Managed Service
Select web framework
Websockets
HTTP streaming / chunked
TCP / IP / UDP
Select programming
Language
The Future of Serverless
History of Serverless
ManagedSolution
1995 1999 2006 2008 2012 2014 2017
Hosted
PHP
Ease of use
Freedom
History of Serverless
ManagedSolution
1995 1999 2006 2008 2012 2014 2017
Hosted
PHP
J2EE
Ease of use
Freedom
History of Serverless
ManagedSolution
1995 1999 2006 2008 2012 2014 2017
Hosted
PHP
J2EE
EC2
Ease of use
Freedom
History of Serverless
ManagedSolution
1995 1999 2006 2008 2012 2014 2017
Hosted
PHP
J2EE
EC2
AppEngine
Ease of use
Freedom
History of Serverless
ManagedSolution
1995 1999 2006 2008 2012 2014 2017
Hosted
PHP
J2EE
EC2
AppEngine
Parse.com
Ease of use
Freedom
History of Serverless
ManagedSolution
1995 1999 2006 2008 2012 2014 2017
Hosted
PHP
J2EE
EC2
AppEngine
Parse.com
Managed
Containers
Amazon
Lambda
Ease of use
Freedom
History of Serverless
ManagedSolution
1995 1999 2006 2008 2012 2014 2017
Hosted
PHP
J2EE
EC2
AppEngine
Parse.com
Managed
Containers
Amazon
Lambda
Wix Code
Ease of use
Freedom
Predictions
More Serverless Freedom
● Expanding for full support of HTTP, including
● WebSockets
● Streaming / chunked
● Additional protocols - TCP, UDP
● Memoise as a Service - For stateless, side-effect-free functions
● Native serverless options - Go, Rust, C, etc.
Consolidation
● Vendors will start to offer similar offerings
● Cross-vendor libraries to ease vendor lock
Partial adoption, vendor ‘added value’ features.
import futureLibrary from 'FUTURE_LIBRARY';
futureLibrary.initMagic(exports, 'AWS');
futureLibrary.eventFunction = function handleEvent(event) {
event.respond(...);
}
● Standards will arise
All vendors will join, never to fully support.
‘added value’ extras
Containers
Future of Containers
Containers and Kubernetes have a hard choice to make
● Serverless over Kubernetes -
Kubernetes will evolve into runtime for serverless
Move to deploy functions directly, not containers
● Kubernetes and Containers will be abstracted out
Become less and less relevant over time
Containers vs Serverless
● Containers and Kubernetes are a system product built by developers
○ Building Docker images
○ Managing running instances
● Serverless are developer facing products
○ Trivial packaging
○ Instances are no longer a concern
● Serverless is a higher level of abstraction
Serverless Orchestration
● A serverless runtime will emerge for serverless application Orchestration
● Will run on premise or on cloud
● Based on containers or not
Photo: https://www.secsign.com/cloud-vs-premise-file-sharing-business-4-practical-issues-consider/
The Cold Start Problem
What is Cold Start?
Have you ever seen this message?
Solving the Cold Start Problem
New technology will emerge, taking Cold Start time to under 100 mSec
● Start a VM / Container / Unikernels / Sandbox in under 100 mSec.
If your applications starts in 10 mSec
● Do you need an application instance running 24x7?
● Do you need a fallback instance running 24x7?
● Do you need your database running 24x7?
Solving the Cold Start Problem
Solving cold start Changes Cloud Economy
● Imaging a server
0.8% Utilized
84% Idle
Latency: 10 ms / request
Can handle 20 concurrent requests
Traffic: 1000 RPM
Solving the Cold Start Problem
Solving cold start Changes Cloud Economy
● Imaging a server
0.8% Utilized
84% Idle
Latency: 10 ms / request
Can handle 20 concurrent requests
Traffic: 1000 RPM
It takes 150,000 daily users,
10 requests each, to generate
1000 RPM
Solving the Cold Start Problem
Solving cold start Changes Cloud Economy
● Imaging a server
0.8% Utilized
84% Idle
Latency: 10 ms / request
Can handle 20 concurrent requests
Traffic: 1000 RPM
It takes 150,000 daily users,
10 requests each, to generate
1000 RPM
At Wix - with over 100,000,000 users...
of 2,500 running processes
Only 10% are over 1000 RPM
Pay only for what you use
● Functions - You only pay when your function is running
● Interesting fact - the marketing pitch of VMs 10 years ago was
“only pay for what you use”
● Interesting fact - the marketing pitch of App Engine 8 years ago was
“only pay for what you use”
● What went wrong?
Cold Start Latency
Cold Start Latency Explained
The time it takes for a process that is not running to respond to the first user
Functions Cold Start time - about 600ms - 2 seconds
~10 mSec
Request
Handler
~100-1000 mSec
Start
process
First Browser
HTTP request
First
response
Scheduler
Overhead
2-120 Sec
Start
instance
● VMs - about 2 minutes
● Containers - about 2 seconds
Cold Start Latency
What it means?
● Functions are great for offline events
● Functions are ok for web apps APIs / REST / AJAX
● Functions are fine for high traffic websites - HTML
● Functions are not usable for websites - HTML
Website Latency requirement
Functions are not usable for websites - HTML
● Must meet a strict SLA - time to first byte
● Fast websites aim for under 100 mSec (measured on server)
● 200-500 mSec is standard
● Over 2 Sec is considered slow and can harm a website ranking
Cold Start Latency
What it means?
● Functions are great for offline events
● Functions are ok for web apps APIs / REST / AJAX
● Functions are fine for high traffic websites - HTML
● Functions are not usable for websites - HTMLNote:
In terms of latency, VMs and
Containers are just as good
for offline events, web apps and
high traffic websites.
How we Solved Cold Start
<100 mSec Minutes to hours
Cold
start time
Working
process
Start
process
First Browser
HTTP request
stopping
process
Inject & Load
user code
Tailored Serverless
Tailored Serverless
Solves a specific business problem
● Twilio - serverless reaction to phone or SMS events
● CloudFlare - serverless proxy logic
● Wix Code - serverless platform for the frontend
● We will see more examples like
Data Processing, Edge logic or Real-time Video processing
Serverless replacing Configuration
● Fact - the #1 configuration representation is Javascript
● Fact - the #2 configuration representation is JVM Bytecode
export function newEmailHook(email) {
If (email.from ===
'axis-dev@ws.apache.org')
email.labels.push('J2XB');
}
Let’s take Serverless for Frontend
as another example
(Wix Code is such a platform)
Why Serverless for the Frontend?
What it means, Serverless for
Web Apps?
Websites?
What is the difference between
Web Apps and Websites?
SEO
Let’s see this in action
Example
● An image gallery - lightGallery
● How browseo bot sees lightGallery
● How evolvedwebsites bot sees lightGallery
Tools to visualize how a bot sees your site
● Google Search Console
● http://www.browseo.net/
● http://www.evolvedwebsites.com.au/googlebot/view.php
Web Apps ↔ Websites?
Actually, it is Search Engine Compatibility
Website
Search
Engines
Social
Networks
Bots
Server Side
Rendering
Found By
Found By
Indexed by
read by
expects
Web Apps ↔ Websites?
Actually, it is Search Engine Compatibility
Website
Search
Engines
Social
Networks
Bots
Server Side
Rendering
Found By
Found By
Indexed by
read by
expects
Challenging
Traditional model - server side language (Ruby, PHP, Java)
client built with React, Angular, Vue, etc.
● Double development, traditionally done by different people
Emerging model - server and client side using javascript
rendering using React, Angular, Meteor, etc.
● Challenging as server rendering time is easily in the 200-600 mSec for a
simple website
● Challenging to setup and configure
Server Side Rendering - Challenging to Develop
Lets to the trade again
Going Serverless for frontend
You trade your Freedom for a Managed Service
Sign here
to use my
Serverless
Solving Server Side Rendering
Server Side Rendering with time to first byte under 100 mSec
~10 mSec 200-600 mSec
Router
Function
Rendering
Function
100-1000 mSec
Head
received
Browser Loading
Scripts
DOMContentLoaded
Rendering Function
on client
<100 mSec
Cold Start
Time
Browser makes
HTTP request
Rethink the Web Server
● Controller Functions
Server functions, handle HTTP request and render HTML, Json, etc.
● Router Functions
Server function, handles HTTP request and selects a page
● Rendering Functions
Isomorphic function that renders the page HTML / DOM.
Serverless for Frontend
What you gain
● Cold Start Solution
● Server side rendering
● HTTP Streaming
● Router & Rendering functions
● REST / AJAX functions
● CDN, Domain, Assets, etc.
What you lose
● Choice of a frontend framework
● Choice of a server framework
● Choice of FE build process
Minification, Aggregation, ES6
compile, etc.
Takeaway
Serverless
Serverless
Orchestration
Disrupts
Containers
Cold Start
Disrupt
Clouds
Tailored
Serverless
Disrupt
Frontend Dev
Disrupt
Configuration
Stickers

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

AWS re:Invent 2016: NEW LAUNCH! Lambda Everywhere (IOT309)
AWS re:Invent 2016: NEW LAUNCH! Lambda Everywhere (IOT309)AWS re:Invent 2016: NEW LAUNCH! Lambda Everywhere (IOT309)
AWS re:Invent 2016: NEW LAUNCH! Lambda Everywhere (IOT309)
 
AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)
AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)
AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)
 
SRV410 Deep Dive on AWS Batch
SRV410 Deep Dive on AWS BatchSRV410 Deep Dive on AWS Batch
SRV410 Deep Dive on AWS Batch
 
Beyond Relational
Beyond RelationalBeyond Relational
Beyond Relational
 
Batch Processing with Amazon EC2 Container Service
Batch Processing with Amazon EC2 Container ServiceBatch Processing with Amazon EC2 Container Service
Batch Processing with Amazon EC2 Container Service
 
AWS re:Invent 2016: Running Batch Jobs on Amazon ECS (CON310)
AWS re:Invent 2016: Running Batch Jobs on Amazon ECS (CON310)AWS re:Invent 2016: Running Batch Jobs on Amazon ECS (CON310)
AWS re:Invent 2016: Running Batch Jobs on Amazon ECS (CON310)
 
AWS re:Invent 2016: Get Technically Inspired by Container-Powered Migrations ...
AWS re:Invent 2016: Get Technically Inspired by Container-Powered Migrations ...AWS re:Invent 2016: Get Technically Inspired by Container-Powered Migrations ...
AWS re:Invent 2016: Get Technically Inspired by Container-Powered Migrations ...
 
Best Practices with IoT Security - February Online Tech Talks
Best Practices with IoT Security - February Online Tech TalksBest Practices with IoT Security - February Online Tech Talks
Best Practices with IoT Security - February Online Tech Talks
 
What's New with AWS Lambda
What's New with AWS LambdaWhat's New with AWS Lambda
What's New with AWS Lambda
 
Čtvrtkon #64 - AWS Serverless - Michal Haták
Čtvrtkon #64 - AWS Serverless - Michal HatákČtvrtkon #64 - AWS Serverless - Michal Haták
Čtvrtkon #64 - AWS Serverless - Michal Haták
 
Build A Website on AWS for Your First 10 Million Users
Build A Website on AWS for Your First 10 Million UsersBuild A Website on AWS for Your First 10 Million Users
Build A Website on AWS for Your First 10 Million Users
 
Using AWS Batch and AWS Step Functions to Design and Run High-Throughput Work...
Using AWS Batch and AWS Step Functions to Design and Run High-Throughput Work...Using AWS Batch and AWS Step Functions to Design and Run High-Throughput Work...
Using AWS Batch and AWS Step Functions to Design and Run High-Throughput Work...
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
 
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
 
Scaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersScaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million Users
 
AWS re:Invent 2016: Taking DevOps to the AWS Edge (CTD302)
AWS re:Invent 2016: Taking DevOps to the AWS Edge (CTD302)AWS re:Invent 2016: Taking DevOps to the AWS Edge (CTD302)
AWS re:Invent 2016: Taking DevOps to the AWS Edge (CTD302)
 
SMC303 Real-time Data Processing Using AWS Lambda
SMC303 Real-time Data Processing Using AWS LambdaSMC303 Real-time Data Processing Using AWS Lambda
SMC303 Real-time Data Processing Using AWS Lambda
 
Scale, baby, scale!
Scale, baby, scale!Scale, baby, scale!
Scale, baby, scale!
 
Crunch Your Data in the Cloud with Elastic Map Reduce - Amazon EMR Hadoop
Crunch Your Data in the Cloud with Elastic Map Reduce - Amazon EMR HadoopCrunch Your Data in the Cloud with Elastic Map Reduce - Amazon EMR Hadoop
Crunch Your Data in the Cloud with Elastic Map Reduce - Amazon EMR Hadoop
 
SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application Development
 

Andere mochten auch

Andere mochten auch (12)

Real World Serverless
Real World ServerlessReal World Serverless
Real World Serverless
 
Funny stories and anti-patterns from DevOps landscape
Funny stories and anti-patterns from DevOps landscapeFunny stories and anti-patterns from DevOps landscape
Funny stories and anti-patterns from DevOps landscape
 
Ports & Adapters Architecture - XP Days 2017
Ports & Adapters Architecture - XP Days 2017Ports & Adapters Architecture - XP Days 2017
Ports & Adapters Architecture - XP Days 2017
 
XP Days 2017 Tansformation practices
XP Days 2017 Tansformation practicesXP Days 2017 Tansformation practices
XP Days 2017 Tansformation practices
 
Move fast and consumer driven contract test things
Move fast and consumer driven contract test thingsMove fast and consumer driven contract test things
Move fast and consumer driven contract test things
 
Improving Your Organization's Technical Prowess With Legacy Code Retreats
Improving Your Organization's Technical Prowess With Legacy Code RetreatsImproving Your Organization's Technical Prowess With Legacy Code Retreats
Improving Your Organization's Technical Prowess With Legacy Code Retreats
 
DevOps Pragmatic Overview
DevOps Pragmatic OverviewDevOps Pragmatic Overview
DevOps Pragmatic Overview
 
Code Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisCode Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysis
 
Designing REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDesigning REST API automation tests in Kotlin
Designing REST API automation tests in Kotlin
 
Serverless Architectural Patterns and Best Practices
Serverless Architectural Patterns and Best PracticesServerless Architectural Patterns and Best Practices
Serverless Architectural Patterns and Best Practices
 
Rafal Gancarz - Serverless for the Enterprise - Codemotion Milan 2017
Rafal Gancarz - Serverless for the Enterprise - Codemotion Milan 2017Rafal Gancarz - Serverless for the Enterprise - Codemotion Milan 2017
Rafal Gancarz - Serverless for the Enterprise - Codemotion Milan 2017
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
 

Ähnlich wie Future of Serverless

Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy Wordress
George Kanellopoulos
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
Mohammad Qureshi
 
Rapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformRapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 Platform
WSO2
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
維佋 唐
 

Ähnlich wie Future of Serverless (20)

PHP on Windows and on Azure
PHP on Windows and on AzurePHP on Windows and on Azure
PHP on Windows and on Azure
 
Just Another Word Press Weblog But More Cloudy
Just Another Word Press Weblog   But More CloudyJust Another Word Press Weblog   But More Cloudy
Just Another Word Press Weblog But More Cloudy
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy Wordress
 
Deploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsDeploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker Tools
 
ILM - Pipeline in the cloud
ILM - Pipeline in the cloudILM - Pipeline in the cloud
ILM - Pipeline in the cloud
 
AWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp VaultAWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp Vault
 
Just another Wordpress weblog, but more cloudy
Just another Wordpress weblog, but more cloudyJust another Wordpress weblog, but more cloudy
Just another Wordpress weblog, but more cloudy
 
AWS CSA Associate 05-07
AWS CSA Associate 05-07AWS CSA Associate 05-07
AWS CSA Associate 05-07
 
Sprint 17
Sprint 17Sprint 17
Sprint 17
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
 
Node azure
Node azureNode azure
Node azure
 
Serverless in-action
Serverless in-actionServerless in-action
Serverless in-action
 
Azure and Umbraco CMS
Azure and Umbraco CMSAzure and Umbraco CMS
Azure and Umbraco CMS
 
Rapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformRapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 Platform
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
More efficient, usable web
More efficient, usable webMore efficient, usable web
More efficient, usable web
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
Case Study: Using Terraform and Packer to deploy go applications to AWS
Case Study: Using Terraform and Packer to deploy go applications to AWSCase Study: Using Terraform and Packer to deploy go applications to AWS
Case Study: Using Terraform and Packer to deploy go applications to AWS
 

Mehr von Yoav Avrahami

Scaling wix to over 70 m users
Scaling wix to over 70 m usersScaling wix to over 70 m users
Scaling wix to over 70 m users
Yoav Avrahami
 
Wix 10M Users Event - Prospero Media Storage
Wix 10M Users Event - Prospero Media StorageWix 10M Users Event - Prospero Media Storage
Wix 10M Users Event - Prospero Media Storage
Yoav Avrahami
 
DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M users
Yoav Avrahami
 
Playing with Java Classes and Bytecode
Playing with Java Classes and BytecodePlaying with Java Classes and Bytecode
Playing with Java Classes and Bytecode
Yoav Avrahami
 

Mehr von Yoav Avrahami (11)

Wix Code - Todo App - Yale Hachathon
Wix Code - Todo App - Yale HachathonWix Code - Todo App - Yale Hachathon
Wix Code - Todo App - Yale Hachathon
 
Scaling wix to over 70 m users
Scaling wix to over 70 m usersScaling wix to over 70 m users
Scaling wix to over 70 m users
 
DevOps is not a Culture. It is about responsibility
DevOps is not a Culture. It is about responsibilityDevOps is not a Culture. It is about responsibility
DevOps is not a Culture. It is about responsibility
 
Jvm memory model
Jvm memory modelJvm memory model
Jvm memory model
 
Scaling wix to over 50 m users
Scaling wix to over 50 m usersScaling wix to over 50 m users
Scaling wix to over 50 m users
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
Scaling up to 30 m users
Scaling up to 30 m usersScaling up to 30 m users
Scaling up to 30 m users
 
Continuous Delivery at Wix
Continuous Delivery at WixContinuous Delivery at Wix
Continuous Delivery at Wix
 
Wix 10M Users Event - Prospero Media Storage
Wix 10M Users Event - Prospero Media StorageWix 10M Users Event - Prospero Media Storage
Wix 10M Users Event - Prospero Media Storage
 
DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M users
 
Playing with Java Classes and Bytecode
Playing with Java Classes and BytecodePlaying with Java Classes and Bytecode
Playing with Java Classes and Bytecode
 

Kürzlich hochgeladen

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Kürzlich hochgeladen (20)

Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
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
 
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 ...
 
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 🔝✔️✔️
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
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...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
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
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 

Future of Serverless

  • 1.
  • 2.
  • 3. About me Yoav Abrahami Head of Wix Code, Wix.com https://www.linkedin.com/in/yoavabrahami/ https://www.slideshare.net/yoavaa/ @yoavabrahami
  • 4. What we will be talking about? ● What is Serverless ● What we at Wix learned by building a serverless platform ● The potential ● The Technology Challenges ● Disruption
  • 6. 2013, The Cloud Space We have identified a gap in the cloud platforms space. No platform aimed at Web Apps No platform aimed at Websites Mobile
  • 7. 2013, The Cloud Space We set out to build Wix Code A Serverless Platform for Web Apps and Websites Mobile
  • 9. Amazon Lambda var AWS = require('aws-sdk'); exports.handler = function(event, context) { handleEvent(event, context); }; function handleEvent(event, context) { var cloudSearchDomain = new AWS.CloudSearchDomain({endpoint: config.SearchEndpoint}); var params = {query: event.searchTerm, size: 10, start: 0 }; cloudSearchDomain.search(params, function(err, data) { if (err) { context.fail(new Error('Error')); } else { context.succeed(processSearchResults(data)); } }); } Triggered by: ● S3 upload event ● Kinesis stream ● DynamoDB data change ● API Gateway for Mobile ● API Gateway for Web Apps
  • 10. Amazon Lambda var AWS = require('aws-sdk'); exports.handler = function(event, context) { handleEvent(event, context); }; function handleEvent(event, context) { var cloudSearchDomain = new AWS.CloudSearchDomain({endpoint: config.SearchEndpoint}); var params = {query: event.searchTerm, size: 10, start: 0 }; cloudSearchDomain.search(params, function(err, data) { if (err) { context.fail(new Error('Error')); } else { context.succeed(processSearchResults(data)); } }); } Amazon Specific APIs Triggered by: ● S3 upload event ● Kinesis stream ● DynamoDB data change ● API Gateway for Mobile ● API Gateway for Web Apps
  • 11. Google Functions // HTTP functions exports.helloHttp = function helloHttp (req, res) { res.send(`Hello ${req.body.name || 'World'}!`); }; // background functions exports.helloBackground = function helloBackground (event, callback) { callback(null, `Hello ${event.data.name || 'World'}!`); }; Triggered by: ● HTTP triggers ● Cloud Pub/Sub ● Cloud Storage Triggers
  • 12. Google Functions // HTTP functions exports.helloHttp = function helloHttp (req, res) { res.send(`Hello ${req.body.name || 'World'}!`); }; // background functions exports.helloBackground = function helloBackground (event, callback) { callback(null, `Hello ${event.data.name || 'World'}!`); }; Google Specific APIs Triggered by: ● HTTP triggers ● Cloud Pub/Sub ● Cloud Storage Triggers
  • 13. Microsoft Azure Functions module.exports.hello = (context, req) => { const res = {}; if (req.query.name || (req.body && req.body.name)) { const name = req.query.name || req.body.name; res.body = `Hello ${name}`; } else { res.status = 400; res.body = 'Please pass a name on the query string or in the request body'; } context.done(null, res); }; // another example module.exports.hello = function(context, item) { context.log("Received item: ${item}"); context.done(); }; Triggered by: ● Data Processing ● Schedule ● Web Hook
  • 14. Microsoft Azure Functions module.exports.hello = (context, req) => { const res = {}; if (req.query.name || (req.body && req.body.name)) { const name = req.query.name || req.body.name; res.body = `Hello ${name}`; } else { res.status = 400; res.body = 'Please pass a name on the query string or in the request body'; } context.done(null, res); }; // another example module.exports.hello = function(context, item) { context.log("Received item: ${item}"); context.done(); }; Azure Specific APIs Triggered by: ● Data Processing ● Schedule ● Web Hook
  • 15. Twilio Functions exports.handler = function(context, event, callback) { const response = new Twilio.Response(); response.setBody({ hello: 'world' }); response.appendHeader('Content-Type', 'application/json'); response.appendHeader('MyHeader', 'MyContent'); callback(null, response); }; Triggered by: ● Incoming Voice calls ● Incoming Messages
  • 16. Twilio Functions exports.handler = function(context, event, callback) { const response = new Twilio.Response(); response.setBody({ hello: 'world' }); response.appendHeader('Content-Type', 'application/json'); response.appendHeader('MyHeader', 'MyContent'); callback(null, response); }; Twilio Specific APIs Triggered by: ● Incoming Voice calls ● Incoming Messages
  • 17. Wix Code - Web Modules // server code - calculator.jsw export function calculateLoad(latency, concurrency, traffic) { let opsPerMinite = 60000 / latency; return { idle: Math.max((1 - traffic / opsPerMinite), 0), utilization: traffic / opsPerMinite / concurrency }; } // client code import {calculateLoad} from 'backend/calculator'; function doLoadCalculation() { calculateLoad($w('#latency').value, $w('#concurrency').value, $w('#traffic').value) .then(res => { $w('#utilized').text = `${toPercent(res.utilization)} Utilized`; $w('#idle').text = `${toPercent(res.idle)} Idle`; }); }
  • 18. Wix Code - HTTP Functions // server code import {ok} from 'wix-functions'; export function get_calculateLoad(request) { let latency = request.query.latency; let concurrency = request.query.concurrency; let traffic = request.query.traffic; let opsPerMinite = 60000 / latency; return ok({ body: { idle: Math.max((1 - traffic / opsPerMinite), 0), utilization: traffic / opsPerMinite / concurrency } }); } // a call from a client curl https://yoav68.wixsite.com/load-calculator/_functions-dev/calculateLoad?latency=10& concurrency=20&traffic=1000
  • 19. … Server-Side logic ... … written by the application developer … ... run in stateless compute containers ... ... event-triggered, ephemeral (...), and fully managed by a 3rd party -- Martin Fowler quoting ThoughtWorks
  • 20. The Magic Pitch ● No Servers to Manage ● Magic Scaling ● Pay only for what you use ● Just throw your code Almost sounds like: Serverless is the DevOps holy grail - Just throw your code over the wall...
  • 21. The Trade Going Serverless means a trade: You trade your Freedom for a Managed Service Sign here to use my Serverless
  • 22. The Trade You trade your Freedom for a Managed Service Select web framework Websockets HTTP streaming / chunked TCP / IP / UDP Select programming Language
  • 23. The Future of Serverless
  • 24. History of Serverless ManagedSolution 1995 1999 2006 2008 2012 2014 2017 Hosted PHP Ease of use Freedom
  • 25. History of Serverless ManagedSolution 1995 1999 2006 2008 2012 2014 2017 Hosted PHP J2EE Ease of use Freedom
  • 26. History of Serverless ManagedSolution 1995 1999 2006 2008 2012 2014 2017 Hosted PHP J2EE EC2 Ease of use Freedom
  • 27. History of Serverless ManagedSolution 1995 1999 2006 2008 2012 2014 2017 Hosted PHP J2EE EC2 AppEngine Ease of use Freedom
  • 28. History of Serverless ManagedSolution 1995 1999 2006 2008 2012 2014 2017 Hosted PHP J2EE EC2 AppEngine Parse.com Ease of use Freedom
  • 29. History of Serverless ManagedSolution 1995 1999 2006 2008 2012 2014 2017 Hosted PHP J2EE EC2 AppEngine Parse.com Managed Containers Amazon Lambda Ease of use Freedom
  • 30. History of Serverless ManagedSolution 1995 1999 2006 2008 2012 2014 2017 Hosted PHP J2EE EC2 AppEngine Parse.com Managed Containers Amazon Lambda Wix Code Ease of use Freedom
  • 32. More Serverless Freedom ● Expanding for full support of HTTP, including ● WebSockets ● Streaming / chunked ● Additional protocols - TCP, UDP ● Memoise as a Service - For stateless, side-effect-free functions ● Native serverless options - Go, Rust, C, etc.
  • 33. Consolidation ● Vendors will start to offer similar offerings ● Cross-vendor libraries to ease vendor lock Partial adoption, vendor ‘added value’ features. import futureLibrary from 'FUTURE_LIBRARY'; futureLibrary.initMagic(exports, 'AWS'); futureLibrary.eventFunction = function handleEvent(event) { event.respond(...); } ● Standards will arise All vendors will join, never to fully support. ‘added value’ extras
  • 35. Future of Containers Containers and Kubernetes have a hard choice to make ● Serverless over Kubernetes - Kubernetes will evolve into runtime for serverless Move to deploy functions directly, not containers ● Kubernetes and Containers will be abstracted out Become less and less relevant over time
  • 36. Containers vs Serverless ● Containers and Kubernetes are a system product built by developers ○ Building Docker images ○ Managing running instances ● Serverless are developer facing products ○ Trivial packaging ○ Instances are no longer a concern ● Serverless is a higher level of abstraction
  • 37. Serverless Orchestration ● A serverless runtime will emerge for serverless application Orchestration ● Will run on premise or on cloud ● Based on containers or not Photo: https://www.secsign.com/cloud-vs-premise-file-sharing-business-4-practical-issues-consider/
  • 38. The Cold Start Problem
  • 39. What is Cold Start? Have you ever seen this message?
  • 40. Solving the Cold Start Problem New technology will emerge, taking Cold Start time to under 100 mSec ● Start a VM / Container / Unikernels / Sandbox in under 100 mSec. If your applications starts in 10 mSec ● Do you need an application instance running 24x7? ● Do you need a fallback instance running 24x7? ● Do you need your database running 24x7?
  • 41. Solving the Cold Start Problem Solving cold start Changes Cloud Economy ● Imaging a server 0.8% Utilized 84% Idle Latency: 10 ms / request Can handle 20 concurrent requests Traffic: 1000 RPM
  • 42. Solving the Cold Start Problem Solving cold start Changes Cloud Economy ● Imaging a server 0.8% Utilized 84% Idle Latency: 10 ms / request Can handle 20 concurrent requests Traffic: 1000 RPM It takes 150,000 daily users, 10 requests each, to generate 1000 RPM
  • 43. Solving the Cold Start Problem Solving cold start Changes Cloud Economy ● Imaging a server 0.8% Utilized 84% Idle Latency: 10 ms / request Can handle 20 concurrent requests Traffic: 1000 RPM It takes 150,000 daily users, 10 requests each, to generate 1000 RPM At Wix - with over 100,000,000 users... of 2,500 running processes Only 10% are over 1000 RPM
  • 44. Pay only for what you use ● Functions - You only pay when your function is running ● Interesting fact - the marketing pitch of VMs 10 years ago was “only pay for what you use” ● Interesting fact - the marketing pitch of App Engine 8 years ago was “only pay for what you use” ● What went wrong? Cold Start Latency
  • 45. Cold Start Latency Explained The time it takes for a process that is not running to respond to the first user Functions Cold Start time - about 600ms - 2 seconds ~10 mSec Request Handler ~100-1000 mSec Start process First Browser HTTP request First response Scheduler Overhead 2-120 Sec Start instance ● VMs - about 2 minutes ● Containers - about 2 seconds
  • 46. Cold Start Latency What it means? ● Functions are great for offline events ● Functions are ok for web apps APIs / REST / AJAX ● Functions are fine for high traffic websites - HTML ● Functions are not usable for websites - HTML
  • 47. Website Latency requirement Functions are not usable for websites - HTML ● Must meet a strict SLA - time to first byte ● Fast websites aim for under 100 mSec (measured on server) ● 200-500 mSec is standard ● Over 2 Sec is considered slow and can harm a website ranking
  • 48. Cold Start Latency What it means? ● Functions are great for offline events ● Functions are ok for web apps APIs / REST / AJAX ● Functions are fine for high traffic websites - HTML ● Functions are not usable for websites - HTMLNote: In terms of latency, VMs and Containers are just as good for offline events, web apps and high traffic websites.
  • 49. How we Solved Cold Start <100 mSec Minutes to hours Cold start time Working process Start process First Browser HTTP request stopping process Inject & Load user code
  • 51. Tailored Serverless Solves a specific business problem ● Twilio - serverless reaction to phone or SMS events ● CloudFlare - serverless proxy logic ● Wix Code - serverless platform for the frontend ● We will see more examples like Data Processing, Edge logic or Real-time Video processing
  • 52. Serverless replacing Configuration ● Fact - the #1 configuration representation is Javascript ● Fact - the #2 configuration representation is JVM Bytecode export function newEmailHook(email) { If (email.from === 'axis-dev@ws.apache.org') email.labels.push('J2XB'); }
  • 53. Let’s take Serverless for Frontend as another example (Wix Code is such a platform)
  • 54. Why Serverless for the Frontend?
  • 55. What it means, Serverless for Web Apps? Websites?
  • 56. What is the difference between Web Apps and Websites? SEO
  • 57. Let’s see this in action Example ● An image gallery - lightGallery ● How browseo bot sees lightGallery ● How evolvedwebsites bot sees lightGallery Tools to visualize how a bot sees your site ● Google Search Console ● http://www.browseo.net/ ● http://www.evolvedwebsites.com.au/googlebot/view.php
  • 58. Web Apps ↔ Websites? Actually, it is Search Engine Compatibility Website Search Engines Social Networks Bots Server Side Rendering Found By Found By Indexed by read by expects
  • 59. Web Apps ↔ Websites? Actually, it is Search Engine Compatibility Website Search Engines Social Networks Bots Server Side Rendering Found By Found By Indexed by read by expects Challenging
  • 60. Traditional model - server side language (Ruby, PHP, Java) client built with React, Angular, Vue, etc. ● Double development, traditionally done by different people Emerging model - server and client side using javascript rendering using React, Angular, Meteor, etc. ● Challenging as server rendering time is easily in the 200-600 mSec for a simple website ● Challenging to setup and configure Server Side Rendering - Challenging to Develop
  • 61. Lets to the trade again Going Serverless for frontend You trade your Freedom for a Managed Service Sign here to use my Serverless
  • 62. Solving Server Side Rendering Server Side Rendering with time to first byte under 100 mSec ~10 mSec 200-600 mSec Router Function Rendering Function 100-1000 mSec Head received Browser Loading Scripts DOMContentLoaded Rendering Function on client <100 mSec Cold Start Time Browser makes HTTP request
  • 63. Rethink the Web Server ● Controller Functions Server functions, handle HTTP request and render HTML, Json, etc. ● Router Functions Server function, handles HTTP request and selects a page ● Rendering Functions Isomorphic function that renders the page HTML / DOM.
  • 64. Serverless for Frontend What you gain ● Cold Start Solution ● Server side rendering ● HTTP Streaming ● Router & Rendering functions ● REST / AJAX functions ● CDN, Domain, Assets, etc. What you lose ● Choice of a frontend framework ● Choice of a server framework ● Choice of FE build process Minification, Aggregation, ES6 compile, etc.