Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Hitchhiker's Guide to Serverless - Node Interac...
Search
Steve Faulkner
November 29, 2016
Technology
0
77
Hitchhiker's Guide to Serverless - Node Interactive
Steve Faulkner
November 29, 2016
Tweet
Share
More Decks by Steve Faulkner
See All by Steve Faulkner
Shipping TypeScript to npm
southpolesteve
2
350
Going Serverless with GraphQL
southpolesteve
1
75
Hitchhiker's Guide to Serverless @ QCon London
southpolesteve
0
40
Full Stack Serverless @ DevOps Days Boston
southpolesteve
0
39
Full Stack Serverless Applications @ MidwestJS
southpolesteve
0
220
Other Decks in Technology
See All in Technology
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
[FOSS4G 2024 Japan LT] LLMを使ってGISデータ解析を自動化したい!
nssv
1
210
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
520
Lexical Analysis
shigashiyama
1
150
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
220
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
380
Taming you application's environments
salaboy
0
180
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.2k
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Side Projects
sachag
452
42k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Building an army of robots
kneath
302
43k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Building Applications with DynamoDB
mza
90
6.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Faster Mobile Websites
deanohume
305
30k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Transcript
The Hitchhiker’s Guide to “Serverless” Javascript Steve Faulkner, Bustle
Steve Faulkner @southpolesteve
None
None
None
Director of Platform Engineering
hype! serverless 101 why? why not? serverless @ bustle tools
None
The people who are serving websites on Lambda or something
are not only doing it wrong, they are wasting money while locking themselves in to an architecture that doesn't fit their app - @scrollaway on HN
doesn’t scale not production ready too slow too expensive
None
serverless for 99% of user requests
10-20 million calls per day
< 200ms
< $$$
Serverless 101
there are still servers…
…but what if we abstracted them away?
as a Service
Where does the business logic go?
None
None
Functions as a Service
run only when needed
pay only when running
don’t bother me with details
request myApp() response
None
None
None
re:invent happening right now…
app.get(‘/‘, sayHello) function sayHello(req,res){ res.end(‘hello!’) }
app.get(‘/‘, sayHello) function sayHello(req,res){ res.end(‘hello!’) }
app.get(‘/‘, sayHello) function sayHello(req,res){ res.end(‘hello!’) } Functions Routing
Functions-aaS + Routing-aaS
Lambda + API Gateway
Lambda
None
write code zip upload fn()
node java python
node shim + rust/go/haskell
function(event,context,cb){ cb(null, ‘Hello World’) }
versioning aliases RAM + CPU logging non-http events
API Gateway
None
click around a lot
cache/throttle authorization api keys logging/metrics custom domains ssl swagger import/export
why serverless?
None
ops
2011 startup ops: heroku down? get lunch!
2016 startup ops: have a plan
serverless ops: LOL! WAT SERVERS?
serverless ops: LOL! WAT SERVERS?
#noops
“serverless” ops: have a plan
benchmarks fallbacks load testing monitoring #lessops
scale scale scale scale scale scale scale scale scale scale
scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale
1 -> 1000 RPS
1000 -> 0 RPS
iteration
single function deployments
<1s deploys
$$$$
events API
ec2 ~$2500/mo
lambda api gateway ~$400/mo
why not?
lock in
const express = require(‘express’) const fn = require(./lambda-fn/) const app
= express() app.get('/', (req, res) => { fn.handler(null, null, (err, result) => { res.json(result) }) }); app.listen(3000)
cold functions
const data = loadBigData() // Takes 15s module.exports.handler = function(e,ctx,cb){
processBigData(data, cb) }
~3.5 hours - Eric @ iopipe.com
long tasks
5 min max
s3(3GB) Lambda Kinesis Firehose Elasticsearch
testing
test in the cloud?
None
frontend
None
API Gateway S3 Lambda(SSR) html + js
backend
None
API Gateway Lambda JSON dynamodb redis
tools!!!
serverless framework node-lambda apex claudia.js
None
npm install -g shep
JavaScript Only no CF,terraform swagger webpack environments
shep new my-api shep generate endpoint shep deploy production
coming soon… shep server shep docs shep logs —stream
questions? Steve Faulkner @southpolesteve