SlideShare ist ein Scribd-Unternehmen logo
1 von 53
Downloaden Sie, um offline zu lesen
Serverless URL Shortener
Serverless Brainpirlo
Luca Bianchi — Neosperience
github.com/aletheia
it.linkedin.com/in/lucabianchipavia
@bianchiluca
medium.com/@aletheia
Who am I?
• Chief Technology Officer @ Neosperience
• Working on a lot of bleeding edge technologies
• Passionate developer: love writing code, hate meetings
The Neosperience Cloud
• Software as a service cloud for Digital Customer Experience processes 

(Psychographics, Loyalty & Gamification, Proximity, Content, etc.)
• Built on AWS, 95% on Serverless technologies
• Moved from VMWare, to EC2, to Elastic Beanstalk, to Serverless
• Dozens of micro and nano services
The Digital Customer Experience Company, aims to change the way brands and
customers interact with an approach of a software vendor targeting Digital
Customer Experience as the evolution of Marketing automation.
Serverless Meetup
Began as a joke, after too many beers
456 members and growing
Hosted the first italian JeffConf 

(https://goo.gl/mqvnsR)
Monthly meetup
Events with other communities
Wants to build a network of 

serverless meetups
Serverless Meetup
meetup.com/serverless-italy
Call For Speakers!
clda.co/serverless-italy
Agenda
“Serverless” disclaimer
What is “Serverless”?
The Serverless Manifesto
Events, streams and triggers
Serverless development, tools and vendors
Use Case: your nightmare before Christmas
The good, the bad and the ugly of Serverless development
A point on Serverless architectures
A “Serverless” disclaimer
“There is always a server somewhere,

you just don't have to worry about it =)”
What is Serverless?
“Serverless architecture replaces long-running virtual machines with ephemeral compute
power that comes into existence on request and disappears immediately after use.
Use of this architecture can mitigate some security concerns such as security patching and
SSH access control, and can make much more efficient use of compute resources. These
systems cost very little to operate and can have inbuilt scaling features.”
— ThoughtWorks, 2016
The Serverless Manifesto
Function as the unit of deployment and scaling
Implicitly fault-tolerant
Metrics
No machines, VMs, or containers
Bring Your Own Code
Stateless
Never pay for idle
Scales per request
It all started with an event..
• events are a great way to decouple services
• largely abused in the last decade (ESB)
• now revamped with CQRS and Event Sourcing
to handle microservices communication
• serverless functions handle events
• need a different approach on architectures
AWS Lambda is a compute service that lets you run code without provisioning or managing servers. AWS Lambda
executes your code only when needed and scales automatically, from a few requests per day to thousands per
second.

Service released on Nov, 2014

Introduces Event-Driven programming model

Provides a context and an event object
AWS Lambda
Running a Lambda Function
Supported Languages
CloudFormation
Cloud Services become a part of your project
Infrastructure-as-code
A scripting language for the cloud
Defines AWS resources 

(Lambda, S3Buckets, DynamoTables, etc)
Manages resource lifecycle
Example: creating a DynamoDB Table
https://docs.aws.amazon.com/AWSCloudFormation/
latest/UserGuide/Welcome.html
Serverless
DEMO
AWS SAM
“Serverless Application Model”
What is AWS SAM?
github.com/awslabs/serverless-application-model
“The goal of AWS SAM is to define a
standard application model for
serverless applications.”
In other (technical) words?
AWS::Serverless Transform
(CloudFormation)
Special serverless resources
(e.g.
AWS::Serverless::Function)
Pretty similar to Serverless
Framework’s syntax (yaml)
Natively supported by AWS SAM
Local
(github.com/awslabs/aws-sam-local)
AWS SAM Example (Function)
(plus policies, VCP config, DLQ, tracing, etc.)
AWS SAM Example (Traffic Shifting)
(plus alarms & pre/post-traffic hooks)
AWS SAM Example (DynamoDB)
AWS SAM Example (API Gateway)
(plus cache, stage variables, etc.)
AWS SAM Example (Function+API)
My Personal “wishes” for AWS SAM
More transparency (make it public, or even customizable?)
Custom Transforms (endless possibilities!)
A Christmas Nightmare
It is the night before Christmas 

and you’re just leaving..
…then your manager steps into the office..
…with another great idea: 

an url-tracker!
your reaction…
IDEA: Make it Serverless!
Focus only on your code
No infrastructure to manage (your IT guy has a family, too)
Scales up to production requirements
Can be released within minutes
Use DynamoDB and GSI
Serverless does not mean spaghetti-code!
Serverless URL-Tracker
CODE
We did it!!
The good
Fast deployments
Serverless.yml makes things easy
Infrastructure versioning
Test environments
IAM permissions management
DynamoDB scales automatically
Serverless strips unwanted dependencies
A/B testing with Lambda is very easy
Progressive rollout are made possible with a single click
The bad
CloudFormation is not so easy to write
Not every service is scriptable
Support for 3rd party services is very bad
No Lambda lifecycle callbacks
Lambda cold start matters
No GPU support (yet)
Serverless Framework is not an AWS tool
The ugly
Lambda support is up to NodeJS 6.10
Maximum resorce limit up to 200
CloudFront distribution needs some tune-up
Communication between Lambdas is up to you
Download my profile
We did it!!
About architectures
About architectures
“Bad code haunts you for months…
..bad architectures harms you for decades.”
• In 2015 Tim Wagner, General Manager @ AWS Serverless Compute,
presented to the ServerlessConf the so-called Serverless Manifesto.
• In 2017 Danilo Poccia, Technical Evangelist @ AWS, talking at
JeffConf asked “what would be having that manifesto translated into a
checklist to evaluate Serverless compliance of an architecture?”
• So, we turned it into a “Serverless Scorecard”
Evaluating a serverless architecture
(aka how big is my serverless?)
The Serverless Scorecard
Function as the unit of deployment and scaling
Implicitly fault-tolerant
Metrics
No machines, VMs, or containers
Bring Your Own CodeStateless
Never pay for idleScales per request
An IDE for Serverless?
AWS Cloud9 Features
Full-fledged IDE & Dev tools
Cost-saving settings (hibernation)
Integrated web terminal *
(EC2 or SSH environment)
Built-in Lambda support
Live debugging capabilities
(only Node.js for now)
Collaborative coding/debugging
* No SSH keys or IAM
credentials to configure locally (!)
SAM-local integration
(local testing & deployments)
AWS Cloud9 Dev Tools
AWS CLI (1.11), sam-local (0.2.4)
git, gcc, c++, Docker (17.03)
node (6.11.4), npm, nvm, coffeescript
python (2.7.12 & 3.6.2), virtualenv, pip,
pylint, boto3
PHP (5.6), MySQL (14.14), Apache (2.4)
ruby (2.4.1), rails (5.1.4)
Go (1.9.1)
Java
docs.aws.amazon.com/cloud9/latest/user-guide/ami-contents.html
AWS Cloud9 Look&Feel
AWS Cloud9 Limitations & “wishes”
Max 20 env per user, 100 per account
Max 10 open env per user
Max 8 members in each env
EC2 instance maintenance is still
on you (OS updates, etc.)
No Python debugging 🐍
No “offline” support 📡
Only SAM-focused 🐿
Lacking AWS Console integration
“Primitive" Lambda testing ⚡
(e.g. no event generation)
One more thing…
http://bit.ly/sls-starter
One more thing…
starter-serverless-nodejs
slides @ http://bit.ly/sls-20180111
code @ https://github.com/waylon-ai/waylon-url-shortener

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Choosing the right messaging service for your serverless app [with lumigo]
Choosing the right messaging service for your serverless app [with lumigo]Choosing the right messaging service for your serverless app [with lumigo]
Choosing the right messaging service for your serverless app [with lumigo]
 
Convert Your Code into a Microservice using AWS Lambda
Convert Your Code into a Microservice using AWS LambdaConvert Your Code into a Microservice using AWS Lambda
Convert Your Code into a Microservice using AWS Lambda
 
Enterprise Serverless Adoption. An Experience Report
Enterprise Serverless Adoption. An Experience ReportEnterprise Serverless Adoption. An Experience Report
Enterprise Serverless Adoption. An Experience Report
 
To Serverless And Beyond!
To Serverless And Beyond!To Serverless And Beyond!
To Serverless And Beyond!
 
Application Lifecycle Management and Event Driven Programming on AWS
Application Lifecycle Management and Event Driven Programming on AWSApplication Lifecycle Management and Event Driven Programming on AWS
Application Lifecycle Management and Event Driven Programming on AWS
 
IoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
IoT and Serverless - AWS - Serverless Summit - Madhusudan ShekarIoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
IoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
 
Serverless Framework Intro
Serverless Framework IntroServerless Framework Intro
Serverless Framework Intro
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
 
Thinking Asynchronously Full Vesion - Utah UG
Thinking Asynchronously Full Vesion - Utah UGThinking Asynchronously Full Vesion - Utah UG
Thinking Asynchronously Full Vesion - Utah UG
 
TechDays 2017 - Going Serverless (2/2): Hands-on with Azure Event Grid
TechDays 2017 - Going Serverless (2/2): Hands-on with Azure Event GridTechDays 2017 - Going Serverless (2/2): Hands-on with Azure Event Grid
TechDays 2017 - Going Serverless (2/2): Hands-on with Azure Event Grid
 
AWS Lambda Containers - bridging the gap between serverless and containers on...
AWS Lambda Containers - bridging the gap between serverless and containers on...AWS Lambda Containers - bridging the gap between serverless and containers on...
AWS Lambda Containers - bridging the gap between serverless and containers on...
 
Serverless Computing Model
Serverless Computing ModelServerless Computing Model
Serverless Computing Model
 
Stop calling everything serverless!
Stop calling everything serverless!Stop calling everything serverless!
Stop calling everything serverless!
 
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
 
Workshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
Workshop : Wild Rydes Takes Off - The Dawn of a New UnicornWorkshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
Workshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
 
Dude, Where's my Server?
Dude, Where's my Server?Dude, Where's my Server?
Dude, Where's my Server?
 
Accelerating DevOps Pipelines with AWS
Accelerating DevOps Pipelines with AWSAccelerating DevOps Pipelines with AWS
Accelerating DevOps Pipelines with AWS
 
Serverless Systems: The Future is Here
Serverless Systems: The Future is HereServerless Systems: The Future is Here
Serverless Systems: The Future is Here
 
Building Serverless Web Applications - May 2017 AWS Online Tech Talks
Building Serverless Web Applications  - May 2017 AWS Online Tech TalksBuilding Serverless Web Applications  - May 2017 AWS Online Tech Talks
Building Serverless Web Applications - May 2017 AWS Online Tech Talks
 
AWS re:Invent 2016: How A Federal Agency Transformed Work and Adopted DevOps ...
AWS re:Invent 2016: How A Federal Agency Transformed Work and Adopted DevOps ...AWS re:Invent 2016: How A Federal Agency Transformed Work and Adopted DevOps ...
AWS re:Invent 2016: How A Federal Agency Transformed Work and Adopted DevOps ...
 

Ähnlich wie 20180111 we bde-bs - serverless url shortener

Ähnlich wie 20180111 we bde-bs - serverless url shortener (20)

Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
AWS Serverless Introduction (Lambda)
AWS Serverless Introduction (Lambda)AWS Serverless Introduction (Lambda)
AWS Serverless Introduction (Lambda)
 
Serverless Computing, AWS Way by SourceFuse Technologies
Serverless Computing, AWS Way by SourceFuse Technologies Serverless Computing, AWS Way by SourceFuse Technologies
Serverless Computing, AWS Way by SourceFuse Technologies
 
Serverless Computing, AWS Way: SourceFuse Technologies
Serverless Computing, AWS Way: SourceFuse Technologies Serverless Computing, AWS Way: SourceFuse Technologies
Serverless Computing, AWS Way: SourceFuse Technologies
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWS
 
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
 
AWS March 2016 Webinar Series Getting Started with Serverless Architectures
AWS March 2016 Webinar Series   Getting Started with Serverless ArchitecturesAWS March 2016 Webinar Series   Getting Started with Serverless Architectures
AWS March 2016 Webinar Series Getting Started with Serverless Architectures
 
Raleigh DevDay 2017: Build a serverless web application in one day workshop
Raleigh DevDay 2017: Build a serverless web application in one day workshopRaleigh DevDay 2017: Build a serverless web application in one day workshop
Raleigh DevDay 2017: Build a serverless web application in one day workshop
 
Primeros pasos con arquitecturas serverless
Primeros pasos con arquitecturas serverlessPrimeros pasos con arquitecturas serverless
Primeros pasos con arquitecturas serverless
 
Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?
 
AWS re:Invent 2016: The State of Serverless Computing (SVR311)
AWS re:Invent 2016: The State of Serverless Computing (SVR311)AWS re:Invent 2016: The State of Serverless Computing (SVR311)
AWS re:Invent 2016: The State of Serverless Computing (SVR311)
 
Serverless Meetup - Event Sourcing
Serverless Meetup - Event SourcingServerless Meetup - Event Sourcing
Serverless Meetup - Event Sourcing
 
SMC301 The State of Serverless Computing
SMC301 The State of Serverless ComputingSMC301 The State of Serverless Computing
SMC301 The State of Serverless Computing
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
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
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
The Changing Landscape of Development with AWS Cloud - AWS PS Summit Canberra...
The Changing Landscape of Development with AWS Cloud - AWS PS Summit Canberra...The Changing Landscape of Development with AWS Cloud - AWS PS Summit Canberra...
The Changing Landscape of Development with AWS Cloud - AWS PS Summit Canberra...
 

Kürzlich hochgeladen

%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Kürzlich hochgeladen (20)

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

20180111 we bde-bs - serverless url shortener

  • 1. Serverless URL Shortener Serverless Brainpirlo Luca Bianchi — Neosperience github.com/aletheia it.linkedin.com/in/lucabianchipavia @bianchiluca medium.com/@aletheia
  • 2. Who am I? • Chief Technology Officer @ Neosperience • Working on a lot of bleeding edge technologies • Passionate developer: love writing code, hate meetings The Neosperience Cloud • Software as a service cloud for Digital Customer Experience processes 
 (Psychographics, Loyalty & Gamification, Proximity, Content, etc.) • Built on AWS, 95% on Serverless technologies • Moved from VMWare, to EC2, to Elastic Beanstalk, to Serverless • Dozens of micro and nano services The Digital Customer Experience Company, aims to change the way brands and customers interact with an approach of a software vendor targeting Digital Customer Experience as the evolution of Marketing automation.
  • 3. Serverless Meetup Began as a joke, after too many beers 456 members and growing Hosted the first italian JeffConf 
 (https://goo.gl/mqvnsR) Monthly meetup Events with other communities Wants to build a network of 
 serverless meetups
  • 4. Serverless Meetup meetup.com/serverless-italy Call For Speakers! clda.co/serverless-italy
  • 5. Agenda “Serverless” disclaimer What is “Serverless”? The Serverless Manifesto Events, streams and triggers Serverless development, tools and vendors Use Case: your nightmare before Christmas The good, the bad and the ugly of Serverless development A point on Serverless architectures
  • 6.
  • 7. A “Serverless” disclaimer “There is always a server somewhere,
 you just don't have to worry about it =)”
  • 8. What is Serverless? “Serverless architecture replaces long-running virtual machines with ephemeral compute power that comes into existence on request and disappears immediately after use. Use of this architecture can mitigate some security concerns such as security patching and SSH access control, and can make much more efficient use of compute resources. These systems cost very little to operate and can have inbuilt scaling features.” — ThoughtWorks, 2016
  • 9. The Serverless Manifesto Function as the unit of deployment and scaling Implicitly fault-tolerant Metrics No machines, VMs, or containers Bring Your Own Code Stateless Never pay for idle Scales per request
  • 10. It all started with an event.. • events are a great way to decouple services • largely abused in the last decade (ESB) • now revamped with CQRS and Event Sourcing to handle microservices communication • serverless functions handle events • need a different approach on architectures
  • 11. AWS Lambda is a compute service that lets you run code without provisioning or managing servers. AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second. Service released on Nov, 2014 Introduces Event-Driven programming model Provides a context and an event object AWS Lambda
  • 12. Running a Lambda Function
  • 14. CloudFormation Cloud Services become a part of your project Infrastructure-as-code A scripting language for the cloud Defines AWS resources 
 (Lambda, S3Buckets, DynamoTables, etc) Manages resource lifecycle Example: creating a DynamoDB Table https://docs.aws.amazon.com/AWSCloudFormation/ latest/UserGuide/Welcome.html
  • 16.
  • 17. DEMO
  • 19. What is AWS SAM? github.com/awslabs/serverless-application-model “The goal of AWS SAM is to define a standard application model for serverless applications.”
  • 20. In other (technical) words? AWS::Serverless Transform (CloudFormation) Special serverless resources (e.g. AWS::Serverless::Function) Pretty similar to Serverless Framework’s syntax (yaml) Natively supported by AWS SAM Local (github.com/awslabs/aws-sam-local)
  • 21. AWS SAM Example (Function) (plus policies, VCP config, DLQ, tracing, etc.)
  • 22. AWS SAM Example (Traffic Shifting) (plus alarms & pre/post-traffic hooks)
  • 23. AWS SAM Example (DynamoDB)
  • 24. AWS SAM Example (API Gateway) (plus cache, stage variables, etc.)
  • 25. AWS SAM Example (Function+API)
  • 26. My Personal “wishes” for AWS SAM More transparency (make it public, or even customizable?) Custom Transforms (endless possibilities!)
  • 28. It is the night before Christmas 
 and you’re just leaving.. …then your manager steps into the office.. …with another great idea: 
 an url-tracker!
  • 30. IDEA: Make it Serverless! Focus only on your code No infrastructure to manage (your IT guy has a family, too) Scales up to production requirements Can be released within minutes Use DynamoDB and GSI Serverless does not mean spaghetti-code!
  • 32.
  • 33. CODE
  • 35. The good Fast deployments Serverless.yml makes things easy Infrastructure versioning Test environments IAM permissions management DynamoDB scales automatically Serverless strips unwanted dependencies A/B testing with Lambda is very easy Progressive rollout are made possible with a single click
  • 36. The bad CloudFormation is not so easy to write Not every service is scriptable Support for 3rd party services is very bad No Lambda lifecycle callbacks Lambda cold start matters No GPU support (yet) Serverless Framework is not an AWS tool
  • 37. The ugly Lambda support is up to NodeJS 6.10 Maximum resorce limit up to 200 CloudFront distribution needs some tune-up Communication between Lambdas is up to you
  • 41. About architectures “Bad code haunts you for months… ..bad architectures harms you for decades.”
  • 42. • In 2015 Tim Wagner, General Manager @ AWS Serverless Compute, presented to the ServerlessConf the so-called Serverless Manifesto. • In 2017 Danilo Poccia, Technical Evangelist @ AWS, talking at JeffConf asked “what would be having that manifesto translated into a checklist to evaluate Serverless compliance of an architecture?” • So, we turned it into a “Serverless Scorecard” Evaluating a serverless architecture (aka how big is my serverless?) The Serverless Scorecard Function as the unit of deployment and scaling Implicitly fault-tolerant Metrics No machines, VMs, or containers Bring Your Own CodeStateless Never pay for idleScales per request
  • 43. An IDE for Serverless?
  • 44.
  • 45.
  • 46.
  • 47. AWS Cloud9 Features Full-fledged IDE & Dev tools Cost-saving settings (hibernation) Integrated web terminal * (EC2 or SSH environment) Built-in Lambda support Live debugging capabilities (only Node.js for now) Collaborative coding/debugging * No SSH keys or IAM credentials to configure locally (!) SAM-local integration (local testing & deployments)
  • 48. AWS Cloud9 Dev Tools AWS CLI (1.11), sam-local (0.2.4) git, gcc, c++, Docker (17.03) node (6.11.4), npm, nvm, coffeescript python (2.7.12 & 3.6.2), virtualenv, pip, pylint, boto3 PHP (5.6), MySQL (14.14), Apache (2.4) ruby (2.4.1), rails (5.1.4) Go (1.9.1) Java docs.aws.amazon.com/cloud9/latest/user-guide/ami-contents.html
  • 50. AWS Cloud9 Limitations & “wishes” Max 20 env per user, 100 per account Max 10 open env per user Max 8 members in each env EC2 instance maintenance is still on you (OS updates, etc.) No Python debugging 🐍 No “offline” support 📡 Only SAM-focused 🐿 Lacking AWS Console integration “Primitive" Lambda testing ⚡ (e.g. no event generation)
  • 53. slides @ http://bit.ly/sls-20180111 code @ https://github.com/waylon-ai/waylon-url-shortener