Slide 1

Slide 1 text

BUILDING SERVERLESS APPLICATIONS IN RUBY WITH AWS LAMBDA

Slide 2

Slide 2 text

WHO AM I? ▸ Currently: Building Serverless Open Source Tooling at AWS ▸ Formerly: AWS SDK for Ruby Team ▸ Author of Ruby runtime for AWS Lambda ▸ Twitter: @alexwwood ▸ Please do tweet your comments and questions about this talk!

Slide 3

Slide 3 text

AGENDA ▸ Overview of AWS Lambda & Ecosystem ▸ Review of Open Source Tools ▸ AWS SAM CLI ▸ AWS SDK for Ruby ▸ aws-record ▸ Demo ▸ Web and Event-Driven Application Hybrid

Slide 4

Slide 4 text

AWS LAMBDA & ECOSYSTEM

Slide 5

Slide 5 text

SERVERLESS IS DEAD. Chris Munns, AWS Principal Developer Advocate CAUSE OF DEATH: EXCESSIVE BUZZWORD USAGE

Slide 6

Slide 6 text

WHAT SERVERLESS MEANS

Slide 7

Slide 7 text

WHAT SERVERLESS MEANS No Servers to Provision or Manage

Slide 8

Slide 8 text

WHAT SERVERLESS MEANS Scales With Usage

Slide 9

Slide 9 text

WHAT SERVERLESS MEANS Pay For Value

Slide 10

Slide 10 text

WHAT SERVERLESS MEANS Availability and Fault Tolerance Built In

Slide 11

Slide 11 text

PRODUCTION APP DEVELOPMENT INVOLVES MANY THINGS ▸ Code & Tests ▸ User Authentication ▸ Monitoring ▸ Load Balancing ▸ Auto Scaling ▸ Handling Server/Container Failures ▸ Security Isolation ▸ Operating System Management

Slide 12

Slide 12 text

PRODUCTION APP DEVELOPMENT INVOLVES MANY THINGS ▸ Code & Tests ▸ User Authentication ▸ Monitoring ▸ Load Balancing ▸ Auto Scaling ▸ Handling Server/Container Failures ▸ Security Isolation ▸ Operating System Management

Slide 13

Slide 13 text

AWS LAMBDA HANDLES MANY THINGS ▸ Code & Tests ▸ User Authentication ▸ Monitoring ▸ Load Balancing ▸ Auto Scaling ▸ Handling Server/Container Failures ▸ Security Isolation ▸ Operating System Management AWS Lambda Handles These AWS Lambda Integrates With Solutions For These

Slide 14

Slide 14 text

AWS LAMBDA WORKS FOR MANY THINGS ▸ Web Applications ▸ Backend Services ▸ Data Processing ▸ Chatbots ▸ Amazon Alexa ▸ IT Automation

Slide 15

Slide 15 text

OPEN SOURCE TOOLS

Slide 16

Slide 16 text

THIS IS ONE OF THE THINGS MY NEW TEAM OWNS AWS SAM CLI ▸ Generate, Build, and Deploy Serverless Applications ▸ Develop and Test AWS Lambda Functions Locally ▸ Local API Gateway w/ Hot Reloading ▸ https://github.com/awslabs/aws-sam-cli

Slide 17

Slide 17 text

NOW IN VERSION 3! AWS SDK FOR RUBY ▸ Supports >= 174 AWS services. ▸ Built-in support for pagination, waiters for state changes. ▸ Helpful abstractions for Amazon S3, Amazon SQS, and more. ▸ Modularized with statically generated code for performance. ▸ Removes 'autoload' for thread safety. ▸ https://github.com/aws/aws-sdk-ruby

Slide 18

Slide 18 text

WATCH THE "DAT401" SESSION FROM AWS RE:INVENT 2018, YOU WON'T REGRET IT AWS-RECORD GEM ▸ Data mapping abstraction library for Amazon DynamoDB. ▸ Similar patterns to ActiveRecord APIs. ▸ Full support for collection types (Lists, Maps, Sets). ▸ Declarative table configuration and migrations. ▸ https://github.com/aws/aws-sdk-ruby-record

Slide 19

Slide 19 text

LIVE DEMO IF YOU JUST CAME FOR THE DOGS, THEN THIS IS WHAT YOU CAME FOR!

Slide 20

Slide 20 text

THE IMPORTANT THING IS THAT IT HAS PUPPIES. EVERYTHING ELSE IS A BONUS! DOG RATING APP DESIGN ObjectCreated API Gateway Sinatra App Is it a dog? Write to Index if Dog DynamoDB Table Upload via Presigned Post ‣ Show Dogs ‣ Upload Dog ‣ Rate Dog

Slide 21

Slide 21 text

THE IMPORTANT THING IS THAT IT HAS PUPPIES. EVERYTHING ELSE IS A BONUS! WEB APPLICATION COMPONENTS API Gateway Sinatra App DynamoDB Table Upload via Presigned Post ‣ Show Dogs ‣ Upload Dog ‣ Rate Dog

Slide 22

Slide 22 text

THE IMPORTANT THING IS THAT IT HAS PUPPIES. EVERYTHING ELSE IS A BONUS! EVENT-DRIVEN COMPONENTS ObjectCreated Is it a dog? Write to Index if Dog DynamoDB Table

Slide 23

Slide 23 text

THE IMPORTANT THING IS THAT IT HAS PUPPIES. EVERYTHING ELSE IS A BONUS! EVENT-DRIVEN COMPONENTS ObjectDeleted DynamoDB Table Delete Item from Table

Slide 24

Slide 24 text

CAN YOU JUST SHOW ME THE DEMO, PLEASE? - Somebody (Probably)

Slide 25

Slide 25 text

CONCLUSION

Slide 26

Slide 26 text

SERVERLESS BENEFITS ▸ AWS Lambda handles many elasticity, scalability, high- availability, security and fault-tolerance problems for you. ▸ Focus more on code, ship faster.

Slide 27

Slide 27 text

4 OUT OF 5 DENTISTS RECOMMEND CHECKING THESE TALKS OUT RELATED TALKS ▸ ATX Serverless Days 2019 - Serverless is Dead ▸ AWS re:Invent 2018 ARC306 - Serverless Architectural Patterns ▸ AWS re:Invent 2018 SRV305 - Inside AWS: Technology Choices for Modern Applications ▸ AWS re:Invent 2018 DAT401 - Advanced Design Patterns for Amazon DynamoDB

Slide 28

Slide 28 text

THANK YOU! ▸ Find our work on GitHub: ▸ https://github.com/aws/aws-sdk-ruby ▸ https://github.com/aws/aws-sdk-ruby-record ▸ https://github.com/awslabs/aws-sam-cli ▸ Find me on the internets: ▸ Twitter: @alexwwood ▸ Web: https://alexwood.codes