the hitchhiker s guide to serverless javascript steve
play

The Hitchhikers Guide to Serverless JavaScript Steve Faulkner - PowerPoint PPT Presentation

The Hitchhikers Guide to Serverless JavaScript Steve Faulkner @southpolesteve Director of Engineering Serverless Serverless there are still servers servers platforms! * as a Service Database-aaS Caching-aaS


  1. The Hitchhiker’s Guide to “Serverless” JavaScript

  2. Steve Faulkner @southpolesteve

  3. Director of Engineering

  4. “Serverless”

  5. “Serverless”

  6. there are still servers…

  7. servers platforms!

  8. * as a Service

  9. Database-aaS Caching-aaS Logging-aaS Metrics-aaS Servers-aaS

  10. business logic?

  11. Functions-aaS

  12. myApp(request) #=> response

  13. Lambda + API Gateway

  14. Functions-aaS + Routing-aaS

  15. $ per request

  16. scales magically *

  17. Lambda

  18. write code zip upload function()

  19. node java python C#

  20. shim + rust/go/haskell

  21. function(event,context,cb){ cb(null, ‘Hello World’) }

  22. versioning aliases RAM + CPU logging non-http events

  23. API Gateway

  24. swagger or click a lot

  25. cache/throttle authorization api keys logging/metrics custom domains ssl

  26. 10-20 million calls per day

  27. < $$$

  28. frontend

  29. html + js API Gateway S3 Lambda(SSR)

  30. Ember

  31. Ember Riot

  32. Ember Riot Preact

  33. why preact?

  34. components simple small

  35. backend

  36. graphiql.bustle.com

  37. JSON API Gateway Lambda redis * dynamoDB

  38. Ruby

  39. Ruby JS (REST)

  40. Ruby JS (REST) Purescript

  41. Ruby JS (REST) Purescript JS (GraphQL)

  42. why graphQL?

  43. graphiQL

  44. types

  45. field resolution

  46. dataloader

  47. why serverless?

  48. ops

  49. #noops

  50. #noops

  51. benchmarks 
 fallbacks load testing monitoring 
 #lessops

  52. 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

  53. 1 -> 1000 rps

  54. 1000 -> 0 rps

  55. iteration

  56. single function deployments

  57. $$$$

  58. events API

  59. ec2 ~$2500/mo

  60. lambda api gateway ~$400/mo

  61. why not?

  62. lock in

  63. 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)

  64. cold functions

  65. const data = loadBigData() // Takes 15s module.exports.handler = function(e,ctx,cb){ processBigData(data, cb) }

  66. long tasks

  67. 5 min max

  68. s3(3GB) Lambda Kinesis Firehose Elasticsearch

  69. testing

  70. test in the cloud?

  71. tools!

  72. serverless framework node-lambda apex claudia.js

  73. npm install -g shep

  74. JavaScript Only no CF 
 swagger 
 webpack 
 environments

  75. shep new my-api shep generate endpoint shep deploy production

  76. questions? Steve Faulkner @southpolesteve

Recommend


More recommend