SlideShare a Scribd company logo
Serverless Design Patterns
NDev Meetup 11/2018
Intro
• Currently freelance software
engineer and architect

• Former AWS

• API Gateway, Lambda

• Prev: Verafin, D2L

• MUN Comp Eng 2007
NDev Talk - Serverless Design Patterns
NDev Talk - Serverless Design Patterns
Building with serverless is
awesome and easy!
… but awkward at first
A Brief History of Cloud
Compute…
• Pre-2008: The dark ages: on-prem, hardware, VMWare

• 2008: VMs on EC2 (IaaS)

• 2011: Elastic Beanstalk (PaaS)

• 2014: AWS Lambda (BaaS, FaaS)

• 2015: Elastic Container Service

• 2017: Fargate, EKS

• 2018+: ??? (Re:Invent is tomorrow!)
Serverless?
• What does it even mean?

• Generally accepted properties:

• Uses fully-managed cloud services

• Pay-per-use (i.e. request). “Don’t pay for idle”

• Auto-scales

• Servers/hardware/OS, and potentially
runtimes, are abstracted

• Concept predates the term (2014)

• i.e. S3 (2006) meets the definition of
serverless
FaaS
• (Stateless) Functions as a Service

• AWS Lambda

• Azure Functions

• Google Cloud Functions

• Auth0 WebTask

• etc.
Other serverless services
• AWS

• S3

• DynamoDB*

• Cognito

• API Gateway

• Aurora

• …
Use-cases
• Respond to events

• i.e. drop an image in S3, automatically generate a thumbnail using
Lambda

• Event sources on AWS: DynamoDB, Kinesis, SQS, S3, Cloudwatch
Events, API Gateway, etc.

• Web/mobile application backend

• REST/GraphQL API fronted by API Gateway/AppSync

• Can reuse ExpressJS, Jersey/Spring/Spark, Flask, etc.

• IoT backend
Use-cases
• Stream processing

• i.e. clickstreams, logs, event sourcing, etc.

• Kinesis, Kafka, etc.

• Edge computing

• CDN, Lambda@Edge i.e. re-write routing or caching rules at runtime based on user request.

• Greengrass

• Workflows

• Step Functions

• Scheduled processing

• CloudWatch events

• Alexa Apps
Advantages
• Automatic scaling

• Good for bursty workloads

• VMs and containers generally have very low utilization

• Automatic multi-zone redundancy for high-availability

• “Secure by default”

• Faster time and lower cost to market. Easy to do cheap
experiments
Advantages
• Cost 

• Pay per 100ms. Free tier. Don’t pay for idle

• Simplicity

• Don't have to manage hardware, OS, patches, etc.

• Developers focus on business logic, not infra. Don’t
need “DevOps” team

• Less infra: no load balancers, VPCs, security groups, etc
Disadvantages
• Cold starts

• Not ideal for highly latency-sensitive use-cases (i.e. p99+)

• More $ at scale 

• Dev/test

• Debugging and distributed tracing

• Impedance mismatch with web server frameworks

• Large batch processing: handling of large files or long-running processes 

• Lambda 15 min timeout

• Lambda 500MB scratch disk

• If workload can’t be partitioned or made into a workflow
https://mikhail.io
Patterns
• I want to host a website “serverlessly”

• Static assets/JS hosted in S3
bucket

• CDN and edge cache provided by
CloudFront

• Custom domain name tied to
CloudFront distribution

• HTTPS certificate for TLS
Patterns
• I want to host a backend for a web or mobile
application “serverlessly”

• API Gateway for REST API backend over
HTTPS

• Lambda for backend implementation

• Can use existing server-side HTTP
frameworks: Express/Jersey/Spring/Flask/
etc.

• Cognito for AuthN/AuthZ

• Datastore in DynamoDB, Aurora, RDS, custom,
etc.

• See also: AWS AppSync, Mobile BaaS
Patterns
• I want to process a stream of events or messages
“serverlessly”

• Event stream using Kinesis, SQS, DynamoDB
streams, Kafka, etc.

• Potentially many producers, consumers

• Event listener implemented in Lambda

• Automatically invoked with batches of events
(configurable)

• “Fan out”: invoke a separate function, or
multiple functions, per event

• Event-sourcing, “databases as cattle”, “turning the
database inside out”

• Dead Letter Queue for failures (SQS)
Patterns
• I want to execute a scheduled job “serverlessly”

• i.e. “serverless” cron job. Good for background
processing, asynchronous workflows

• Job implemented in AWS Lambda

• CloudWatch Event trigger with cron expression
Patterns
• I want to execute a complex workflow “serverlessly”

• Workflow defined in Step Functions

• State machine loops/conditions/retries/etc.

• Can include human intervention

• Can run for up to a year

• Workflow tasks implemented in AWS Lambda

• Example: https://aws.amazon.com/blogs/
compute/implementing-canary-deployments-of-
aws-lambda-functions-with-alias-traffic-shifting/
Patterns
• Adoption patterns

• New services built using serverless

• Async components outside of critical path

• Lift-and-shift entire application into Lambda
Tools
• Deployment

• AWS CLI/SDK

• SAM

• SAM Local

• Serverless

• Apex

• Chalice (Python)

• Zappa
• Test/debug

• XUnit

• SAM Local

• Tracing

• X-Ray

• Libraries

• aws-serverless-express 

• JS/Node/Express

• aws-serverless-java-container 

• Java/Jersey/Spring

• aws-lambda-go

• Golang
Demo
• Facebook Live “Like” button clone

• Patterns used

• Static web application

• Web application backend / REST API / microservice

• Stream processing

• Scheduled asynchronous processing

• Fully “infrastructure as code”, defined in SAM
Demo
Live App: https://goo.gl/9GY89C
Demo
$ git clone git@github.com:rpgreen/ndevdemo.git
Future
• Composable apps (Serverless Application Repository)

• Composable functions

• Custom agents and runtimes

• Serverless containers (Fargate)

• Less containers in general, far less VMs

• More framework support for FaaS 

• Better tooling

• Cold start minimization

• NoCode (i.e. AppSync)
Thanks!
@ryangtweets 

https://ryang.ca 

ryang@ryang.ca
Ad

More Related Content

What's hot (20)

Serverless Patterns
Serverless PatternsServerless Patterns
Serverless Patterns
Cliff Chao-kuan Lu
 
Serverless Systems: The Future is Here
Serverless Systems: The Future is HereServerless Systems: The Future is Here
Serverless Systems: The Future is Here
gedoplan
 
Azure functions
Azure functionsAzure functions
Azure functions
vivek p s
 
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
DataArt
 
Serverless with Azure Functions
Serverless with Azure FunctionsServerless with Azure Functions
Serverless with Azure Functions
Andreas Willich
 
Container Management with Amazon ECS
Container Management with Amazon ECSContainer Management with Amazon ECS
Container Management with Amazon ECS
AWS Germany
 
Campus days Azure HDInsight automation
Campus days Azure HDInsight automationCampus days Azure HDInsight automation
Campus days Azure HDInsight automation
Kenneth Michael Nielsen
 
Intro To Serverless ClojureScript
Intro To Serverless ClojureScriptIntro To Serverless ClojureScript
Intro To Serverless ClojureScript
Jim Lynch
 
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSCloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
AWS Vietnam Community
 
Switching SaaS Hosting From dedicated virtual machines to container-based clu...
Switching SaaS Hosting From dedicated virtual machines to container-based clu...Switching SaaS Hosting From dedicated virtual machines to container-based clu...
Switching SaaS Hosting From dedicated virtual machines to container-based clu...
AWS Germany
 
Project Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerProject Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on Docker
RightScale
 
Meetup #3: Migrate a fast scale system to AWS
Meetup #3: Migrate a fast scale system to AWSMeetup #3: Migrate a fast scale system to AWS
Meetup #3: Migrate a fast scale system to AWS
AWS Vietnam Community
 
Stacktician - CloudStack Collab Conference 2014
Stacktician - CloudStack Collab Conference 2014Stacktician - CloudStack Collab Conference 2014
Stacktician - CloudStack Collab Conference 2014
amoghvk
 
Containerization: The DevOps Revolution
Containerization: The DevOps Revolution Containerization: The DevOps Revolution
Containerization: The DevOps Revolution
SoftServe
 
Fuse integration-services
Fuse integration-servicesFuse integration-services
Fuse integration-services
Christian Posta
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
Yochay Kiriaty
 
Accelerating DevOps Pipelines with AWS
Accelerating DevOps Pipelines with AWSAccelerating DevOps Pipelines with AWS
Accelerating DevOps Pipelines with AWS
Suresh Paulraj
 
Inrastructure as Code
Inrastructure as CodeInrastructure as Code
Inrastructure as Code
Charles Anderson
 
Python in the Serverless Era (PyCon IL 2016)
Python in the Serverless Era (PyCon IL 2016)Python in the Serverless Era (PyCon IL 2016)
Python in the Serverless Era (PyCon IL 2016)
Benny Bauer
 
Brisbane DevOps Meetup - Reinvent 2015
Brisbane DevOps Meetup - Reinvent 2015Brisbane DevOps Meetup - Reinvent 2015
Brisbane DevOps Meetup - Reinvent 2015
Michael Villis
 
Serverless Systems: The Future is Here
Serverless Systems: The Future is HereServerless Systems: The Future is Here
Serverless Systems: The Future is Here
gedoplan
 
Azure functions
Azure functionsAzure functions
Azure functions
vivek p s
 
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
DataArt
 
Serverless with Azure Functions
Serverless with Azure FunctionsServerless with Azure Functions
Serverless with Azure Functions
Andreas Willich
 
Container Management with Amazon ECS
Container Management with Amazon ECSContainer Management with Amazon ECS
Container Management with Amazon ECS
AWS Germany
 
Intro To Serverless ClojureScript
Intro To Serverless ClojureScriptIntro To Serverless ClojureScript
Intro To Serverless ClojureScript
Jim Lynch
 
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSCloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
AWS Vietnam Community
 
Switching SaaS Hosting From dedicated virtual machines to container-based clu...
Switching SaaS Hosting From dedicated virtual machines to container-based clu...Switching SaaS Hosting From dedicated virtual machines to container-based clu...
Switching SaaS Hosting From dedicated virtual machines to container-based clu...
AWS Germany
 
Project Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerProject Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on Docker
RightScale
 
Meetup #3: Migrate a fast scale system to AWS
Meetup #3: Migrate a fast scale system to AWSMeetup #3: Migrate a fast scale system to AWS
Meetup #3: Migrate a fast scale system to AWS
AWS Vietnam Community
 
Stacktician - CloudStack Collab Conference 2014
Stacktician - CloudStack Collab Conference 2014Stacktician - CloudStack Collab Conference 2014
Stacktician - CloudStack Collab Conference 2014
amoghvk
 
Containerization: The DevOps Revolution
Containerization: The DevOps Revolution Containerization: The DevOps Revolution
Containerization: The DevOps Revolution
SoftServe
 
Fuse integration-services
Fuse integration-servicesFuse integration-services
Fuse integration-services
Christian Posta
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
Yochay Kiriaty
 
Accelerating DevOps Pipelines with AWS
Accelerating DevOps Pipelines with AWSAccelerating DevOps Pipelines with AWS
Accelerating DevOps Pipelines with AWS
Suresh Paulraj
 
Python in the Serverless Era (PyCon IL 2016)
Python in the Serverless Era (PyCon IL 2016)Python in the Serverless Era (PyCon IL 2016)
Python in the Serverless Era (PyCon IL 2016)
Benny Bauer
 
Brisbane DevOps Meetup - Reinvent 2015
Brisbane DevOps Meetup - Reinvent 2015Brisbane DevOps Meetup - Reinvent 2015
Brisbane DevOps Meetup - Reinvent 2015
Michael Villis
 

Similar to NDev Talk - Serverless Design Patterns (20)

從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
Pahud Hsieh
 
Journey towards serverless infrastructure
Journey towards serverless infrastructureJourney towards serverless infrastructure
Journey towards serverless infrastructure
Ville Seppänen
 
Going serverless with aws
Going serverless with awsGoing serverless with aws
Going serverless with aws
Alex Landa
 
What is Serverless Computing?
What is Serverless Computing?What is Serverless Computing?
What is Serverless Computing?
AIMDek Technologies
 
Application Lifecycle Management on AWS
Application Lifecycle Management on AWSApplication Lifecycle Management on AWS
Application Lifecycle Management on AWS
David Mat
 
Serverless design considerations for Cloud Native workloads
Serverless design considerations for Cloud Native workloadsServerless design considerations for Cloud Native workloads
Serverless design considerations for Cloud Native workloads
Tensult
 
Introduction To Serverless Architecture
Introduction To Serverless ArchitectureIntroduction To Serverless Architecture
Introduction To Serverless Architecture
Ben Sherman
 
Serverless without Code (Lambda)
Serverless without Code (Lambda)Serverless without Code (Lambda)
Serverless without Code (Lambda)
CloudHesive
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013
aspyker
 
Going Serverless - an Introduction to AWS Glue
Going Serverless - an Introduction to AWS GlueGoing Serverless - an Introduction to AWS Glue
Going Serverless - an Introduction to AWS Glue
Michael Rainey
 
PaaS with Java
PaaS with JavaPaaS with Java
PaaS with Java
Eberhard Wolff
 
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds MeetupIntroducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Boaz Ziniman
 
Windows Azure introduction
Windows Azure introductionWindows Azure introduction
Windows Azure introduction
Microsoft Iceland
 
From Serverless to InterCloud
From Serverless to InterCloudFrom Serverless to InterCloud
From Serverless to InterCloud
Wayne Scarano
 
Cloud Native Camel Riding
Cloud Native Camel RidingCloud Native Camel Riding
Cloud Native Camel Riding
Christian Posta
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Emerson Eduardo Rodrigues Von Staffen
 
Dave Nielsen - the economically unstoppable cloud
Dave Nielsen - the economically unstoppable cloudDave Nielsen - the economically unstoppable cloud
Dave Nielsen - the economically unstoppable cloud
Olga Lavrentieva
 
Amazon Webservices for Java Developers - UCI Webinar
Amazon Webservices for Java Developers - UCI WebinarAmazon Webservices for Java Developers - UCI Webinar
Amazon Webservices for Java Developers - UCI Webinar
Craig Dickson
 
Serverless brewbox
Serverless   brewboxServerless   brewbox
Serverless brewbox
Lino Telera
 
Developing serverless applications with .NET on AWS
Developing serverless applications with .NET on AWSDeveloping serverless applications with .NET on AWS
Developing serverless applications with .NET on AWS
Woody Pewitt
 
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
Pahud Hsieh
 
Journey towards serverless infrastructure
Journey towards serverless infrastructureJourney towards serverless infrastructure
Journey towards serverless infrastructure
Ville Seppänen
 
Going serverless with aws
Going serverless with awsGoing serverless with aws
Going serverless with aws
Alex Landa
 
Application Lifecycle Management on AWS
Application Lifecycle Management on AWSApplication Lifecycle Management on AWS
Application Lifecycle Management on AWS
David Mat
 
Serverless design considerations for Cloud Native workloads
Serverless design considerations for Cloud Native workloadsServerless design considerations for Cloud Native workloads
Serverless design considerations for Cloud Native workloads
Tensult
 
Introduction To Serverless Architecture
Introduction To Serverless ArchitectureIntroduction To Serverless Architecture
Introduction To Serverless Architecture
Ben Sherman
 
Serverless without Code (Lambda)
Serverless without Code (Lambda)Serverless without Code (Lambda)
Serverless without Code (Lambda)
CloudHesive
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013
aspyker
 
Going Serverless - an Introduction to AWS Glue
Going Serverless - an Introduction to AWS GlueGoing Serverless - an Introduction to AWS Glue
Going Serverless - an Introduction to AWS Glue
Michael Rainey
 
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds MeetupIntroducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Boaz Ziniman
 
From Serverless to InterCloud
From Serverless to InterCloudFrom Serverless to InterCloud
From Serverless to InterCloud
Wayne Scarano
 
Cloud Native Camel Riding
Cloud Native Camel RidingCloud Native Camel Riding
Cloud Native Camel Riding
Christian Posta
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Emerson Eduardo Rodrigues Von Staffen
 
Dave Nielsen - the economically unstoppable cloud
Dave Nielsen - the economically unstoppable cloudDave Nielsen - the economically unstoppable cloud
Dave Nielsen - the economically unstoppable cloud
Olga Lavrentieva
 
Amazon Webservices for Java Developers - UCI Webinar
Amazon Webservices for Java Developers - UCI WebinarAmazon Webservices for Java Developers - UCI Webinar
Amazon Webservices for Java Developers - UCI Webinar
Craig Dickson
 
Serverless brewbox
Serverless   brewboxServerless   brewbox
Serverless brewbox
Lino Telera
 
Developing serverless applications with .NET on AWS
Developing serverless applications with .NET on AWSDeveloping serverless applications with .NET on AWS
Developing serverless applications with .NET on AWS
Woody Pewitt
 
Ad

Recently uploaded (20)

Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Ad

NDev Talk - Serverless Design Patterns

  • 2. Intro • Currently freelance software engineer and architect • Former AWS • API Gateway, Lambda • Prev: Verafin, D2L • MUN Comp Eng 2007
  • 5. Building with serverless is awesome and easy! … but awkward at first
  • 6. A Brief History of Cloud Compute… • Pre-2008: The dark ages: on-prem, hardware, VMWare • 2008: VMs on EC2 (IaaS) • 2011: Elastic Beanstalk (PaaS) • 2014: AWS Lambda (BaaS, FaaS) • 2015: Elastic Container Service • 2017: Fargate, EKS • 2018+: ??? (Re:Invent is tomorrow!)
  • 7. Serverless? • What does it even mean? • Generally accepted properties: • Uses fully-managed cloud services • Pay-per-use (i.e. request). “Don’t pay for idle” • Auto-scales • Servers/hardware/OS, and potentially runtimes, are abstracted • Concept predates the term (2014) • i.e. S3 (2006) meets the definition of serverless
  • 8. FaaS • (Stateless) Functions as a Service • AWS Lambda • Azure Functions • Google Cloud Functions • Auth0 WebTask • etc.
  • 9. Other serverless services • AWS • S3 • DynamoDB* • Cognito • API Gateway • Aurora • …
  • 10. Use-cases • Respond to events • i.e. drop an image in S3, automatically generate a thumbnail using Lambda • Event sources on AWS: DynamoDB, Kinesis, SQS, S3, Cloudwatch Events, API Gateway, etc. • Web/mobile application backend • REST/GraphQL API fronted by API Gateway/AppSync • Can reuse ExpressJS, Jersey/Spring/Spark, Flask, etc. • IoT backend
  • 11. Use-cases • Stream processing • i.e. clickstreams, logs, event sourcing, etc. • Kinesis, Kafka, etc. • Edge computing • CDN, Lambda@Edge i.e. re-write routing or caching rules at runtime based on user request. • Greengrass • Workflows • Step Functions • Scheduled processing • CloudWatch events • Alexa Apps
  • 12. Advantages • Automatic scaling • Good for bursty workloads • VMs and containers generally have very low utilization • Automatic multi-zone redundancy for high-availability • “Secure by default” • Faster time and lower cost to market. Easy to do cheap experiments
  • 13. Advantages • Cost • Pay per 100ms. Free tier. Don’t pay for idle • Simplicity • Don't have to manage hardware, OS, patches, etc. • Developers focus on business logic, not infra. Don’t need “DevOps” team • Less infra: no load balancers, VPCs, security groups, etc
  • 14. Disadvantages • Cold starts • Not ideal for highly latency-sensitive use-cases (i.e. p99+) • More $ at scale • Dev/test • Debugging and distributed tracing • Impedance mismatch with web server frameworks • Large batch processing: handling of large files or long-running processes • Lambda 15 min timeout • Lambda 500MB scratch disk • If workload can’t be partitioned or made into a workflow
  • 16. Patterns • I want to host a website “serverlessly” • Static assets/JS hosted in S3 bucket • CDN and edge cache provided by CloudFront • Custom domain name tied to CloudFront distribution • HTTPS certificate for TLS
  • 17. Patterns • I want to host a backend for a web or mobile application “serverlessly” • API Gateway for REST API backend over HTTPS • Lambda for backend implementation • Can use existing server-side HTTP frameworks: Express/Jersey/Spring/Flask/ etc. • Cognito for AuthN/AuthZ • Datastore in DynamoDB, Aurora, RDS, custom, etc. • See also: AWS AppSync, Mobile BaaS
  • 18. Patterns • I want to process a stream of events or messages “serverlessly” • Event stream using Kinesis, SQS, DynamoDB streams, Kafka, etc. • Potentially many producers, consumers • Event listener implemented in Lambda • Automatically invoked with batches of events (configurable) • “Fan out”: invoke a separate function, or multiple functions, per event • Event-sourcing, “databases as cattle”, “turning the database inside out” • Dead Letter Queue for failures (SQS)
  • 19. Patterns • I want to execute a scheduled job “serverlessly” • i.e. “serverless” cron job. Good for background processing, asynchronous workflows • Job implemented in AWS Lambda • CloudWatch Event trigger with cron expression
  • 20. Patterns • I want to execute a complex workflow “serverlessly” • Workflow defined in Step Functions • State machine loops/conditions/retries/etc. • Can include human intervention • Can run for up to a year • Workflow tasks implemented in AWS Lambda • Example: https://aws.amazon.com/blogs/ compute/implementing-canary-deployments-of- aws-lambda-functions-with-alias-traffic-shifting/
  • 21. Patterns • Adoption patterns • New services built using serverless • Async components outside of critical path • Lift-and-shift entire application into Lambda
  • 22. Tools • Deployment • AWS CLI/SDK • SAM • SAM Local • Serverless • Apex • Chalice (Python) • Zappa • Test/debug • XUnit • SAM Local • Tracing • X-Ray • Libraries • aws-serverless-express • JS/Node/Express • aws-serverless-java-container • Java/Jersey/Spring • aws-lambda-go • Golang
  • 23. Demo • Facebook Live “Like” button clone • Patterns used • Static web application • Web application backend / REST API / microservice • Stream processing • Scheduled asynchronous processing • Fully “infrastructure as code”, defined in SAM
  • 25. Demo $ git clone [email protected]:rpgreen/ndevdemo.git
  • 26. Future • Composable apps (Serverless Application Repository) • Composable functions • Custom agents and runtimes • Serverless containers (Fargate) • Less containers in general, far less VMs • More framework support for FaaS • Better tooling • Cold start minimization • NoCode (i.e. AppSync)