Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Serverless: a backend thing that gives superpowers to fronend developers - CSS-Minsk-JS

Serverless: a backend thing that gives superpowers to fronend developers - CSS-Minsk-JS

2663a9ac90cc6ed420e0e1560db57782?s=128

Slobodan Stojanović

September 21, 2019
Tweet

Transcript

  1. None
  2. None
  3. None
  4. None
  5. @slobodan_

  6. @slobodan_

  7. @slobodan_ I am a CSS expert!

  8. @slobodan_ I am a CSS ex pert!

  9. @slobodan_ I am a CSS expe

  10. @slobodan_ I am a CSS expert !important

  11. @slobodan_

  12. @slobodan_

  13. @slobodan_

  14. @slobodan_

  15. @slobodan_

  16. @slobodan_

  17. @slobodan_

  18. @slobodan_

  19. @slobodan_ How simple static website hosting should work?

  20. @slobodan_ You should focus on your app only! And deployment

    should be simple.
  21. @slobodan_ • Fast one command deployment • Cheap • Free

    if (almost) no one is using it • Caching + Auto-scaling
  22. @slobodan_ That feature list sounds familiar!

  23. @slobodan_

  24. @slobodan_ Серверлесс

  25. @slobodan_ Serverless

  26. @slobodan_ Serverless a backend thing that gives superpowers to frontend

    developers
  27. @slobodan_ Before we continue…

  28. Slobodan Stojanović CTO @ Cloud Horizon & CTO @ Vacation

    Tracker co-author of Serverless Applications with Node.js book AWS Serverless Hero @slobodan_
  29. @slobodan_ So, serverless…

  30. @slobodan_ So, serverless… Less servers?

  31. @slobodan_ So, serverless… Less servers? No servers?

  32. @slobodan_ So, serverless… Less servers? No servers? Or even more

    servers?
  33. @slobodan_ So, serverless… No one cares about servers anymore! (except

    providers, hopefully)
  34. @slobodan_ To, understand serverless, let's go a step back… What

    do you need to do to make your app function properly?
  35. @slobodan_ • Buy or rent a server • Install Operating

    System • Setup the server (libs, framework, etc.) • Write your code (business logic, etc.) • Make your app available (deploy it) • Make sure your app works (monitoring) • Manage server and software updates • Manage your app code
  36. @slobodan_ What's important for your business? And people that are

    using your app or website
  37. @slobodan_ • Buy or rent a server • Install Operating

    System • Setup the server (libs, framework, etc.) • Write your code (business logic, etc.) • Deploy your code to the server • Make sure your app works (monitoring) • Manage server and software updates • Manage your app code
  38. @slobodan_ • Buy or rent a server • Install Operating

    System • Setup the server (libs, framework, etc.) • Write your code (business logic, etc.) • Deploy your code to the server • Make sure your app works (monitoring) • Manage server and software updates • Manage your app code Isn't cloud helping?
  39. @slobodan_ • Buy or rent a server • Install Operating

    System • Setup the server (libs, framework, etc.) • Write your code (business logic, etc.) • Deploy your code to the server • Make sure your app works (monitoring) • Manage server and software updates • Manage your app code ✔ ✔ Isn't cloud helping?
  40. @slobodan_ • Buy or rent a server • Install Operating

    System • Setup the server (libs, framework, etc.) • Write your code (business logic, etc.) • Deploy your code to the server • Make sure your app works (monitoring) • Manage server and software updates • Manage your app code
  41. @slobodan_ • Buy or rent a server • Install Operating

    System • Setup the server (libs, framework, etc.) • Write your code (business logic, etc.) • Deploy your code to the server • Make sure your app works (monitoring) • Manage server and software updates • Manage your app code Serverless is a next step!
  42. @slobodan_ • Buy or rent a server • Install Operating

    System • Setup the server (libs, framework, etc.) • Write your code (business logic, etc.) • Deploy your code to the server • Make sure your app works (monitoring) • Manage server and software updates • Manage your app code Serverless is a next step! ✔ ✔
  43. @slobodan_ • Buy or rent a server • Install Operating

    System • Setup the server (libs, framework, etc.) • Write your code (business logic, etc.) • Deploy your code to the server • Make sure your app works (monitoring) • Manage server and software updates • Manage your app code Serverless is a next step! ✔ ✔ ✔ ✔
  44. @slobodan_ Again, what's important for your business?

  45. @slobodan_ • Buy or rent a server • Install Operating

    System • Setup the server (libs, framework, etc.) • Write your code (business logic, etc.) • Deploy your code to the server • Make sure your app works (monitoring) • Manage server and software updates • Manage your app code
  46. @slobodan_ And, what do you need to take care about

    with serverless?
  47. @slobodan_ • Buy or rent a server • Install Operating

    System • Setup the server (libs, framework, etc.) • Write your code (business logic, etc.) • Deploy your code to the server • Make sure your app works (monitoring) • Manage server and software updates • Manage your app code
  48. @slobodan_

  49. @slobodan_ "Serverless is an abstraction level over a company’s IT

    infrastructure, enabling product and engineering to focus significantly more on delivering software business value." Aleksandar Simovic
 AWS Serverless Hero
  50. @slobodan_ But, you need servers to serve the app!

  51. @slobodan_ "It is serverless the same way WIFI is wireless"

    Gojko Adzic
 AWS Serverless Hero
  52. @slobodan_ What are the benefits of serverless?

  53. @slobodan_ • Managed infrastructure, so you can focus on the

    code • Cheap • Auto-scaling and auto-failover • Per function isolation • Easy to start with (beginner friendly)
  54. @slobodan_ But the most important one is…

  55. @slobodan_ Pricing model of serverless

  56. @slobodan_ • You are paying for used, not reserved capacity

    • Pay-per-execution model • If no one is using your app, it costs you $0 + there are generous free tiers
  57. @slobodan_

  58. @slobodan_ But pricing model doesn't give superpowers at least not

    to frontend developers
  59. @slobodan_ But pricing model doesn't give superpowers at least not

    to frontend developers
  60. @slobodan_ What does?

  61. @slobodan_ mythical full stack developer

  62. @slobodan_ But how does serverless help in practice? Is anyone

    using that at all?
  63. @slobodan_ Story time!

  64. @slobodan_ CodePen

  65. @slobodan_

  66. @slobodan_ How many DevOps team members you n!d to be

    able to handle 250 million preprocessor API requests per month? in your team (or to pay directly)
  67. @slobodan_ 0

  68. @slobodan_ • Team of mostly frontend devs + one DevOps

    • Ruby on Rails backend • Many preprocessors that needs full isolation • > 200k requests/hour in peak • Unexpected peaks (you never know when some pen will become popular)
  69. @slobodan_

  70. @slobodan_

  71. @slobodan_

  72. @slobodan_

  73. @slobodan_ • Lack of resources • DevOps engineer recommended serverless

    • Frontend dev wrote a SASS converter • Everything worked, so frontend team migrates other preprocessors
  74. @slobodan_

  75. @slobodan_ Results?

  76. @slobodan_ • Full isolation between services • Auto-scaling (up to

    5000 parallel requests) • Decreased infrastructure cost (250 million requests costs $1180/month) • More DevOps time for RoR part of the app • Frontend developers with superpowers
  77. @slobodan_

  78. @slobodan_ Vacation Tracker

  79. @slobodan_ VacationTracker.io

  80. @slobodan_ • In-company hackathon idea • Small startup with one

    full time developer (+ small help) • One mostly frontend developer • Slack chatbot + API + Angular dashboard
  81. @slobodan_ To minimize initial cost and to speed up development,

    we used serverless from the beginning
  82. @slobodan_ Current state of the system

  83. @slobodan_

  84. @slobodan_ Ok, it's more like this:

  85. @slobodan_

  86. @slobodan_

  87. @slobodan_ Results?

  88. @slobodan_ • More than 250 paying teams using the product

    • More than 6 million Lambda executions per month • Current infrastructure cost is less than $30 per month • Fast development cycles • Easy refactoring, because of microservices • Reusable parts/services for our next products
  89. @slobodan_ Btw, do you know the cost of your bugs?

  90. @slobodan_ We know the exact cost of some of our

    bugs!
  91. @slobodan_ $2.37

  92. @slobodan_ $2.37 Fr! tier got us covered :)

  93. @slobodan_

  94. @slobodan_ Where to start?

  95. @slobodan_

  96. @slobodan_ A Single Page App or a static website

  97. @slobodan_ A Single Page App or a static website

  98. @slobodan_ https://console.aws.amazon.com/amplify

  99. @slobodan_ An Express.js application or API

  100. @slobodan_ An Express.js application or API

  101. @slobodan_ What's the benefit? Beside being easy to deploy it

  102. @slobodan_

  103. @slobodan_ bit.ly/serverless-expressjs

  104. @slobodan_ Not the best solution, because…

  105. @slobodan_ A better API

  106. @slobodan_ A better API

  107. @slobodan_ Claudia.js + Claudia API Builder claudiajs.com

  108. @slobodan_ Looks the same, but it's not!

  109. @slobodan_ Faster means cheaper! You pay per execution time, mi"iseconds

    matter
  110. @slobodan_ APIs are boring, GraphQL FTW!

  111. @slobodan_ AWS AppSync aws.amazon.com/appsync

  112. @slobodan_ • Serverless GraphQL • Preconfigured access to AWS data

    sources
 (DynamoDB, Lambda or Elastic Search) • Real-time data access and updates • Offline data synchronization • Authorizers • Minimize backend development
  113. @slobodan_ "Oh, and I only hire front-end developers at this

    point. I have been the sole DevOps/backend/ middle-tier developer in the last two companies I started, and it’s been fine." Joe Emison @JoeEmison
  114. @slobodan_ "With AppSync I could continue to be the CTO,

    do all the backend and middle-tier code, and support up to probably about a hundred front-end developers before I would need a dedicated backend developer." Joe Emison @JoeEmison
  115. @slobodan_ A file converter

  116. @slobodan_ A file converter

  117. @slobodan_ Claudia.js or AWS Serverless Application Repository serverlessrepo.aws.amazon.com/applications

  118. @slobodan_

  119. @slobodan_ ERR_TOO_MANY_TOOLS

  120. @slobodan_ One tool to rule them all

  121. @slobodan_ AWS Amplify aws-amplify.github.io

  122. @slobodan_ • Deployment (with and without CDN and HTTPS) •

    Auth using Amazon Cognito (+ social signins) • GraphQL backend using AppSync + real-time • Media storage using S3 • Nice client-side libraries for React and others • And much more…
  123. @slobodan_

  124. @slobodan_ Do we have time (and internet) for a short

    live demo?
  125. @slobodan_

  126. @slobodan_ Links to mentioned things

  127. @slobodan_ • Claudia.js - https://claudiajs.com • AWS Amplify - aws-amplify.github.io

    • Vacation Tracker - https://vacationtracker.io
  128. @slobodan_ Quick Summary

  129. @slobodan_ • Serverless is easy to start with (beginner friendly)

    • No server maintenance and other boring things • Pay-per-usage model + it's cheap • You can deploy SPAs, APIs or GraphQL in minutes • It gives you superpowers!
  130. @slobodan_ One more thing!

  131. @slobodan_

  132. @slobodan_ Serverless Applications with Node.js Use claudia40 promo code for

    40% off serverless.pub/book @slobodan_