2019
Jets: The Ruby Serverless
Framework
By Tung Nguyen
Tung Nguyen
tung@boltops.com
linkedin.com/in/tongueroo
youtube.com/tongueroo
@tongueroo
sonic
swiss-army knife
jack
elastic beanstalk
ufo
ecs deployment
lono
cloudformation
framework
jets
ruby serverless
framework
Background
@tongueroo
@tongueroo
AWS Compute Offerings
EC2 ECS Lambda
@tongueroo
“Serverless”
What is AWS Lambda?
@tongueroo
Run code without managing servers
What is AWS Lambda?
@tongueroo
Functions as a Service
What is AWS Lambda?
@tongueroo
AWS Lambda Benefits
Continuously
Scales
Pay per
Request
@tongueroo
Serverless Hype
@tongueroo
AWS Lambda Considerations: RAM
RAM: 128 to 3008 MB
@tongueroo
AWS Lambda Considerations: CPU
CPU proportional to RAM Allocation
@tongueroo
AWS Lambda Considerations: Network Speed
AWS Blazing Pipe
@tongueroo
AWS Lambda Considerations: Max Timeout
Currently 15 Minutes
@tongueroo
AWS Lambda Considerations: Code Size Limit
250 MB Unzipped
@tongueroo
AWS Lambda Considerations: Cold Starts
@tongueroo
AWS Lambda Considerations: Cold Starts
@tongueroo
AWS Lambda: Prewarming
@tongueroo
More to Serverless than Lambda
API Gateway
@tongueroo
API Gateway: Front Door
@tongueroo
API Gateway: Rest API
@tongueroo
There’s Even More to Serverless...
CloudWatch
@tongueroo
CloudWatch: Scheduled Events
@tongueroo
Serverless Components
Lambda API Gateway CloudWatch
@tongueroo
Web API Architecture
@tongueroo
Let’s See Typical Serverless Code
@tongueroo
AWS Lambda: Create Function
@tongueroo
AWS Lambda: Create Function
@tongueroo
AWS Lambda: Handler
@tongueroo
AWS Lambda: Test Function
@tongueroo
AWS Lambda: Function Output
@tongueroo
API Gateway: Create API
@tongueroo
API Gateway: Create Method
@tongueroo
API Gateway: Create Method
@tongueroo
CloudWatch: Create Schedule Rule
@tongueroo
CloudWatch: Create Schedule Rule
@tongueroo
CloudWatch: Create Schedule Rule
@tongueroo
Congrats! Crash Course Completed!
Lambda API Gateway CloudWatch
@tongueroo
AWS Lambda Function as YAML
@tongueroo
YAML is Configuration not Code
@tongueroo
Ok! Let’s See Jets Code
@tongueroo
Jets Simple Function
@tongueroo
Jets Controllers
@tongueroo
Jets Controllers
@tongueroo
Jets Routes
@tongueroo
Jets Routes
@tongueroo
Jets Routes Resources
@tongueroo
Jets Routes Resources
@tongueroo
Jets Jobs
@tongueroo
Jets Jobs
@tongueroo
Jets Components Review
Ruby Methods: Lambda Functions
Routes: API Gateway
Jobs: CloudWatch Scheduled Rules
@tongueroo
Jets New Modes
1. jets new demo --mode html # default
2. jets new api --mode api
3. jets new cron --mode job
Notable: jets new api --mode api --no-database
@tongueroo
Jets Project Structure: HTML Mode
jets new demo
@tongueroo
Jets Project Structure: API Mode
jets new api --mode api
@tongueroo
Jets Project Structure: Job Mode
jets new cron --mode job
@tongueroo
Demo Time
@tongueroo
Web API Architecture Review
@tongueroo
Jets Components Review
Ruby Methods: Lambda Functions
Routes: API Gateway
Jobs: CloudWatch Scheduled Rules
@tongueroo
Why Jets Again?
VS
YAML Code
@tongueroo
More to Serverless
But Wait There’s More...
>
@tongueroo
AWS Lambda is Glue
@tongueroo
Jets: Glue Serverless Framework
Kinesis
DynamoDB IoT CloudWatch
Event Rule
CloudWatch
Scheduled Event
S3SQS SNS
3rd Party
@tongueroo
S3 Event: Image Processing
@tongueroo
S3 Event: Code
@tongueroo
S3 Event: YAML
@tongueroo
Jets Core Resource Model
=
@tongueroo
Jets Features
Prewarming
@tongueroo
Jets Features
Prewarming Local Server
@tongueroo
Jets Features
Prewarming Local Server Jets Call
@tongueroo
Jets Features
Prewarming Local Server Jets Call REPL Console
@tongueroo
Jets Features
Prewarming Local Server Jets Call REPL Console
Database Support
@tongueroo
Jets Features
Prewarming Local Server Jets Call REPL Console
Database Support
Function Properties
@tongueroo
Jets Features
Prewarming Local Server Jets Call REPL Console
Database Support
Function Properties IAM Policies
@tongueroo
Jets Features
Prewarming Local Server Jets Call REPL Console
Database Support
Function Properties IAM Policies Extensions
@tongueroo
Jets Examples
github.com/tongueroo/jets-examples
rubyonjets.com
@tongueroo
The Future?
EC2 LambdaData Center
Tung Nguyen
tung@boltops.com
linkedin.com/in/tongueroo
youtube.com/tongueroo
@tongueroo
sonic
swiss-army knife
jack
elastic beanstalk
ufo
ecs deployment
lono
cloudformation
framework
jets
ruby serverless
framework
Thanks!

Jets: The Ruby Serverless Framework Nashville Tennessee 2019 August