Software development is on the verge of a new revolution that will change the rules of the Cloud Computing game... again! The new wind of change is called "Serverless" and you should definitely get ready for it! In this talk I will illustrate why I believe Serverless will be a game changer in the industry, how did we get to have Serverless and how to get started with it to build real products.
3. LUCIANO... WHOLUCIANO... WHO
Find me online:
- (@loige)
- (lmammino)
-
- (loige.co)
Twitter
GitHub
Linkedin
Blog
Solution Architect at
with @mariocasciaro
with @andreaman87
with @ Podgeypoos79 3
4. AGENDAAGENDA
CHAPTER 1:CHAPTER 1: FROM BARE METAL TO SERVERLESSFROM BARE METAL TO SERVERLESS
CHAPTER 2:CHAPTER 2: SERVERLESS, WTF?!SERVERLESS, WTF?!
CHAPTER 3:CHAPTER 3: UNDERSTANDING SERVERLESSUNDERSTANDING SERVERLESS
CHAPTER 4:CHAPTER 4: A SERVERLESS USE CASEA SERVERLESS USE CASE
CHAPTER 5:CHAPTER 5: PROS N' CONSPROS N' CONS
CHAPTER 6:CHAPTER 6: IT'S TIME TO GET STARTEDIT'S TIME TO GET STARTED
4
5. CHAPTER 1CHAPTER 1
FROMFROM BAREMETALBAREMETAL TO TO SERVERLESSSERVERLESS
loige.co/from-bare-metal-to-serverless
5
21. "Serverless most often refers to serverless applications. Serverless applications
are ones that don't require you to provision or manage any servers. You can focus
on your core product and business logic instead of responsibilities like operating
system (OS) access control, OS patching, provisioning, right-sizing, scaling, and
availability. By building your application on a serverless platform, the platform
manages these responsibilities for you."
— Amazon Web Services
loige.link/serverless-apps-lambda
21
22. “ The essence of the serverless trend is the absence of the
server concept during software development.
— Auth0
loige.link/what-is-serverless
22
26. THE 4 PILLARS OF SERVERLESSTHE 4 PILLARS OF SERVERLESS
(TLDR; IT'S NOT ONLY ABOUT SERVERS)(TLDR; IT'S NOT ONLY ABOUT SERVERS)
No server management
You don't know how many and how they are configured
Flexible scaling
If you need more resources, they will be allocated for you
High availability
Redundancy and fault tolerance are built in
Never pay for idle
Unused resources cost $0
26
27. THE SERVERLESS LAYERSTHE SERVERLESS LAYERS
(TLDR; IT'S NOT ONLY "FAAS")(TLDR; IT'S NOT ONLY "FAAS")
COMPUTECOMPUTE
DATADATA
MESSAGING AND STREAMINGMESSAGING AND STREAMING
27
USER MANAGEMENT AND IDENTITYUSER MANAGEMENT AND IDENTITY
MONITORING AND DEPLOYMENTMONITORING AND DEPLOYMENT
EDGEEDGE
28. STUFF THAT WE CAN BUILDSTUFF THAT WE CAN BUILD
Mobile Backends
APIs & Microservices
Data Processing pipelines
⚡ Webhooks
Bots and integrations
⚙ IoT Backends
Single page web applications
28
29. SOME SERVERLESS APPS I HELPED BUILDSOME SERVERLESS APPS I HELPED BUILD
Open source
A "semi-automated" weekly newsletter ( )
A middleware framework for AWS Lambda ( )
Enterprise
Various solutions for the UK Energy industry: Trading platform, Billing engine,
Market data aggregator ( )
Big data pipeline (~1-5TB/day/customer) to make network data searchable
( )
Fullstack bulletin
middy.js.org
Planet 9 Energy
Vectra.ai
29
32. SERVERLESS AND JAVASCRIPTSERVERLESS AND JAVASCRIPT
Frontend
Serverless Web hosting is static, but you can build SPAs
(React, Angular, Vue, etc.)
Backend
Node.js is supported by every provider
⚡ Fast startup (as opposed to Java)
Use all the modules on NPM
Support other languages/dialects
(TypeScript, ClojureScript, ESNext...)
32
33. exports.myLambda = function (
event,
context,
callback
) {
// get input from event and context
// use callback to return output or errors
}
ANATOMY OF A NODE.JS LAMBDA ON AWSANATOMY OF A NODE.JS LAMBDA ON AWS
33
36. A SERVERLESS IMPLEMENTATION (ON AWS)A SERVERLESS IMPLEMENTATION (ON AWS)
Network
Metadata
FTP Storage
Search API
(API Gateway)
Network metadata search service
User or other
services
Sync
Lambda
Parse/Load
Lambda
API
Lambda
Network Metadata
S3 Bucket
/metadata
elastic search index 36
scheduled event
new object
API
Request
38. exports.syncLambda = (
event,
context,
callback
) => {
// 1. connect to the FTP server
// 2. get list of files from FTP
// 3. get list of files from S3
// 4. make a diff to find new files in FTP
// 5. read the new files and save them to S3
// 6. invoke the callback to stop lambda
}
SYNC LAMBDASYNC LAMBDA
38
40. exports.loadLambda = (
event,
context,
callback
) => {
// 1. get the new file details from the `event`
// 2. read the file and deserialize the records
// 3. send the records to elastic search using
// the bulk API
// 4. invoke the callback to stop lambda
}
LOAD LAMBDALOAD LAMBDA
40
42. exports.apiLambda = (
event,
context,
callback
) => {
// 1. read the HTTP details (query) from
// the `event`
// 2. issue the query to ElasticSearch to the
// given index
// 3. reformat the results into an API gateway
// response
// 4. invoke the callback passing the response
}
API LAMBDAAPI LAMBDA
42
43. ORCHESTRATION / CONFIGURATIONORCHESTRATION / CONFIGURATION
WHO DEFINES THE EVENTS AND WHERE DO WE STORE THE CONFIG?WHO DEFINES THE EVENTS AND WHERE DO WE STORE THE CONFIG?
43
44. ORCHESTRATION / CONFIGURATIONORCHESTRATION / CONFIGURATION
MANY OPTIONSMANY OPTIONS
Manually a.k.a. "clicky-clicky" from the Web UI
Declarative code-based approaches:
orAWS Cloudformation SAM
Serverless framework
Terraform
44
45. service: metadataSearch
provider:
name: aws
runtime: nodejs8.10
functions:
sync:
handler: index.syncLambda
environment:
FTP_HOST: "28.0.1.22:23"
FTP_USERNAME: admin
FTP_PASSWORD: unicorns
S3_BUCKET: metadata-sync-files
events:
- schedule: rate(2 hours)
load:
handler: index.loadLambda
environment:
ES_INDEX: metadata
events:
- s3:
bucket: metadata-sync-files
event: "s3:ObjectCreated:*"
api:
handler: index.apiLambda
environment:
ES_INDEX: metadata
events:
- http: GET metadata/search
SERVERLESS FRAMEWORK EXAMPLESERVERLESS FRAMEWORK EXAMPLEserverless.yml
sls deploy
Reads the serverless.yml and parses the
resources
Creates a zip file containing the source
code
Creates a Cloudformation stack with all
the resources listed in serverless.yml
Deploys the stack (including Lambda code)
$
45
46. (MANY) THINGS I DIDN'T HAVE TO WORRY ABOUT...(MANY) THINGS I DIDN'T HAVE TO WORRY ABOUT...
What type of virtual machine do I need?
What operating system?
How to keep OS/System updated?
How much disk space do I need?
How do I handle/retry failures?
How do I collect and rotate logs?
What about metrics?
What machine do I need to run the database?
How do I backup the database?
How do I scale the database?
Which web server should I use and how to configure it?
Throttling? Managing API Keys? API caching?
46
61. WHO IS ALREADY ADOPTING SERVERLESSWHO IS ALREADY ADOPTING SERVERLESS
61
62. PICK A FAAS AND START TO HAVE FUN!PICK A FAAS AND START TO HAVE FUN!
IBM
Cloud
Functions
AWS
Lambda
Azure
Functions
Google
Cloud
Functions
Auth0
Webtask
Iron.io
FaaS
Spotinst
Functions
Apache
OpenWhisk
Fission
stdlib
service
Functions
62
Fn Kubeless
CLOUD BASEDCLOUD BASED
SELF-HOSTED / OPEN SOURCESELF-HOSTED / OPEN SOURCE
Feffe LeverOS Open FaaS
63. WHY IS SERVERLESS THE FUTURE?WHY IS SERVERLESS THE FUTURE?
MY 2 FAVOURITE REASONS:MY 2 FAVOURITE REASONS:
Opportunity to deliver value to the customer quickly
Pay only for the used resources
63
64. TOMORROW I'LL MIGRATE ALLTOMORROW I'LL MIGRATE ALL
MY APPS TO SERVERLESSMY APPS TO SERVERLESS
APPROACH THISAPPROACH THIS
WITH CARE...WITH CARE...
64
66. CREDITSCREDITS
High Res Emojis by emojiisland.com
World Wide Web Foundation, history of the web
Web hosting on Wikipedia
The history of web hosting: how things have changed since Tibus started in 1996
Grid computing on Wikipedia
Globus toolkit on Wikipedia
Globus Alliance on Wikipedia
Globus: A Metacomputing Infrastructure Toolkit (slides)
The Anatomy of the Grid: Enabling Scalable Virtual Organizations (paper)
Computer Weekly, the history of Cloud Computing
Brief history of Salesforce.com
With long history of virtualization behind it, IBM looks to the future
About Amazon Web Services (official)
Fullstack python: What is Serverless
Parse (platform) on Wikipedia
Firebase on Wikipedia
Kubernetes on Wikipedia
CoreOS on Wikipedia
AWS Lambda on Wikipedia
Serverless Computing on Wikipedia
"AWS Serverless Applications Lens" white paper (pdf)
"Serverless Architectures with AWS Lambda" white paper (pdf)
AWS Lambda VS the World
Serverless: Looking Back to See Forward
Awesome Serverless (GitHub repository)
Discussion about the history of Serverless on Lobste.rs
a HUGE thanks to:
@vladholubiev
@mariocasciaro
@katavic_d
@Podgeypoos79
PLEASE GIVE FEEDBACK
loige.link/vote-jsday
66