SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
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
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

Mais conteúdo relacionado

Mais procurados

Serverless Systems: The Future is Here
Serverless Systems: The Future is HereServerless Systems: The Future is Here
Serverless Systems: The Future is Heregedoplan
 
Azure functions
Azure functionsAzure functions
Azure functionsvivek 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 FunctionsAndreas Willich
 
Container Management with Amazon ECS
Container Management with Amazon ECSContainer Management with Amazon ECS
Container Management with Amazon ECSAWS Germany
 
Intro To Serverless ClojureScript
Intro To Serverless ClojureScriptIntro To Serverless ClojureScript
Intro To Serverless ClojureScriptJim 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 AWSAWS 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 DockerRightScale
 
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 AWSAWS Vietnam Community
 
Stacktician - CloudStack Collab Conference 2014
Stacktician - CloudStack Collab Conference 2014Stacktician - CloudStack Collab Conference 2014
Stacktician - CloudStack Collab Conference 2014amoghvk
 
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-servicesChristian 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 AWSSuresh 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 2015Michael Villis
 

Mais procurados (20)

Serverless Patterns
Serverless PatternsServerless Patterns
Serverless Patterns
 
Serverless Systems: The Future is Here
Serverless Systems: The Future is HereServerless Systems: The Future is Here
Serverless Systems: The Future is Here
 
Azure functions
Azure functionsAzure functions
Azure functions
 
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...
 
Serverless with Azure Functions
Serverless with Azure FunctionsServerless with Azure Functions
Serverless with Azure Functions
 
Container Management with Amazon ECS
Container Management with Amazon ECSContainer Management with Amazon ECS
Container Management with Amazon ECS
 
Campus days Azure HDInsight automation
Campus days Azure HDInsight automationCampus days Azure HDInsight automation
Campus days Azure HDInsight automation
 
Intro To Serverless ClojureScript
Intro To Serverless ClojureScriptIntro To Serverless ClojureScript
Intro To Serverless ClojureScript
 
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
 
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...
 
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
 
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
 
Stacktician - CloudStack Collab Conference 2014
Stacktician - CloudStack Collab Conference 2014Stacktician - CloudStack Collab Conference 2014
Stacktician - CloudStack Collab Conference 2014
 
Containerization: The DevOps Revolution
Containerization: The DevOps Revolution Containerization: The DevOps Revolution
Containerization: The DevOps Revolution
 
Fuse integration-services
Fuse integration-servicesFuse integration-services
Fuse integration-services
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
Accelerating DevOps Pipelines with AWS
Accelerating DevOps Pipelines with AWSAccelerating DevOps Pipelines with AWS
Accelerating DevOps Pipelines with AWS
 
Inrastructure as Code
Inrastructure as CodeInrastructure as Code
Inrastructure as Code
 
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)
 
Brisbane DevOps Meetup - Reinvent 2015
Brisbane DevOps Meetup - Reinvent 2015Brisbane DevOps Meetup - Reinvent 2015
Brisbane DevOps Meetup - Reinvent 2015
 

Semelhante a NDev Talk - Serverless Design Patterns

從劍宗到氣宗 - 談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 infrastructureVille Seppänen
 
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)Amazon Web Services
 
Going serverless with aws
Going serverless with awsGoing serverless with aws
Going serverless with awsAlex Landa
 
Application Lifecycle Management on AWS
Application Lifecycle Management on AWSApplication Lifecycle Management on AWS
Application Lifecycle Management on AWSDavid 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 workloadsTensult
 
Deep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
Deep Dive on AWS Lambda - January 2017 AWS Online Tech TalksDeep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
Deep Dive on AWS Lambda - January 2017 AWS Online Tech TalksAmazon Web Services
 
Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...
 Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T... Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...
Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...Amazon Web Services
 
Introduction To Serverless Architecture
Introduction To Serverless ArchitectureIntroduction To Serverless Architecture
Introduction To Serverless ArchitectureBen 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 2013aspyker
 
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 GlueMichael 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 MeetupBoaz Ziniman
 
From Serverless to InterCloud
From Serverless to InterCloudFrom Serverless to InterCloud
From Serverless to InterCloudWayne Scarano
 
Cloud Native Camel Riding
Cloud Native Camel RidingCloud Native Camel Riding
Cloud Native Camel RidingChristian Posta
 

Semelhante a NDev Talk - Serverless Design Patterns (20)

從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
 
Journey towards serverless infrastructure
Journey towards serverless infrastructureJourney towards serverless infrastructure
Journey towards serverless infrastructure
 
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
 
Going serverless with aws
Going serverless with awsGoing serverless with aws
Going serverless with aws
 
What is Serverless Computing?
What is Serverless Computing?What is Serverless Computing?
What is Serverless Computing?
 
Application Lifecycle Management on AWS
Application Lifecycle Management on AWSApplication Lifecycle Management on AWS
Application Lifecycle Management on AWS
 
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
 
Deep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
Deep Dive on AWS Lambda - January 2017 AWS Online Tech TalksDeep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
Deep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
 
Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...
 Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T... Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...
Getting Started with AWS Lambda and the Serverless Cloud - AWS Summit Cape T...
 
Introduction To Serverless Architecture
Introduction To Serverless ArchitectureIntroduction To Serverless Architecture
Introduction To Serverless Architecture
 
Serverless without Code (Lambda)
Serverless without Code (Lambda)Serverless without Code (Lambda)
Serverless without Code (Lambda)
 
AWS Lambda and Serverless Cloud
AWS Lambda and Serverless CloudAWS Lambda and Serverless Cloud
AWS Lambda and Serverless Cloud
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013
 
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
 
PaaS with Java
PaaS with JavaPaaS with Java
PaaS with Java
 
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
 
Best of re:Invent
Best of re:InventBest of re:Invent
Best of re:Invent
 
Windows Azure introduction
Windows Azure introductionWindows Azure introduction
Windows Azure introduction
 
From Serverless to InterCloud
From Serverless to InterCloudFrom Serverless to InterCloud
From Serverless to InterCloud
 
Cloud Native Camel Riding
Cloud Native Camel RidingCloud Native Camel Riding
Cloud Native Camel Riding
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Último (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

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
  • 3.
  • 4.
  • 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 git@github.com: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)