Speech of Ruslan Tolstov, Ruby Developer at MLSDev, at Ruby Meditation 27, Dnipro, 19.05.2019
Slideshare -
Next conference - http://www.rubymeditation.com/
During this talk, we’ll discuss serverless technologies. In particular, we will talk about popular serverless platforms like AWS Lambda, Google CF, and Microsoft AF and also dwell upon serverless frameworks for managing and deploying your functions. As well, we will touch upon the potential use cases of this new approach in your existing projects.
Announcements and conference materials https://www.fb.me/RubyMeditation
News https://twitter.com/RubyMeditation
Photos https://www.instagram.com/RubyMeditation
The stream of Ruby conferences (not just ours) https://t.me/RubyMeditation
4. 5/7/2019 MLSDev
localhost:8000/?print-pdfi#/ 4/80
WHAT IS SERVERLESS?WHAT IS SERVERLESS?
Serverless architecture replaces long-running virtual machines with ephemeral computeServerless architecture replaces long-running virtual machines with ephemeral compute
power that comes into existence on request and disappears immediately after usepower that comes into existence on request and disappears immediately after use
4
38. 5/7/2019 MLSDev
localhost:8000/?print-pdfi#/ 38/80
AMAZON API GATEWAYAMAZON API GATEWAY
Amazon API Gateway is a fully managed service that makes it easy for developers toAmazon API Gateway is a fully managed service that makes it easy for developers to
create, publish, maintain, monitor, and secure APIs at any scale.create, publish, maintain, monitor, and secure APIs at any scale.
16
39. 5/7/2019 MLSDev
localhost:8000/?print-pdfi#/ 39/80
AMAZON API GATEWAYAMAZON API GATEWAY
Easy API Creation and Deployment
Support for HTTP/REST APIs and WebSocket APIs
Resiliency
API Lifecycle Management
Monitoring
Import from swagger/postman
17
41. 5/7/2019 MLSDev
localhost:8000/?print-pdfi#/ 41/80
AWS LAMBDA FUNCTIONAWS LAMBDA FUNCTION
AWS Lambda is a compute service that lets
you run code without procisioning or
managing servers
AWS Lambda executes your code only when
needed and scales automatically, from a few
requests per day to thousands per second
Lambda functions can be used to join
thogether many di erent AWS services
AWS Services can trigger Lambda functions
19
70. 5/7/2019 MLSDev
localhost:8000/?print-pdfi#/ 70/80
OPENFAASOPENFAAS
OpenFaaS® (Functions as a Service) is a framework for building Serverless functions withOpenFaaS® (Functions as a Service) is a framework for building Serverless functions with
Docker and Kubernetes which has rst-class support for metrics. Any process can beDocker and Kubernetes which has rst-class support for metrics. Any process can be
packaged as a function enabling you to consume a range of web events without repetitivepackaged as a function enabling you to consume a range of web events without repetitive
boiler-plate coding.boiler-plate coding.
43
77. 5/7/2019 MLSDev
localhost:8000/?print-pdfi#/ 77/80
USE CASESUSE CASES
Web appliactions
IoT
Media Transformation (audio/video/image)
Multi-Location Media Transformation with Lambda@Edge and CloudFront
Mass Emailing
Real-time Data Transformation
CRON Jobs with CloudWatch
Chatbot
Websockets
50
78. 5/7/2019 MLSDev
localhost:8000/?print-pdfi#/ 78/80
CONCLUSIONSCONCLUSIONS
Keep the Lambda handler lean
Avoid hardcoding, use enviroment variables
One function, One task
Watch the deployment package size, remove unused dependencies
Make use of error handling mechanisme, DLQs
Keep containers warm
Use frameworks
51