@lynnaloo
@lynnaloo
@lynnaloo
@lynnaloo
@lynnaloo
@lynnaloo
@lynnaloo
@lynnaloo
@lynnaloo
Stateless functions running in execution environments managed by a service provider (not you!).
Building block of Serverless Architecture
Stateless and ephemeral
Functions run in managed execution environments
Removes the complexity of building your own infrastructure
You only pay for functions when you use them
@lynnaloo
@lynnaloo
@lynnaloo
@lynnaloo
Most popular kid in school
@lynnaloo
The Developer's Favorite
@lynnaloo
They do really mean open
@lynnaloo
Finally in GA!
Storage
IoT
Database Actions
API Gateway
Queues and Topics
Logging
@lynnaloo
Responsible for one specific task
Lightweight and fast
Reusable
Deployed independently
Not dependent on other services
Work together to power applications
@lynnaloo
@lynnaloo
@lynnaloo
@lynnaloo
Dedicated
Flexible
Supportive
Resilient
Growth potential
Speaks many languages!
@lynnaloo
@lynnaloo
@lynnaloo
Open-source
Abstracts provider-specific tasks
Multi-provider plugin system
Scaffold and deploy using CLI
@lynnaloo
# Install serverless cli
$ npm install serverless -g
# Create AWS Service
$ serverless create --template aws-nodejs --path cat-name-service
# Change into the service directory
$ cd cat-name-service
# Deploy to cloud provider
$ serverless deploy -v
cat-name-service/
package.json
serverless.yml
handler.js
dog-name-service/
package.json
serverless.yml
handler.js
@lynnaloo
#serverless.yml
service: cat-name-service
provider:
name: aws
runtime: nodejs6.10
functions:
catName:
handler: handler.getCatName
events:
- http:
path: cats/name
method: get
@lynnaloo
'use strict';
const catNames = require('cat-names');
function getCatName(event, context, callback) {
callback(null, { payload: `Your cat name is ${catNames.random()}.` });
}
module.exports = getCatName;
@lynnaloo
'use strict';
const catNames = require('cat-names');
const AmazonDb = require('amazon-db-module');
function getCatName(event, context, callback) {
const amazonDb = new AmazonDb();
const catName = catNames.random();
amazonDb.update(catName);
callback(null, { payload: `Your cat name is ${catName}.` });
}
module.exports = getCatName;
'use strict';
const catNames = require('cat-names');
const GoogleDb = require('google-db-module');
function getCatName(request, response) {
const googleDb = new GoogleDb();
const catName = catNames.random();
googleDb.update(catName);
return response.status(200).send(`Your cat name is ${catName}.`);
}
module.exports = getCatName;
@lynnaloo
@lynnaloo
@lynnaloo
@lynnaloo
a specification for describing event data in a common way
Azure Event Grid natively supports events in the CloudEvents JSON schema
Serverless Framework's Event Gateway
@lynnaloo
Mention @thesecatstweet in a tweet with the hashtag #valentinebot
@lynnaloo