KEMBAR78
Run Code, Not Servers: AWS Lambda | PDF
sponsored by &
RUN CODE, NOT SERVERS:
AWS LAMBDA Özgür Çiçek - ozgur@opsgenie.com, @csozgur

Senior Software Engineer @ OpsGenie
sponsored by &
AGENDA
▸ Serverless Computing
▸ AWS Lambda & Lambda Functions
▸ From Monolith to Serverless
▸ Serverless Application Lifecycle
▸ Demo: ‘Thundra’ in Action on Serverless Architecture
sponsored by &
SERVERLESS COMPUTING
▸ What is Serverless/Serverless Compute?
▸ What does it present?
▸ Advantages of Serverless
▸ Disadvantages of Serverless
sponsored by &
SERVERLESS COMPUTING
WHAT IS SERVERLESS/SERVERLESS COMPUTE
sponsored by &
SERVERLESS COMPUTING
WHAT IS SERVERLESS/SERVERLESS COMPUTE
EC2
sponsored by &
SERVERLESS COMPUTING
WHAT IS SERVERLESS/SERVERLESS COMPUTE
EC2
DynamoDB, Lambda
sponsored by &
SERVERLESS COMPUTING
WHAT IS SERVERLESS/SERVERLESS COMPUTE
EC2
DynamoDB, Lambda
sponsored by &
SERVERLESS COMPUTING
WHAT IS SERVERLESS/SERVERLESS COMPUTE
OpsGenie uses EC2
EC2
DynamoDB, Lambda
sponsored by &
SERVERLESS COMPUTING
WHAT IS SERVERLESS/SERVERLESS COMPUTE
Leverages AWS Lambda
OpsGenie uses EC2
EC2
DynamoDB, Lambda
sponsored by &
“IF YOUR PAAS CAN EFFICIENTLY
START INSTANCES IN 20 MS THAT
RUN FOR HALF A SECOND, THEN
CALL IT SERVERLESS.”
Adrian Cockcroft, VP Cloud Architecture Strategy at AWS
SERVERLESS COMPUTING
sponsored by &
SERVERLESS COMPUTING
WHAT DOES IT PRESENT?
No server management
Flexible scaling
High availability
No idle capacity
sponsored by &
SERVERLESS COMPUTING
SERVERLESS ADVANTAGES
▸ Reduced Labor Cost
▸ Reduced Risk
▸ Reduced Resource Cost
▸ Increased Flexibility of Scaling
▸ Shorter Lead Time
sponsored by &
SERVERLESS COMPUTING
SERVERLESS DISADVANTAGES AND LIMITATIONS
▸ Cold Starts
▸ Lack of Tooling
▸ Local Testing/Debugging
▸ Loss of Control
▸ Immaturity of Services
sponsored by &
AWS LAMBDA & LAMBDA FUNCTIONS
▸ What is AWS Lambda?
▸ What is a Lambda Function?
▸ What does AWS Lambda offer?
▸ What are its capabilities?
▸ What will happen in the Future?
sponsored by &
AWS LAMBDA & LAMBDA FUNCTIONS
WHAT IS AWS LAMBDA?
AWS Lambda: Your new app server
Servers you manage VMs you manage
Your app code you manage
Containers AWS Lambda Manages
sponsored by &
AWS LAMBDA & LAMBDA FUNCTIONS
WHAT IS A LAMBDA FUNCTION?
Lambda Function: Your app code run by AWS Lambda
package example;

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;

public class Hello implements RequestHandler<String, String>{
public String myHandler(String name, Context context) {
return "Hello, " + name;
}
}
sponsored by &
AWS LAMBDA & LAMBDA FUNCTIONS
WHAT DOES AWS LAMBDA OFFER?
No Servers to Manage
Continuous Scaling
Subsecond Metering
sponsored by &
AWS LAMBDA & LAMBDA FUNCTIONS
AWS LAMBDA INTEGRATIONS TO OTHER SERVICES
AWS Lambda Poll Stream

and call Lambda function
Sync calls to AWS Lambda
You can specify invocation type as

- Request Response

- Event

- DryRun
Async calls to AWS Lambda
sponsored by &
AWS LAMBDA & LAMBDA FUNCTIONS
▸ Integration with other services/triggered by events (S3, DynamoDB Streams, …)
▸ Request or Stream based implementations
▸ Built-in retry policy for Async invocations
▸ Built-in DLQ support for Async invocations
▸ Easy deployment and administration of functions
▸ Built-in scalable and high-available workloads
▸ Security with IAM Service
▸ Version & Alias Support
▸ Large file sizes for Java Environment
sponsored by &
AWS LAMBDA & LAMBDA FUNCTIONS
AWS LAMBDA CORE FUNCTIONALITIES
▸ Lambda Functions are ‘stateless’
▸ Lambda Functions must be ‘idempotent’
▸ Execution timeout
▸ Concurrent execution limit
▸ Perfect fit for async and operational tasks
▸ You need more tools and engineering for user-faced
backend because of cold starts of containers
sponsored by &
AWS LAMBDA & LAMBDA FUNCTIONS
WHAT WILL HAPPEN IN THE FUTURE? OUR EXPECTATIONS?
▸ New Integrations with services
▸ More tools from AWS and Community
▸ Improvements on cold start
▸ More control for initial configurations especially on JVM
▸ AWS Lambda Java 9 support
▸ Concurrent Execution Limit per Function
▸ Increased Execution Timeout
▸ CPU or Memory based pricing
▸ Request switching between function aliases
sponsored by &
FROM MONOLITH TO SERVERLESS
MONOLITH PROBLEMS
▸ Common code base
▸ New developer onboarding
▸ Rapidly growing engineering department
▸ Complicated release cycles
▸ Slower deployment
▸ Hard to diagnose problems
▸ Inefficient scalability
▸ Failure effects whole system
▸ Lack of ownership
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION ARCHITECTURE: THE FIRST STEPS
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION OPERATIONAL ARCHITECTURE
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION OPERATIONAL ARCHITECTURE
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION OPERATIONAL ARCHITECTURE
http://www.thundra.io/
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION OPERATIONAL ARCHITECTURE
http://www.thundra.io/
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION OPERATIONAL ARCHITECTURE
http://www.thundra.io/
https://github.com/opsgenie/sirocco
sponsored by &
FROM MONOLITH TO SERVERLESS
THUNDRA: FULL OBSERVABILITY FOR AWS LAMBDA
▸ INSTRUMENT
▸ PROFILE
▸ ZERO OVERHEAD
JVM based monitoring framework
with trace (has instrumentation
and profiling extensions), metric
and log supports
HTTP://WWW.THUNDRA.IO/
sponsored by &
FROM MONOLITH TO SERVERLESS
SIROCCO: AWS LAMBDA INFRASTRUCTURE
▸ Distributed/embedded monitoring (audit + stat + log)
▸ Instrumentation
▸ Profiling
▸ Control requests
▸ Warmup
▸ Discovery
▸ Error handling/retry mechanism over DLQ
Java based Lambda infrastructure developed
by OpsGenie as in-house framework
sponsored by &
FROM MONOLITH TO SERVERLESS
SIROCCO: AWS LAMBDA INFRASTRUCTURE
▸ Distributed/embedded monitoring (audit + stat + log)
▸ Instrumentation
▸ Profiling
▸ Control requests
▸ Warmup
▸ Discovery
▸ Error handling/retry mechanism over DLQ
Java based Lambda infrastructure developed
by OpsGenie as in-house framework
HTTPS://GITHUB.COM/OPSGENIE/SIROCCO
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION DATA REPLICATION
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION DATA REPLICATION
sponsored by &
FROM MONOLITH TO SERVERLESS
ARCHITECTURAL IMPROVEMENTS
sponsored by &
FROM MONOLITH TO SERVERLESS
ARCHITECTURAL IMPROVEMENTS
Break the code to
expose them as
new services
sponsored by &
FROM MONOLITH TO SERVERLESS
ARCHITECTURAL IMPROVEMENTS
Design new async message passing
Break the code to
expose them as
new services
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT EXPERIENCE
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT EXPERIENCE
Remote Environment
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT EXPERIENCE
Local Environment Remote Environment
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT EXPERIENCE
lambda.[region].amazonaws.comLocal Environment Remote Environment
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT EXPERIENCE
lambda.[region].amazonaws.com
localhost:8081
Local Environment Remote Environment
Route to the

related function
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT EXPERIENCE
lambda.[region].amazonaws.com
localhost:8081
Local Environment Remote Environment
Route to the

related function
dynamodb.[region].amazonaws.com
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT EXPERIENCE
lambda.[region].amazonaws.com
localhost:8081
Local Environment Remote Environment
Route to the

related function
localhost:3966
dynamodb.[region].amazonaws.com
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT EXPERIENCE
lambda.[region].amazonaws.com
localhost:8081
Local Environment Remote Environment
Route to the

related function
localhost:9110
localhost:3966
dynamodb.[region].amazonaws.com
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT EXPERIENCE
lambda.[region].amazonaws.com
localhost:8081
Local Environment Remote Environment
Route to the

related function
localhost:9110
endpoint given by ngrok
localhost:3966
dynamodb.[region].amazonaws.com
tunneled to the local
sponsored by &
“IT'S NOT DONE UNTIL IT SHIPS.”
Steve Jobs, Co-founder, Chairman, and CEO of Apple Inc.
SERVERLESS APPLICATION LIFECYCLE
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT TO DEPLOYMENT
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT TO DEPLOYMENT
1. Developer pushes changes to git repository

and create a merge request
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT TO DEPLOYMENT
1. Developer pushes changes to git repository

and create a merge request
2. GitLab triggers CI Flow
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT TO DEPLOYMENT
1. Developer pushes changes to git repository

and create a merge request
2. GitLab triggers CI Flow
3. Source code built and tests run.

If there is no problem,

git branch merged to master
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT TO DEPLOYMENT
1. Developer pushes changes to git repository

and create a merge request
2. GitLab triggers CI Flow
3. Source code built and tests run.

If there is no problem,

git branch merged to master
4. Built Lambda artifacts sent to an S3 bucket

and deployment configurations sent to another S3 bucket
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT TO DEPLOYMENT
1. Developer pushes changes to git repository

and create a merge request
2. GitLab triggers CI Flow
3. Source code built and tests run.

If there is no problem,

git branch merged to master
4. Built Lambda artifacts sent to an S3 bucket

and deployment configurations sent to another S3 bucket
5. Developer run a command

from slack to trigger deploy phase
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT TO DEPLOYMENT
1. Developer pushes changes to git repository

and create a merge request
2. GitLab triggers CI Flow
3. Source code built and tests run.

If there is no problem,

git branch merged to master
4. Built Lambda artifacts sent to an S3 bucket

and deployment configurations sent to another S3 bucket
5. Developer run a command

from slack to trigger deploy phase
6. Slack command run a script

on hotfix instance
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT TO DEPLOYMENT
1. Developer pushes changes to git repository

and create a merge request
2. GitLab triggers CI Flow
3. Source code built and tests run.

If there is no problem,

git branch merged to master
4. Built Lambda artifacts sent to an S3 bucket

and deployment configurations sent to another S3 bucket
5. Developer run a command

from slack to trigger deploy phase
6. Slack command run a script

on hotfix instance
7. Download

deployment configuration
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT TO DEPLOYMENT
1. Developer pushes changes to git repository

and create a merge request
2. GitLab triggers CI Flow
3. Source code built and tests run.

If there is no problem,

git branch merged to master
4. Built Lambda artifacts sent to an S3 bucket

and deployment configurations sent to another S3 bucket
5. Developer run a command

from slack to trigger deploy phase
6. Slack command run a script

on hotfix instance
7. Download

deployment configuration
8. Deploy lambda functions

with AWS SDK
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
DEVELOPMENT TO DEPLOYMENT
1. Developer pushes changes to git repository

and create a merge request
2. GitLab triggers CI Flow
3. Source code built and tests run.

If there is no problem,

git branch merged to master
4. Built Lambda artifacts sent to an S3 bucket

and deployment configurations sent to another S3 bucket
5. Developer run a command

from slack to trigger deploy phase
6. Slack command run a script

on hotfix instance
7. Download

deployment configuration
8. Deploy lambda functions

with AWS SDK
9. AWS Lambda pull jar files

from S3 for lambda functions
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION CANARY DEPLOYMENT
§
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION CANARY DEPLOYMENT
§
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION CANARY DEPLOYMENT
Current Version
§
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION CANARY DEPLOYMENT
Current Version
§
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION CANARY DEPLOYMENT
New Version
Current Version
sponsored by &
FROM MONOLITH TO SERVERLESS
APPLICATION CANARY DEPLOYMENT
New Version
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
CUSTOMER TO DEVELOPER
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
CUSTOMER TO DEVELOPER
1. We collect all data

on our domain

functions
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
CUSTOMER TO DEVELOPER
1. We collect all data

on our domain

functions
2. If there is a problem on

function, we send data

to error queue
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
CUSTOMER TO DEVELOPER
3. We also collect exceptions and send it

to external systems (APM and logging

tools)
1. We collect all data

on our domain

functions
2. If there is a problem on

function, we send data

to error queue
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
CUSTOMER TO DEVELOPER
3. We also collect exceptions and send it

to external systems (APM and logging

tools)
1. We collect all data

on our domain

functions
2. If there is a problem on

function, we send data

to error queue
4. There is a function which

polls error queue
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
CUSTOMER TO DEVELOPER
3. We also collect exceptions and send it

to external systems (APM and logging

tools)
1. We collect all data

on our domain

functions
2. If there is a problem on

function, we send data

to error queue
4. There is a function which

polls error queue
5. If there is an error on queue, create an alert on OpsGenie
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
CUSTOMER TO DEVELOPER
3. We also collect exceptions and send it

to external systems (APM and logging

tools)
1. We collect all data

on our domain

functions
2. If there is a problem on

function, we send data

to error queue
4. There is a function which

polls error queue
5. If there is an error on queue, create an alert on OpsGenie
6. OpsGenie notify us
sponsored by &
SERVERLESS APPLICATION LIFECYCLE
CUSTOMER TO DEVELOPER
3. We also collect exceptions and send it

to external systems (APM and logging

tools)
1. We collect all data

on our domain

functions
2. If there is a problem on

function, we send data

to error queue
4. There is a function which

polls error queue
5. If there is an error on queue, create an alert on OpsGenie
6. OpsGenie notify us
7. We take an action with the

information on alert and related
trace, metric and log data
sponsored by &
EXTERNAL SOURCES
COMMUNITY, IMPORTANT AND EXTERNAL TOOLS
▸ Serverless Framework, Deployment
▸ IOPipe, Monitoring
▸ Open Faas, Local Serverless
▸ SAM, Serverless Application Model
▸ Local SAM, AWS Local Testing Tool
▸ AWS X-RAY
▸ AWS Step Functions
sponsored by &
“TALK IS CHEAP. SHOW ME THE
CODE.”
Linus Torvalds, the Founder and Coordinator of Linux
LIVE DEMO: THUNDRA IN ACTION
sponsored by &
LIVE DEMO: THUNDRA IN ACTION
THUNDRA IN ACTION ON SERVERLESS ARCHITECTURE
sponsored by &
Thank You
&

Run Code, Not Servers: AWS Lambda

  • 1.
    sponsored by & RUNCODE, NOT SERVERS: AWS LAMBDA Özgür Çiçek - ozgur@opsgenie.com, @csozgur
 Senior Software Engineer @ OpsGenie
  • 2.
    sponsored by & AGENDA ▸Serverless Computing ▸ AWS Lambda & Lambda Functions ▸ From Monolith to Serverless ▸ Serverless Application Lifecycle ▸ Demo: ‘Thundra’ in Action on Serverless Architecture
  • 3.
    sponsored by & SERVERLESSCOMPUTING ▸ What is Serverless/Serverless Compute? ▸ What does it present? ▸ Advantages of Serverless ▸ Disadvantages of Serverless
  • 4.
    sponsored by & SERVERLESSCOMPUTING WHAT IS SERVERLESS/SERVERLESS COMPUTE
  • 5.
    sponsored by & SERVERLESSCOMPUTING WHAT IS SERVERLESS/SERVERLESS COMPUTE EC2
  • 6.
    sponsored by & SERVERLESSCOMPUTING WHAT IS SERVERLESS/SERVERLESS COMPUTE EC2 DynamoDB, Lambda
  • 7.
    sponsored by & SERVERLESSCOMPUTING WHAT IS SERVERLESS/SERVERLESS COMPUTE EC2 DynamoDB, Lambda
  • 8.
    sponsored by & SERVERLESSCOMPUTING WHAT IS SERVERLESS/SERVERLESS COMPUTE OpsGenie uses EC2 EC2 DynamoDB, Lambda
  • 9.
    sponsored by & SERVERLESSCOMPUTING WHAT IS SERVERLESS/SERVERLESS COMPUTE Leverages AWS Lambda OpsGenie uses EC2 EC2 DynamoDB, Lambda
  • 10.
    sponsored by & “IFYOUR PAAS CAN EFFICIENTLY START INSTANCES IN 20 MS THAT RUN FOR HALF A SECOND, THEN CALL IT SERVERLESS.” Adrian Cockcroft, VP Cloud Architecture Strategy at AWS SERVERLESS COMPUTING
  • 11.
    sponsored by & SERVERLESSCOMPUTING WHAT DOES IT PRESENT? No server management Flexible scaling High availability No idle capacity
  • 12.
    sponsored by & SERVERLESSCOMPUTING SERVERLESS ADVANTAGES ▸ Reduced Labor Cost ▸ Reduced Risk ▸ Reduced Resource Cost ▸ Increased Flexibility of Scaling ▸ Shorter Lead Time
  • 13.
    sponsored by & SERVERLESSCOMPUTING SERVERLESS DISADVANTAGES AND LIMITATIONS ▸ Cold Starts ▸ Lack of Tooling ▸ Local Testing/Debugging ▸ Loss of Control ▸ Immaturity of Services
  • 14.
    sponsored by & AWSLAMBDA & LAMBDA FUNCTIONS ▸ What is AWS Lambda? ▸ What is a Lambda Function? ▸ What does AWS Lambda offer? ▸ What are its capabilities? ▸ What will happen in the Future?
  • 15.
    sponsored by & AWSLAMBDA & LAMBDA FUNCTIONS WHAT IS AWS LAMBDA? AWS Lambda: Your new app server Servers you manage VMs you manage Your app code you manage Containers AWS Lambda Manages
  • 16.
    sponsored by & AWSLAMBDA & LAMBDA FUNCTIONS WHAT IS A LAMBDA FUNCTION? Lambda Function: Your app code run by AWS Lambda package example;
 import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler;
 public class Hello implements RequestHandler<String, String>{ public String myHandler(String name, Context context) { return "Hello, " + name; } }
  • 17.
    sponsored by & AWSLAMBDA & LAMBDA FUNCTIONS WHAT DOES AWS LAMBDA OFFER? No Servers to Manage Continuous Scaling Subsecond Metering
  • 18.
    sponsored by & AWSLAMBDA & LAMBDA FUNCTIONS AWS LAMBDA INTEGRATIONS TO OTHER SERVICES AWS Lambda Poll Stream
 and call Lambda function Sync calls to AWS Lambda You can specify invocation type as
 - Request Response
 - Event
 - DryRun Async calls to AWS Lambda
  • 19.
    sponsored by & AWSLAMBDA & LAMBDA FUNCTIONS ▸ Integration with other services/triggered by events (S3, DynamoDB Streams, …) ▸ Request or Stream based implementations ▸ Built-in retry policy for Async invocations ▸ Built-in DLQ support for Async invocations ▸ Easy deployment and administration of functions ▸ Built-in scalable and high-available workloads ▸ Security with IAM Service ▸ Version & Alias Support ▸ Large file sizes for Java Environment
  • 20.
    sponsored by & AWSLAMBDA & LAMBDA FUNCTIONS AWS LAMBDA CORE FUNCTIONALITIES ▸ Lambda Functions are ‘stateless’ ▸ Lambda Functions must be ‘idempotent’ ▸ Execution timeout ▸ Concurrent execution limit ▸ Perfect fit for async and operational tasks ▸ You need more tools and engineering for user-faced backend because of cold starts of containers
  • 21.
    sponsored by & AWSLAMBDA & LAMBDA FUNCTIONS WHAT WILL HAPPEN IN THE FUTURE? OUR EXPECTATIONS? ▸ New Integrations with services ▸ More tools from AWS and Community ▸ Improvements on cold start ▸ More control for initial configurations especially on JVM ▸ AWS Lambda Java 9 support ▸ Concurrent Execution Limit per Function ▸ Increased Execution Timeout ▸ CPU or Memory based pricing ▸ Request switching between function aliases
  • 22.
    sponsored by & FROMMONOLITH TO SERVERLESS MONOLITH PROBLEMS ▸ Common code base ▸ New developer onboarding ▸ Rapidly growing engineering department ▸ Complicated release cycles ▸ Slower deployment ▸ Hard to diagnose problems ▸ Inefficient scalability ▸ Failure effects whole system ▸ Lack of ownership
  • 23.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION ARCHITECTURE: THE FIRST STEPS
  • 24.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION OPERATIONAL ARCHITECTURE
  • 25.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION OPERATIONAL ARCHITECTURE
  • 26.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION OPERATIONAL ARCHITECTURE http://www.thundra.io/
  • 27.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION OPERATIONAL ARCHITECTURE http://www.thundra.io/
  • 28.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION OPERATIONAL ARCHITECTURE http://www.thundra.io/ https://github.com/opsgenie/sirocco
  • 29.
    sponsored by & FROMMONOLITH TO SERVERLESS THUNDRA: FULL OBSERVABILITY FOR AWS LAMBDA ▸ INSTRUMENT ▸ PROFILE ▸ ZERO OVERHEAD JVM based monitoring framework with trace (has instrumentation and profiling extensions), metric and log supports HTTP://WWW.THUNDRA.IO/
  • 30.
    sponsored by & FROMMONOLITH TO SERVERLESS SIROCCO: AWS LAMBDA INFRASTRUCTURE ▸ Distributed/embedded monitoring (audit + stat + log) ▸ Instrumentation ▸ Profiling ▸ Control requests ▸ Warmup ▸ Discovery ▸ Error handling/retry mechanism over DLQ Java based Lambda infrastructure developed by OpsGenie as in-house framework
  • 31.
    sponsored by & FROMMONOLITH TO SERVERLESS SIROCCO: AWS LAMBDA INFRASTRUCTURE ▸ Distributed/embedded monitoring (audit + stat + log) ▸ Instrumentation ▸ Profiling ▸ Control requests ▸ Warmup ▸ Discovery ▸ Error handling/retry mechanism over DLQ Java based Lambda infrastructure developed by OpsGenie as in-house framework HTTPS://GITHUB.COM/OPSGENIE/SIROCCO
  • 32.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION DATA REPLICATION
  • 33.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION DATA REPLICATION
  • 34.
    sponsored by & FROMMONOLITH TO SERVERLESS ARCHITECTURAL IMPROVEMENTS
  • 35.
    sponsored by & FROMMONOLITH TO SERVERLESS ARCHITECTURAL IMPROVEMENTS Break the code to expose them as new services
  • 36.
    sponsored by & FROMMONOLITH TO SERVERLESS ARCHITECTURAL IMPROVEMENTS Design new async message passing Break the code to expose them as new services
  • 37.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT EXPERIENCE
  • 38.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT EXPERIENCE Remote Environment
  • 39.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT EXPERIENCE Local Environment Remote Environment
  • 40.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT EXPERIENCE lambda.[region].amazonaws.comLocal Environment Remote Environment
  • 41.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT EXPERIENCE lambda.[region].amazonaws.com localhost:8081 Local Environment Remote Environment Route to the
 related function
  • 42.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT EXPERIENCE lambda.[region].amazonaws.com localhost:8081 Local Environment Remote Environment Route to the
 related function dynamodb.[region].amazonaws.com
  • 43.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT EXPERIENCE lambda.[region].amazonaws.com localhost:8081 Local Environment Remote Environment Route to the
 related function localhost:3966 dynamodb.[region].amazonaws.com
  • 44.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT EXPERIENCE lambda.[region].amazonaws.com localhost:8081 Local Environment Remote Environment Route to the
 related function localhost:9110 localhost:3966 dynamodb.[region].amazonaws.com
  • 45.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT EXPERIENCE lambda.[region].amazonaws.com localhost:8081 Local Environment Remote Environment Route to the
 related function localhost:9110 endpoint given by ngrok localhost:3966 dynamodb.[region].amazonaws.com tunneled to the local
  • 46.
    sponsored by & “IT'SNOT DONE UNTIL IT SHIPS.” Steve Jobs, Co-founder, Chairman, and CEO of Apple Inc. SERVERLESS APPLICATION LIFECYCLE
  • 47.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT TO DEPLOYMENT
  • 48.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT TO DEPLOYMENT 1. Developer pushes changes to git repository
 and create a merge request
  • 49.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT TO DEPLOYMENT 1. Developer pushes changes to git repository
 and create a merge request 2. GitLab triggers CI Flow
  • 50.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT TO DEPLOYMENT 1. Developer pushes changes to git repository
 and create a merge request 2. GitLab triggers CI Flow 3. Source code built and tests run.
 If there is no problem,
 git branch merged to master
  • 51.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT TO DEPLOYMENT 1. Developer pushes changes to git repository
 and create a merge request 2. GitLab triggers CI Flow 3. Source code built and tests run.
 If there is no problem,
 git branch merged to master 4. Built Lambda artifacts sent to an S3 bucket
 and deployment configurations sent to another S3 bucket
  • 52.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT TO DEPLOYMENT 1. Developer pushes changes to git repository
 and create a merge request 2. GitLab triggers CI Flow 3. Source code built and tests run.
 If there is no problem,
 git branch merged to master 4. Built Lambda artifacts sent to an S3 bucket
 and deployment configurations sent to another S3 bucket 5. Developer run a command
 from slack to trigger deploy phase
  • 53.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT TO DEPLOYMENT 1. Developer pushes changes to git repository
 and create a merge request 2. GitLab triggers CI Flow 3. Source code built and tests run.
 If there is no problem,
 git branch merged to master 4. Built Lambda artifacts sent to an S3 bucket
 and deployment configurations sent to another S3 bucket 5. Developer run a command
 from slack to trigger deploy phase 6. Slack command run a script
 on hotfix instance
  • 54.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT TO DEPLOYMENT 1. Developer pushes changes to git repository
 and create a merge request 2. GitLab triggers CI Flow 3. Source code built and tests run.
 If there is no problem,
 git branch merged to master 4. Built Lambda artifacts sent to an S3 bucket
 and deployment configurations sent to another S3 bucket 5. Developer run a command
 from slack to trigger deploy phase 6. Slack command run a script
 on hotfix instance 7. Download
 deployment configuration
  • 55.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT TO DEPLOYMENT 1. Developer pushes changes to git repository
 and create a merge request 2. GitLab triggers CI Flow 3. Source code built and tests run.
 If there is no problem,
 git branch merged to master 4. Built Lambda artifacts sent to an S3 bucket
 and deployment configurations sent to another S3 bucket 5. Developer run a command
 from slack to trigger deploy phase 6. Slack command run a script
 on hotfix instance 7. Download
 deployment configuration 8. Deploy lambda functions
 with AWS SDK
  • 56.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE DEVELOPMENT TO DEPLOYMENT 1. Developer pushes changes to git repository
 and create a merge request 2. GitLab triggers CI Flow 3. Source code built and tests run.
 If there is no problem,
 git branch merged to master 4. Built Lambda artifacts sent to an S3 bucket
 and deployment configurations sent to another S3 bucket 5. Developer run a command
 from slack to trigger deploy phase 6. Slack command run a script
 on hotfix instance 7. Download
 deployment configuration 8. Deploy lambda functions
 with AWS SDK 9. AWS Lambda pull jar files
 from S3 for lambda functions
  • 57.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION CANARY DEPLOYMENT §
  • 58.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION CANARY DEPLOYMENT §
  • 59.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION CANARY DEPLOYMENT Current Version §
  • 60.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION CANARY DEPLOYMENT Current Version §
  • 61.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION CANARY DEPLOYMENT New Version Current Version
  • 62.
    sponsored by & FROMMONOLITH TO SERVERLESS APPLICATION CANARY DEPLOYMENT New Version
  • 63.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE CUSTOMER TO DEVELOPER
  • 64.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE CUSTOMER TO DEVELOPER 1. We collect all data
 on our domain
 functions
  • 65.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE CUSTOMER TO DEVELOPER 1. We collect all data
 on our domain
 functions 2. If there is a problem on
 function, we send data
 to error queue
  • 66.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE CUSTOMER TO DEVELOPER 3. We also collect exceptions and send it
 to external systems (APM and logging
 tools) 1. We collect all data
 on our domain
 functions 2. If there is a problem on
 function, we send data
 to error queue
  • 67.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE CUSTOMER TO DEVELOPER 3. We also collect exceptions and send it
 to external systems (APM and logging
 tools) 1. We collect all data
 on our domain
 functions 2. If there is a problem on
 function, we send data
 to error queue 4. There is a function which
 polls error queue
  • 68.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE CUSTOMER TO DEVELOPER 3. We also collect exceptions and send it
 to external systems (APM and logging
 tools) 1. We collect all data
 on our domain
 functions 2. If there is a problem on
 function, we send data
 to error queue 4. There is a function which
 polls error queue 5. If there is an error on queue, create an alert on OpsGenie
  • 69.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE CUSTOMER TO DEVELOPER 3. We also collect exceptions and send it
 to external systems (APM and logging
 tools) 1. We collect all data
 on our domain
 functions 2. If there is a problem on
 function, we send data
 to error queue 4. There is a function which
 polls error queue 5. If there is an error on queue, create an alert on OpsGenie 6. OpsGenie notify us
  • 70.
    sponsored by & SERVERLESSAPPLICATION LIFECYCLE CUSTOMER TO DEVELOPER 3. We also collect exceptions and send it
 to external systems (APM and logging
 tools) 1. We collect all data
 on our domain
 functions 2. If there is a problem on
 function, we send data
 to error queue 4. There is a function which
 polls error queue 5. If there is an error on queue, create an alert on OpsGenie 6. OpsGenie notify us 7. We take an action with the
 information on alert and related trace, metric and log data
  • 71.
    sponsored by & EXTERNALSOURCES COMMUNITY, IMPORTANT AND EXTERNAL TOOLS ▸ Serverless Framework, Deployment ▸ IOPipe, Monitoring ▸ Open Faas, Local Serverless ▸ SAM, Serverless Application Model ▸ Local SAM, AWS Local Testing Tool ▸ AWS X-RAY ▸ AWS Step Functions
  • 72.
    sponsored by & “TALKIS CHEAP. SHOW ME THE CODE.” Linus Torvalds, the Founder and Coordinator of Linux LIVE DEMO: THUNDRA IN ACTION
  • 73.
    sponsored by & LIVEDEMO: THUNDRA IN ACTION THUNDRA IN ACTION ON SERVERLESS ARCHITECTURE
  • 74.