Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

38
Build and manage Serverless API Nicolas Grenié Hacker in Residence at 3scale @picsoung APIdays Nordic 19th May 2016 Tampere, Finland

Transcript of Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

Page 1: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

Build and manage Serverless API

Nicolas Grenié Hacker in Residence at 3scale @picsoung

APIdays Nordic 19th May 2016

Tampere, Finland

Page 2: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

@picsoung

Page 3: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

3scale.net/jobs

Page 4: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

700+ clients worldwide

billions of API calls per month

Page 5: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)
Page 6: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)
Page 7: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

There is hope hype

Page 8: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

http://www.commitstrip.com/en/2013/03/11/de-lestimation-de-la-charge/by CommitStrip

Page 9: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

common questions you usually ask yourself

Page 10: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

on prem vs

cloud

Page 11: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

how much storage

Page 12: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

how much database

Page 13: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

how much server power

Page 14: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)
Page 15: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

Welcome to serverless

era

Page 16: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

no servers

no deployments on servers

no software to install

Page 17: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

build once scale later

Page 18: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

event driven functions

Page 19: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

action

reaction

Page 20: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

serverless is

2016 PaaS

Page 21: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

actors

GoogleCLOUD FUNCTIONS ALPHA

Page 22: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

frameworks

Page 23: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

101

Page 24: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

pay per uselogs with CloudWatch

node, python, Javaauto-scale

AWS Lambda

Page 25: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

community projectAWS Lambda

node and pythonhandle rolesminify code

Page 26: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

$ sls project create

Page 27: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

project structures-project.json // project and author data s-resources-cf.json // CloudFormation template for all stages/regions admin.env // AWS Profiles - gitignored _meta // meta data that holds stage/regions config and

// variables - gitignored |__resources // final CF templates for each stage/region |__s-resources-cf-dev-useast1.json |__variables // variables specific to stages and regions |__s-variables-common.json |__s-variables-dev.json |__s-variables-dev-useast1.json

Page 28: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

$sls function create

Page 29: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

project structures-project.json // project and author data s-resources-cf.json // CloudFormation template for all stages/regions admin.env // AWS Profiles - gitignored _meta // meta data that holds stage/regions config and

// variables - gitignored |__resources // final CF templates for each stage/region |__s-resources-cf-dev-useast1.json |__variables // variables specific to stages and regions |__s-variables-common.json |__s-variables-dev.json |__s-variables-dev-useast1.json restAPI // folder to group your project functions |__greetings // your first function |__event.json // sample event for testing function locally |__handler.js // your function handler file |__s-function.json // data for your lambda function, endpoints and event sources

Page 30: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

$ sls function run

Page 31: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

$ sls dash deploy

Page 32: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

Manage the API

Page 33: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

Manage the APIsimple API keyno self-service

no throttling by keyno segmentation

Page 34: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

3scale API management

Page 35: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

3scale API managementreduce latencynot in the code

deploy with cloudformation

throttling by keysupport more auth protocol

Page 36: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

Try ithttp://bit.ly/API-workshop

Page 37: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

Takeaways

serverless = agilitycost effective

lot of platforms/toolsserverless API need to be managed

Page 38: Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)

Build and manage Serverless API

Nicolas Grenié Hacker in Residence at 3scale @picsoung

APIdays Nordic 19th May 2016

Tampere, Finland