SlideShare a Scribd company logo
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Do more with less code
in Serverless
Jérôme Van Der Linden
Solutions Architect
AWS
S V S 3 5 2 - G
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Clean Code
Single Responsibility Principle
You Ain’t Gonna Need It
Keep It Simple Stupid
Agenda
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Clean Code
Software Craftsmanship & Clean Code
Software Craftsmanship & Clean Code
SOLID
- Single Responsibility Principle
YAGNI
- You Ain’t Gonna Need It
KISS
- Keep it Simple Stupid
Some clean code principles
https://www.amazon.es/Wenger-19201-Navaja-suiza/dp/B000R0JDSI
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Single Responsibility Principle
Single Responsibility Principle
Do’s Don’ts *
- Input validation
- Business logic
- Transform data
- Return result
- Event/Input Filtering
- Transport data
- Orchestration & long
transactions
* Most of the time
Single Responsibility Principle
Do’s Don’ts *
- Input validation
- Business logic
- Transform data
- Return result
- Event/Input Filtering
- Transport data
- Orchestration & long
transactions
* Most of the time
Serverless is not only AWS Lambda
COMPUTE
DATA STORES
INTEGRATION
Amazon
DynamoDB
Amazon Aurora
Serverless
Amazon
S3
AWS
Lambda
AWS
Fargate
Amazon
EventBridge
Amazon
API Gateway
Amazon
SQS
Amazon
SNS
AWS
AppSync
AWS
Step Functions
Event Filtering – the wrong way
SNS
Topic
Publisher
if event_type == 'order_created’:
lambda_client.invoke('OrderCreation', ...)
elif event_type == 'order_placed’:
lambda_client.invoke('OrderPlacement', ...)
elif event_type == 'order_cancelled’:
lambda_client.invoke('OrderCancelation', ...)
OrderCreation
OrderPlacement
OrderCancellation
{
"event_type": "order_placed",
"order": {
"id": "232134",
"amount": "2341,45",
"stock_ref": "AMZN”
}
}
𝝺 function code
Input event
OrderFiltering
Event Filtering with Amazon SNS
SNS
Topic
Publisher
OrderCreation
OrderPlacement
OrderCancellation
OrderCreationEvent:
Type: AWS::SNS::Subscription
Properties:
TopicArn: 'arn:aws:sns:eu-central-1:123456789:OrdersTopic'
Protocol: lambda
Endpoint: 'arn:aws:lambda:eu-central-1:123456789:function:OrderCreation'
FilterPolicy:
event_type:
- order_created
{
"event_type": [
"order_created"
]
}
Filter policyCloudformation template
https://docs.aws.amazon.com/sns/latest/dg/sns-subscription-filter-policies.html
Event Filtering with Amazon EventBridge
https://docs.aws.amazon.com/eventbridge/latest/userguide/content-filtering-with-event-patterns.html
{
"Source": "custom.myOrderapp",
"EventBusName": "default",
"DetailType": "order",
"Time": "Wed Jan 29 2020 08:03:18 GMT-0500",
"Detail":{
"event_type": "order_created",
"order": {
"id": "232134",
"amount": "2341.45",
"stock_ref": "AMZN",
"quantity": "3",
"result": "approved"
}
}
}
EventBridge
Event Bus
Rules Targets
{
"source": [ "custom.myOrderapp" ],
"detail-type": [ "order" ],
"detail": {
"event_type": [ "order_created" ],
"amount": [ { "numeric": [ ">", 2000 ] } ],
"result": [ "approved" ]
}
}
Orchestration – the wrong way
invoke
invokeif (…
)
invoke //
else
if (success)
Notify with SNS
n * invoke
if (failure)
Enqueue error
notify with SNS
need approval App…
Simple orchestration with Lambda destinations
invoke
invokeif (…
)
invoke //
else
if (success)
Notify with SNS
n * invoke
if (failure)
Enqueue error
notify with SNS
need approval App…
Lambda Destinations
https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations
Simple orchestration with Lambda destinations
Amazon SNS
Amazon
EventBridge
Amazon
Cloudwatch Logs
Amazon S3
Amazon SES
AWS Config
Amazon
CloudFormation
AWS
CodeCommit
A
S
Y
N
C
"DestinationConfig": {
"onSuccess": {
"Destination": "arn:aws:sns:..."
},
"onFailure": {
"Destination": "arn:aws:sqs:..."
}
}
Cloudformation template
Amazon SNS
Amazon
EventBridge
Amazon
SQS
AWS Lambda
if success:
return {...}
else:
raise Exception(‘Failure', {...})
𝝺 function code
Lambda function
A
S
Y
N
C
Advanced orchestration with AWS Step Functions
invoke
invokeif (…
)
invoke //
else
if (success)
Notify with SNS
n * invoke
if (failure)
Enqueue error
notify with SNS
need approval App…
https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html
{
"StartAt": "SimpleInvocation",
"States": {
"SimpleInvocation": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-central-1:123456789
"Next": "Choose1or2"
},
"Choose1or2": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.foo",
"NumericEquals": 1,
"Next": "Lambda1"
},
{
"Variable": "$.foo",
"NumericEquals": 2,
"Next": "ParallelInvocation"
}
],
"Default": "Unmatched"
},
"Lambda1": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-central-1:123456789
Advanced orchestration with AWS Step Functions
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
You Ain’t Gonna Need It
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
"No server is easier to manage
than 'no server' "
Werner Vogels
VP & CTO Amazon.com
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
"No function is easier to
manage than 'no function' "
Me
Solutions Architect AWS
Common architecture
API DatabaseBackend
Common serverless architecture
Amazon
API Gateway
Amazon
DynamoDB
AWS
Lambda
Common serverless architecture
Amazon
API Gateway
Amazon
DynamoDB
AWS
Lambda
// Validate input
// CRUD
// (return)
Functionless architecture
Amazon
API Gateway
Amazon
DynamoDB
// Validate input
// CRUD
// (return)
Amazon API Gateway Service Proxy
Amazon
API Gateway
Amazon
DynamoDB
https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-aws-proxy.html
Amazon API Gateway Service Proxy
Amazon
API Gateway
Amazon
DynamoDB
https://velocity.apache.org/engine/devel/vtl-reference.html
Amazon API Gateway Request Validation
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html
Amazon
API Gateway
Amazon
DynamoDB
Amazon API Gateway Request Validation
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html
Amazon
API Gateway
Amazon
DynamoDB
Functionless architecture
Amazon
API Gateway
Amazon
DynamoDB
// Validate input
// CRUD
// (return)
Functionless architecture
AWS
AppSync
Amazon
DynamoDB
Amazon Aurora
Serverless
Amazon
Elasticsearch Service
AWS Step Functions integrations
AWS Lambda
AWS Batch Amazon DynamoDB Amazon ECS / Fargate Amazon EMR AWS Glue
Amazon SageMaker Amazon SNS Amazon SQS AWS Step Functions AWS CodeBuild
https://docs.aws.amazon.com/step-functions/latest/dg/concepts-service-integrations.html
AWS Step Functions integrations
"QueueError": {
"Type": "Task",
"Resource": "arn:aws:states:::sqs:sendMessage",
"Parameters": {
"QueueUrl": "https://sqs.eu-central-1.amazonaws.com/123456789012/myQueue",
"MessageBody.$": "$.input.message"
},
"End": true
},
"SendNotification": {
"Type": "Task",
"Resource": "arn:aws:states:::sns:publish",
"Parameters": {
"TopicARN": "arn:aws:sns:eu-central-
1:123456789012:myTopic",
"Subject": "Lambda1 has successfully finish its job",
"Message.$" : "$.input.message"
},
"End": true
},
SQS
SNS
Amazon EventBridge integrations
https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-targets.html
EventBridge
Event Bus
Rules Targets
AWS Batch
Amazon
EC2 Instance
Amazon
ECS Task
AWS
Step Functions
Amazon SNS Amazon SQS
Amazon Kinesis
Data Streams
Amazon Kinesis
Data Firehose
Amazon
EventBridge
AWS
CodeBuild
AWS
CodePipeline
Amazon
API Gateway
SSM Run
Command
SSM
Automation
Amazon
Redshift
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Keep it Simple Stupid
aka Conclusion
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
“There are two ways of constructing a software design:
One way is to make it so simple that there are obviously
no deficiencies, and the other way is to make it so
complicated that there are no obvious deficiencies.
The first method is far more difficult.”
Tony Hoare
Former Professor at Oxford
Keep it Simple
Simpler functions
=
Easier to test and maintain
Faster to start: less cold start
More scalable: higher throughput
More secure: less permission needed
Keep your 𝝺 code focused on the business
Keep it Stupid
Business code is the clever part of the function
Orchestration is not the responsibility of a 𝝺
Clever
Keep it… or leave it
𝝺 is not always needed
You can save costs and optimize performance
when functions are just passthrough or mapping
Thank you!
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Jérôme Van Der Linden
AWS Solutions Architect
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

What's hot

AWS Lambda Layers, the Runtime API, & Nested Applications
AWS Lambda Layers, the Runtime API, & Nested ApplicationsAWS Lambda Layers, the Runtime API, & Nested Applications
AWS Lambda Layers, the Runtime API, & Nested Applications
Amazon Web Services
 
Getting Started with AWS Lambda & Serverless Computing
Getting Started with AWS Lambda & Serverless ComputingGetting Started with AWS Lambda & Serverless Computing
Getting Started with AWS Lambda & Serverless Computing
Amazon Web Services
 
Getting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless Computing
Amazon Web Services
 
Serverless Architectural Patterns: Collision 2018
Serverless Architectural Patterns: Collision 2018Serverless Architectural Patterns: Collision 2018
Serverless Architectural Patterns: Collision 2018
Amazon Web Services
 
Gojko's 5 rules for super responsive Serverless applications
Gojko's 5 rules for super responsive Serverless applicationsGojko's 5 rules for super responsive Serverless applications
Gojko's 5 rules for super responsive Serverless applications
Daniel Zivkovic
 
BDA310 An Introduction to the AI services at AWS
BDA310 An Introduction to the AI services at AWSBDA310 An Introduction to the AI services at AWS
BDA310 An Introduction to the AI services at AWS
Amazon Web Services
 
Building resilient serverless systems with non serverless components
Building resilient serverless systems with non serverless componentsBuilding resilient serverless systems with non serverless components
Building resilient serverless systems with non serverless components
Jeremy Daly
 
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
Chris Munns
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
Amazon Web Services
 
Productionize Serverless Application Building and Deployments with AWS SAM - ...
Productionize Serverless Application Building and Deployments with AWS SAM - ...Productionize Serverless Application Building and Deployments with AWS SAM - ...
Productionize Serverless Application Building and Deployments with AWS SAM - ...
Amazon Web Services
 
AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...
AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...
AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...
Simplilearn
 
Building serverless applications with Amazon S3
Building serverless applications with Amazon S3Building serverless applications with Amazon S3
Building serverless applications with Amazon S3
Chris Munns
 
re:Invent 2018: AI/ML Services
re:Invent 2018: AI/ML Servicesre:Invent 2018: AI/ML Services
re:Invent 2018: AI/ML Services
Amazon Web Services
 
AWS Serverless Development
AWS Serverless DevelopmentAWS Serverless Development
AWS Serverless Development
Amazon Web Services
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
Amazon Web Services
 
Building Advanced Serverless Applications
Building Advanced Serverless ApplicationsBuilding Advanced Serverless Applications
Building Advanced Serverless Applications
Amazon Web Services
 
Amy Arambulo Negrette - Serverless Frenemies: Serverless Containers in Lambd...
 Amy Arambulo Negrette - Serverless Frenemies: Serverless Containers in Lambd... Amy Arambulo Negrette - Serverless Frenemies: Serverless Containers in Lambd...
Amy Arambulo Negrette - Serverless Frenemies: Serverless Containers in Lambd...
AWS Chicago
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
Amazon Web Services
 
To Serverless And Beyond!
To Serverless And Beyond!To Serverless And Beyond!
To Serverless And Beyond!
SheenBrisals
 
Serverless Architectures.pdf
Serverless Architectures.pdfServerless Architectures.pdf
Serverless Architectures.pdf
Amazon Web Services
 

What's hot (20)

AWS Lambda Layers, the Runtime API, & Nested Applications
AWS Lambda Layers, the Runtime API, & Nested ApplicationsAWS Lambda Layers, the Runtime API, & Nested Applications
AWS Lambda Layers, the Runtime API, & Nested Applications
 
Getting Started with AWS Lambda & Serverless Computing
Getting Started with AWS Lambda & Serverless ComputingGetting Started with AWS Lambda & Serverless Computing
Getting Started with AWS Lambda & Serverless Computing
 
Getting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless Computing
 
Serverless Architectural Patterns: Collision 2018
Serverless Architectural Patterns: Collision 2018Serverless Architectural Patterns: Collision 2018
Serverless Architectural Patterns: Collision 2018
 
Gojko's 5 rules for super responsive Serverless applications
Gojko's 5 rules for super responsive Serverless applicationsGojko's 5 rules for super responsive Serverless applications
Gojko's 5 rules for super responsive Serverless applications
 
BDA310 An Introduction to the AI services at AWS
BDA310 An Introduction to the AI services at AWSBDA310 An Introduction to the AI services at AWS
BDA310 An Introduction to the AI services at AWS
 
Building resilient serverless systems with non serverless components
Building resilient serverless systems with non serverless componentsBuilding resilient serverless systems with non serverless components
Building resilient serverless systems with non serverless components
 
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
 
Productionize Serverless Application Building and Deployments with AWS SAM - ...
Productionize Serverless Application Building and Deployments with AWS SAM - ...Productionize Serverless Application Building and Deployments with AWS SAM - ...
Productionize Serverless Application Building and Deployments with AWS SAM - ...
 
AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...
AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...
AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...
 
Building serverless applications with Amazon S3
Building serverless applications with Amazon S3Building serverless applications with Amazon S3
Building serverless applications with Amazon S3
 
re:Invent 2018: AI/ML Services
re:Invent 2018: AI/ML Servicesre:Invent 2018: AI/ML Services
re:Invent 2018: AI/ML Services
 
AWS Serverless Development
AWS Serverless DevelopmentAWS Serverless Development
AWS Serverless Development
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
 
Building Advanced Serverless Applications
Building Advanced Serverless ApplicationsBuilding Advanced Serverless Applications
Building Advanced Serverless Applications
 
Amy Arambulo Negrette - Serverless Frenemies: Serverless Containers in Lambd...
 Amy Arambulo Negrette - Serverless Frenemies: Serverless Containers in Lambd... Amy Arambulo Negrette - Serverless Frenemies: Serverless Containers in Lambd...
Amy Arambulo Negrette - Serverless Frenemies: Serverless Containers in Lambd...
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
To Serverless And Beyond!
To Serverless And Beyond!To Serverless And Beyond!
To Serverless And Beyond!
 
Serverless Architectures.pdf
Serverless Architectures.pdfServerless Architectures.pdf
Serverless Architectures.pdf
 

Similar to Do more with less code in serverless

AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A SymphonyAWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
Amazon Web Services
 
Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用
Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用
Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用
Amazon Web Services
 
How LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With ServerlessHow LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With Serverless
SheenBrisals
 
Amazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersAmazon Web Services for PHP Developers
Amazon Web Services for PHP Developers
Jeremy Lindblom
 
Going Serverless
Going ServerlessGoing Serverless
Going Serverless
Mattias Severson
 
AWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as CodeAWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as Code
Amazon Web Services
 
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
Amazon Web Services
 
Cloud Computing in PHP With the Amazon Web Services
Cloud Computing in PHP With the Amazon Web ServicesCloud Computing in PHP With the Amazon Web Services
Cloud Computing in PHP With the Amazon Web Services
Amazon Web Services
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
Amazon Web Services
 
Introduciendo Serverless en Proyectos Python
Introduciendo Serverless en Proyectos PythonIntroduciendo Serverless en Proyectos Python
Introduciendo Serverless en Proyectos Python
Carlos Hernando
 
What's new in Serverless at AWS?
What's new in Serverless at AWS?What's new in Serverless at AWS?
What's new in Serverless at AWS?
Daniel Zivkovic
 
Serverless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLMServerless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLM
Boaz Ziniman
 
Serverless computing with AWS Lambda
Serverless computing with AWS Lambda Serverless computing with AWS Lambda
Serverless computing with AWS Lambda
Apigee | Google Cloud
 
Build and run applications without thinking about servers
Build and run applications without thinking about serversBuild and run applications without thinking about servers
Build and run applications without thinking about servers
Amazon Web Services
 
Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Development in the could: How do we do it(Cloud computing. Microservices. Faas)Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Preply.com
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
Amazon Web Services
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Amazon Web Services
 
An introduction to serverless architectures (February 2017)
An introduction to serverless architectures (February 2017)An introduction to serverless architectures (February 2017)
An introduction to serverless architectures (February 2017)
Julien SIMON
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
Amazon Web Services
 
Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (Going Serverless)Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (Going Serverless)
Yan Cui
 

Similar to Do more with less code in serverless (20)

AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A SymphonyAWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
 
Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用
Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用
Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用
 
How LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With ServerlessHow LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With Serverless
 
Amazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersAmazon Web Services for PHP Developers
Amazon Web Services for PHP Developers
 
Going Serverless
Going ServerlessGoing Serverless
Going Serverless
 
AWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as CodeAWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as Code
 
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
 
Cloud Computing in PHP With the Amazon Web Services
Cloud Computing in PHP With the Amazon Web ServicesCloud Computing in PHP With the Amazon Web Services
Cloud Computing in PHP With the Amazon Web Services
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
 
Introduciendo Serverless en Proyectos Python
Introduciendo Serverless en Proyectos PythonIntroduciendo Serverless en Proyectos Python
Introduciendo Serverless en Proyectos Python
 
What's new in Serverless at AWS?
What's new in Serverless at AWS?What's new in Serverless at AWS?
What's new in Serverless at AWS?
 
Serverless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLMServerless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLM
 
Serverless computing with AWS Lambda
Serverless computing with AWS Lambda Serverless computing with AWS Lambda
Serverless computing with AWS Lambda
 
Build and run applications without thinking about servers
Build and run applications without thinking about serversBuild and run applications without thinking about servers
Build and run applications without thinking about servers
 
Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Development in the could: How do we do it(Cloud computing. Microservices. Faas)Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Development in the could: How do we do it(Cloud computing. Microservices. Faas)
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
 
An introduction to serverless architectures (February 2017)
An introduction to serverless architectures (February 2017)An introduction to serverless architectures (February 2017)
An introduction to serverless architectures (February 2017)
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
 
Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (Going Serverless)Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (Going Serverless)
 

More from jeromevdl

Do more with less code in a serverless world
Do more with less code in a serverless worldDo more with less code in a serverless world
Do more with less code in a serverless world
jeromevdl
 
DevopsDays Geneva 2020 - Compliance & Governance as Code
DevopsDays Geneva 2020 - Compliance & Governance as CodeDevopsDays Geneva 2020 - Compliance & Governance as Code
DevopsDays Geneva 2020 - Compliance & Governance as Code
jeromevdl
 
Softshake 2017 - Développer un chatbot Alexa
Softshake 2017 - Développer un chatbot AlexaSoftshake 2017 - Développer un chatbot Alexa
Softshake 2017 - Développer un chatbot Alexa
jeromevdl
 
Chatbots buzzword ou nouvel eldorado
Chatbots   buzzword ou nouvel eldoradoChatbots   buzzword ou nouvel eldorado
Chatbots buzzword ou nouvel eldorado
jeromevdl
 
Management projet vs management produit
Management projet vs management produitManagement projet vs management produit
Management projet vs management produit
jeromevdl
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applications
jeromevdl
 
My Android is not an iPhone like any others (Mdevcon 2014)
My Android is not an iPhone like any others (Mdevcon 2014)My Android is not an iPhone like any others (Mdevcon 2014)
My Android is not an iPhone like any others (Mdevcon 2014)
jeromevdl
 
DroidconUK 2013 : Beef up android apps with java tools
DroidconUK 2013 : Beef up android apps with java toolsDroidconUK 2013 : Beef up android apps with java tools
DroidconUK 2013 : Beef up android apps with java tools
jeromevdl
 
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
jeromevdl
 
Devoxx France 2013 : Musclez vos apps android avec les outils du monde java
Devoxx France 2013 : Musclez vos apps android avec les outils du monde javaDevoxx France 2013 : Musclez vos apps android avec les outils du monde java
Devoxx France 2013 : Musclez vos apps android avec les outils du monde java
jeromevdl
 
Jug Lausanne Android Janvier2013
Jug Lausanne Android Janvier2013Jug Lausanne Android Janvier2013
Jug Lausanne Android Janvier2013
jeromevdl
 
Metroide
MetroideMetroide
Metroide
jeromevdl
 

More from jeromevdl (12)

Do more with less code in a serverless world
Do more with less code in a serverless worldDo more with less code in a serverless world
Do more with less code in a serverless world
 
DevopsDays Geneva 2020 - Compliance & Governance as Code
DevopsDays Geneva 2020 - Compliance & Governance as CodeDevopsDays Geneva 2020 - Compliance & Governance as Code
DevopsDays Geneva 2020 - Compliance & Governance as Code
 
Softshake 2017 - Développer un chatbot Alexa
Softshake 2017 - Développer un chatbot AlexaSoftshake 2017 - Développer un chatbot Alexa
Softshake 2017 - Développer un chatbot Alexa
 
Chatbots buzzword ou nouvel eldorado
Chatbots   buzzword ou nouvel eldoradoChatbots   buzzword ou nouvel eldorado
Chatbots buzzword ou nouvel eldorado
 
Management projet vs management produit
Management projet vs management produitManagement projet vs management produit
Management projet vs management produit
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applications
 
My Android is not an iPhone like any others (Mdevcon 2014)
My Android is not an iPhone like any others (Mdevcon 2014)My Android is not an iPhone like any others (Mdevcon 2014)
My Android is not an iPhone like any others (Mdevcon 2014)
 
DroidconUK 2013 : Beef up android apps with java tools
DroidconUK 2013 : Beef up android apps with java toolsDroidconUK 2013 : Beef up android apps with java tools
DroidconUK 2013 : Beef up android apps with java tools
 
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
 
Devoxx France 2013 : Musclez vos apps android avec les outils du monde java
Devoxx France 2013 : Musclez vos apps android avec les outils du monde javaDevoxx France 2013 : Musclez vos apps android avec les outils du monde java
Devoxx France 2013 : Musclez vos apps android avec les outils du monde java
 
Jug Lausanne Android Janvier2013
Jug Lausanne Android Janvier2013Jug Lausanne Android Janvier2013
Jug Lausanne Android Janvier2013
 
Metroide
MetroideMetroide
Metroide
 

Recently uploaded

Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Zilliz
 
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptxMAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
janagijoythi
 
Opencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of MünsterOpencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of Münster
Matthias Neugebauer
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
Jimmy Lai
 
The History of Embeddings & Multimodal Embeddings
The History of Embeddings & Multimodal EmbeddingsThe History of Embeddings & Multimodal Embeddings
The History of Embeddings & Multimodal Embeddings
Zilliz
 
Redefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI CapabilitiesRedefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI Capabilities
Priyanka Aash
 
Improving Learning Content Efficiency with Reusable Learning Content
Improving Learning Content Efficiency with Reusable Learning ContentImproving Learning Content Efficiency with Reusable Learning Content
Improving Learning Content Efficiency with Reusable Learning Content
Enterprise Knowledge
 
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
shanihomely
 
Retrieval Augmented Generation Evaluation with Ragas
Retrieval Augmented Generation Evaluation with RagasRetrieval Augmented Generation Evaluation with Ragas
Retrieval Augmented Generation Evaluation with Ragas
Zilliz
 
Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024
siddu769252
 
Communications Mining Series - Zero to Hero - Session 3
Communications Mining Series - Zero to Hero - Session 3Communications Mining Series - Zero to Hero - Session 3
Communications Mining Series - Zero to Hero - Session 3
DianaGray10
 
LeadMagnet IQ Review: Unlock the Secret to Effortless Traffic and Leads.pdf
LeadMagnet IQ Review:  Unlock the Secret to Effortless Traffic and Leads.pdfLeadMagnet IQ Review:  Unlock the Secret to Effortless Traffic and Leads.pdf
LeadMagnet IQ Review: Unlock the Secret to Effortless Traffic and Leads.pdf
SelfMade bd
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
Baishakhi Ray
 
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
FIDO Alliance
 
Finetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and DefendingFinetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and Defending
Priyanka Aash
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
bellared2
 
Uncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in LibrariesUncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in Libraries
Brian Pichman
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
SynapseIndia
 
Integrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecaseIntegrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecase
shyamraj55
 
Tailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer InsightsTailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer Insights
SynapseIndia
 

Recently uploaded (20)

Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...
 
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptxMAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
MAKE MONEY ONLINE Unlock Your Income Potential Today.pptx
 
Opencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of MünsterOpencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of Münster
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
 
The History of Embeddings & Multimodal Embeddings
The History of Embeddings & Multimodal EmbeddingsThe History of Embeddings & Multimodal Embeddings
The History of Embeddings & Multimodal Embeddings
 
Redefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI CapabilitiesRedefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI Capabilities
 
Improving Learning Content Efficiency with Reusable Learning Content
Improving Learning Content Efficiency with Reusable Learning ContentImproving Learning Content Efficiency with Reusable Learning Content
Improving Learning Content Efficiency with Reusable Learning Content
 
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
 
Retrieval Augmented Generation Evaluation with Ragas
Retrieval Augmented Generation Evaluation with RagasRetrieval Augmented Generation Evaluation with Ragas
Retrieval Augmented Generation Evaluation with Ragas
 
Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024Generative AI Reasoning Tech Talk - July 2024
Generative AI Reasoning Tech Talk - July 2024
 
Communications Mining Series - Zero to Hero - Session 3
Communications Mining Series - Zero to Hero - Session 3Communications Mining Series - Zero to Hero - Session 3
Communications Mining Series - Zero to Hero - Session 3
 
LeadMagnet IQ Review: Unlock the Secret to Effortless Traffic and Leads.pdf
LeadMagnet IQ Review:  Unlock the Secret to Effortless Traffic and Leads.pdfLeadMagnet IQ Review:  Unlock the Secret to Effortless Traffic and Leads.pdf
LeadMagnet IQ Review: Unlock the Secret to Effortless Traffic and Leads.pdf
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
 
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
 
Finetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and DefendingFinetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and Defending
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
 
Uncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in LibrariesUncharted Together- Navigating AI's New Frontiers in Libraries
Uncharted Together- Navigating AI's New Frontiers in Libraries
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
 
Integrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecaseIntegrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecase
 
Tailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer InsightsTailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer Insights
 

Do more with less code in serverless

  • 1. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Do more with less code in Serverless Jérôme Van Der Linden Solutions Architect AWS S V S 3 5 2 - G
  • 2. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Clean Code Single Responsibility Principle You Ain’t Gonna Need It Keep It Simple Stupid Agenda
  • 3. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Clean Code
  • 6. SOLID - Single Responsibility Principle YAGNI - You Ain’t Gonna Need It KISS - Keep it Simple Stupid Some clean code principles https://www.amazon.es/Wenger-19201-Navaja-suiza/dp/B000R0JDSI
  • 7. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Single Responsibility Principle
  • 8. Single Responsibility Principle Do’s Don’ts * - Input validation - Business logic - Transform data - Return result - Event/Input Filtering - Transport data - Orchestration & long transactions * Most of the time
  • 9. Single Responsibility Principle Do’s Don’ts * - Input validation - Business logic - Transform data - Return result - Event/Input Filtering - Transport data - Orchestration & long transactions * Most of the time
  • 10. Serverless is not only AWS Lambda COMPUTE DATA STORES INTEGRATION Amazon DynamoDB Amazon Aurora Serverless Amazon S3 AWS Lambda AWS Fargate Amazon EventBridge Amazon API Gateway Amazon SQS Amazon SNS AWS AppSync AWS Step Functions
  • 11. Event Filtering – the wrong way SNS Topic Publisher if event_type == 'order_created’: lambda_client.invoke('OrderCreation', ...) elif event_type == 'order_placed’: lambda_client.invoke('OrderPlacement', ...) elif event_type == 'order_cancelled’: lambda_client.invoke('OrderCancelation', ...) OrderCreation OrderPlacement OrderCancellation { "event_type": "order_placed", "order": { "id": "232134", "amount": "2341,45", "stock_ref": "AMZN” } } 𝝺 function code Input event OrderFiltering
  • 12. Event Filtering with Amazon SNS SNS Topic Publisher OrderCreation OrderPlacement OrderCancellation OrderCreationEvent: Type: AWS::SNS::Subscription Properties: TopicArn: 'arn:aws:sns:eu-central-1:123456789:OrdersTopic' Protocol: lambda Endpoint: 'arn:aws:lambda:eu-central-1:123456789:function:OrderCreation' FilterPolicy: event_type: - order_created { "event_type": [ "order_created" ] } Filter policyCloudformation template https://docs.aws.amazon.com/sns/latest/dg/sns-subscription-filter-policies.html
  • 13. Event Filtering with Amazon EventBridge https://docs.aws.amazon.com/eventbridge/latest/userguide/content-filtering-with-event-patterns.html { "Source": "custom.myOrderapp", "EventBusName": "default", "DetailType": "order", "Time": "Wed Jan 29 2020 08:03:18 GMT-0500", "Detail":{ "event_type": "order_created", "order": { "id": "232134", "amount": "2341.45", "stock_ref": "AMZN", "quantity": "3", "result": "approved" } } } EventBridge Event Bus Rules Targets { "source": [ "custom.myOrderapp" ], "detail-type": [ "order" ], "detail": { "event_type": [ "order_created" ], "amount": [ { "numeric": [ ">", 2000 ] } ], "result": [ "approved" ] } }
  • 14. Orchestration – the wrong way invoke invokeif (… ) invoke // else if (success) Notify with SNS n * invoke if (failure) Enqueue error notify with SNS need approval App…
  • 15. Simple orchestration with Lambda destinations invoke invokeif (… ) invoke // else if (success) Notify with SNS n * invoke if (failure) Enqueue error notify with SNS need approval App… Lambda Destinations https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations
  • 16. Simple orchestration with Lambda destinations Amazon SNS Amazon EventBridge Amazon Cloudwatch Logs Amazon S3 Amazon SES AWS Config Amazon CloudFormation AWS CodeCommit A S Y N C "DestinationConfig": { "onSuccess": { "Destination": "arn:aws:sns:..." }, "onFailure": { "Destination": "arn:aws:sqs:..." } } Cloudformation template Amazon SNS Amazon EventBridge Amazon SQS AWS Lambda if success: return {...} else: raise Exception(‘Failure', {...}) 𝝺 function code Lambda function A S Y N C
  • 17. Advanced orchestration with AWS Step Functions invoke invokeif (… ) invoke // else if (success) Notify with SNS n * invoke if (failure) Enqueue error notify with SNS need approval App… https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html
  • 18. { "StartAt": "SimpleInvocation", "States": { "SimpleInvocation": { "Type": "Task", "Resource": "arn:aws:lambda:eu-central-1:123456789 "Next": "Choose1or2" }, "Choose1or2": { "Type": "Choice", "Choices": [ { "Variable": "$.foo", "NumericEquals": 1, "Next": "Lambda1" }, { "Variable": "$.foo", "NumericEquals": 2, "Next": "ParallelInvocation" } ], "Default": "Unmatched" }, "Lambda1": { "Type": "Task", "Resource": "arn:aws:lambda:eu-central-1:123456789 Advanced orchestration with AWS Step Functions
  • 19. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. You Ain’t Gonna Need It
  • 20. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. "No server is easier to manage than 'no server' " Werner Vogels VP & CTO Amazon.com
  • 21. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. "No function is easier to manage than 'no function' " Me Solutions Architect AWS
  • 23. Common serverless architecture Amazon API Gateway Amazon DynamoDB AWS Lambda
  • 24. Common serverless architecture Amazon API Gateway Amazon DynamoDB AWS Lambda // Validate input // CRUD // (return)
  • 26. Amazon API Gateway Service Proxy Amazon API Gateway Amazon DynamoDB https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-aws-proxy.html
  • 27. Amazon API Gateway Service Proxy Amazon API Gateway Amazon DynamoDB https://velocity.apache.org/engine/devel/vtl-reference.html
  • 28. Amazon API Gateway Request Validation https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html Amazon API Gateway Amazon DynamoDB
  • 29. Amazon API Gateway Request Validation https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html Amazon API Gateway Amazon DynamoDB
  • 32. AWS Step Functions integrations AWS Lambda AWS Batch Amazon DynamoDB Amazon ECS / Fargate Amazon EMR AWS Glue Amazon SageMaker Amazon SNS Amazon SQS AWS Step Functions AWS CodeBuild https://docs.aws.amazon.com/step-functions/latest/dg/concepts-service-integrations.html
  • 33. AWS Step Functions integrations "QueueError": { "Type": "Task", "Resource": "arn:aws:states:::sqs:sendMessage", "Parameters": { "QueueUrl": "https://sqs.eu-central-1.amazonaws.com/123456789012/myQueue", "MessageBody.$": "$.input.message" }, "End": true }, "SendNotification": { "Type": "Task", "Resource": "arn:aws:states:::sns:publish", "Parameters": { "TopicARN": "arn:aws:sns:eu-central- 1:123456789012:myTopic", "Subject": "Lambda1 has successfully finish its job", "Message.$" : "$.input.message" }, "End": true }, SQS SNS
  • 34. Amazon EventBridge integrations https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-targets.html EventBridge Event Bus Rules Targets AWS Batch Amazon EC2 Instance Amazon ECS Task AWS Step Functions Amazon SNS Amazon SQS Amazon Kinesis Data Streams Amazon Kinesis Data Firehose Amazon EventBridge AWS CodeBuild AWS CodePipeline Amazon API Gateway SSM Run Command SSM Automation Amazon Redshift
  • 35. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Keep it Simple Stupid aka Conclusion
  • 36. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” Tony Hoare Former Professor at Oxford
  • 37. Keep it Simple Simpler functions = Easier to test and maintain Faster to start: less cold start More scalable: higher throughput More secure: less permission needed
  • 38. Keep your 𝝺 code focused on the business Keep it Stupid Business code is the clever part of the function Orchestration is not the responsibility of a 𝝺 Clever
  • 39. Keep it… or leave it 𝝺 is not always needed You can save costs and optimize performance when functions are just passthrough or mapping
  • 40. Thank you! © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Jérôme Van Der Linden AWS Solutions Architect
  • 41. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.