twitter: @markbaraban
github: @shmuga
diagram from cloudcraft
Serverless architectures refer to applications that significantly depend on third-party services (knows as Backend as a Service or "BaaS") or on custom code that's run in ephemeral containers (Function as a Service or "FaaS"), the best known vendor host of which currently is AWS Lambda.
Martin Fowler
exports.handler = (event, context, callback) => {
console.log(JSON.stringify(event));
callback(null, 'Done!');
};
is your payload (in other words json)
it's configured on the level of service who fires it
is information about currently called function and it's parameters
is old-school technology to handle async actions
is tightly connected with
100 000 times with 128Mb RAM parameter and execution time was 1s
so you have used 0.128 * 100 000 = 12800 GB-seconds
and price per 1GB-second = 0.00001667
You pay nothing.
product owner counting saved money
*is free permanently
update cycle of node version
when you receive call such call
POST /get-user
is key-value auto-scalable DB with atomic operations.
1k lines of json config
to deploy 1 function.
service: Users
provider:
name: aws
runtime: nodejs6.10
memorySize: 512
timeout: 20
region: eu-west-1
profile: default
role: arn:aws:iam::XXX:role/APIRole
functions:
addUser:
handler: functions/add-user.default
name: ${self:service}AddUser-${opt:stage, self:provider.stage}
description: Adds user
events:
- http:
path: /user/add
method: post
authorizer:
arn: arn:aws:lambda:eu-west-1:XXX:function:Authorizer
resultTtlInSeconds: 600
identitySource: method.request.header.AuthToken
package:
individually: true
exclude:
- test/**
- .git/**
- .vscode/**
- .idea/**
- yarn.lock
- node_modules/**/README.*
- node_modules/**/test/**
plugins:
- serverless-plugin-webpack