Going “Serverless”

----

Barak Chamo

@GoFoolhardy

Follow the presentation

barakchamo.github.io/going-serverless

or

bit.do/go-serverless

Follow the workshop docs

github.com/barakchamo/going-serverless

What do you mean Serverless?

IaaS

Infrastructure

Network
Storage
Servers
Virtualization
PaaS

Platform

OS
Middleware
Runtime
Services
AaaS?

Application

Auth
Routing
Execution
More Magic!

Let's talk about scalability!

Maintenanceless!

Serverless applications utilize (yet another) layer of *aaS abstraction, yielding control of execution and opting for service interfaces instead of "management code" in a component-based architecture that focuses on small pieces of functionality.

Let's build a serverless app

A backend and RESTful API for a ToDo app

Yes, another todo app...

S3
Cloud storage service
Lambda
Event-driven code execution
DynamoDB
NoSQL Key-Value store
API Gateway
API management service

Data & Backend

Data & Backend

  • DynamoDB - key-value store
  • S3 - batch data upload
  • Lambda - data processing

Step 0

Create an IAM role

  • Grant Lambda, S3, DynamoDB and logging permissions
  • Keep record of created Role's ARN
  • Get API key and API secret for your account

Step 1

Create S3 upload bucket

Step 2

Create a DynamoDB store

  • Create a table with an id index key

Step 3

Create Lambda upload event handler

  • Assign the created role
  • Set-up an S3 trigger
  • Define the handler

Let's test it out

RESTful API

RESTful API

  • DynamoDB - key-value store
  • Lambda - API handler
  • API Gateway - API endpoint

Step 1

Create API Gateway API

  • Create API Definition
  • Create REST methods
  • Assign Service Proxies

Step 2

Secure the API

  • Define API Key
  • Assign and enable for API
  • Secure chosen endpoints

Step 3

Deploy the API

  • Create a deployment stage
  • Deploy the API
  • Test!

Step 4

Deploy full Swagger Schema

  • Update Swagger JSON schema
  • Create new API from the schema
  • Update API Key assignments
  • Deploy the API

We built a web app!

without maintaining a server

Relying on interfaces instead of management code eliminates bottlenecks reduces maintenance and abstracts some scaling concerns

Supporting Platforms

Amazon AWS Google Cloud Microsoft Azure IBM Bluemix
Code Lambda Code Functions OpenWhisk
JS, Java, Python JS JS, C#, Python, PHP JS, Swift, Docker
API API Gateway Cloud Endpoints API Management API Connect
Serverless Frameworks and Tools

Serverless Zappa Apex
Built with Node Python Node
Supports Node, Python and Java Python Node, Python, Java, Go
Deploys to AWS, Azure, Google, IBM AWS AWS

Thanks!

Barak Chamo

@GoFoolhardy