helsinki serverless meetup 15.6.2016 : aws services

19
SERVERLESS SERVICES ON AWS Mikael Puittinen, CTO [email protected] @mpuittinen 1 15.6.2016

Upload: mikael-puittinen

Post on 16-Apr-2017

1.292 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Helsinki Serverless Meetup 15.6.2016 : AWS Services

SERVERLESS SERVICES ON AWS

Mikael Puittinen, CTO

[email protected]

@mpuittinen

115.6.2016

Page 2: Helsinki Serverless Meetup 15.6.2016 : AWS Services

SOME AWS SERVICES FOR DEVELOPERS (8 OUT OF 55)

COMPUTE

Lambda 2014

STORAGE

S3 (Simple Storage Service) 2006

DATABASE

DynamoDB 2012

MOBILE SERVICES

SNS (Simple Notification Service)

INTERNET OF THINGS

IoT 2015

APPLICATION SERVICES

API Gateway 2015

SES (Simple Email Service) 2011

SQS (Simple Queue Service) 2006

Building blocks for digital services

Page 3: Helsinki Serverless Meetup 15.6.2016 : AWS Services

SAMPLE BLOG EXERCISE ARCHITECTURE

3

Page 4: Helsinki Serverless Meetup 15.6.2016 : AWS Services

AWS SERVERLESS WORKSHOP BLOG APPLICATION

Example 2

2. Web app communicates with

API Gateway for blog content

1. Application static assets (HTML, CSS, JS) served from S3 bucket.

5. Blog data managed in DynamoDB

database

http://hackathon-blog.serverless.fi

3. API Gateway invokes Lambda for incoming

requests

4. Lambda reads / writes blog data from DynamoDB

See workshop at http://hackathon.serverless.fi/workshop.pdf

Page 5: Helsinki Serverless Meetup 15.6.2016 : AWS Services

SIMPLE STORAGE SERVICE (S3)

§ (Unlimited) file storage service

§ Application internal files

§ Static web content (e.g. application HTML / CSS / JS / image assets)

§ Can be complemented with Cloudfront CDN to optimize costs and performance

Serverless Storage

my-s3-bucket.company.com

PRICING: Storage volume + amount of requests

Page 6: Helsinki Serverless Meetup 15.6.2016 : AWS Services

AWS LAMBDA

§ Compute service for running code (functions) in AWS

§ Event driven (API Gateway, SNS, SES, S3, DynamoDB, Schedule, …)

§ Provision memory & max time required by single function run

§ Additional ”instances” spawned automatically

Serverless Compute

myFunction

PRICING: Utilized gigabyteseconds (rounded to 100ms)

Page 7: Helsinki Serverless Meetup 15.6.2016 : AWS Services

API GATEWAY

§ AWS Service to implement REST (and other) APIs

§ Security via API Keys, customer authorizers (Lambda)

§ Connect to e.g. Lambda to publish your functions as REST interfaces

§ Input / Output mapping (e.g. URL parameters -> JSON)

§ No need for provisioning

Serverless API Management

PRICING: # of requests + data transfer + cache size

INPUT MAPPING

OUTPUT MAPPING

AUTHORI-ZATION

JSON JSON

HTTPS

Page 8: Helsinki Serverless Meetup 15.6.2016 : AWS Services

DYNAMODB

§ noSQL database provided by AWS

§ noSQL: scalable non-relational database with focus on speed

§ Work with tables and indices, no server instances to manage

§ Need to provision read / write capacity per table / index

Serverless Database

PRICING: Provisioned read / write capacity and storage (over 25Gb)

Page 9: Helsinki Serverless Meetup 15.6.2016 : AWS Services

SERVERLESS WORKSHOP

If you are interested in getting hands-on experience, please check out our serverless workshop at

http://hackathon.serverless.fi/workshop.pdf

Page 10: Helsinki Serverless Meetup 15.6.2016 : AWS Services

OTHER AWS MANAGED SERVICES & EXAMPLES

10

Page 11: Helsinki Serverless Meetup 15.6.2016 : AWS Services

SIMPLE NOTIFICATION SERVICE (SNS)

§ Push notification service

§ Delivery not guaranteed

§ nly targeted for mobile notifications

§ Can also be used for triggering e.g. Lambda functions, mobile, email notifications

Serverless push notifications

PRICING: Amount of messages

1

SUBSCRIBE

PUBLISH

Page 12: Helsinki Serverless Meetup 15.6.2016 : AWS Services

SIMPLE QUEUE SERVICE (SQS)

§ Message queue service (pull)

§ Delivery Guaranteed (order not guaranteed)

§ Prevent messages being handled by multiple workers

§ Can be handled e.g. by Lambda using a scheduled function

Serverless queue

PRICING: Amount of messages

(SCHEDULED) PULL

PUBLISH

Page 13: Helsinki Serverless Meetup 15.6.2016 : AWS Services

AWS IOT

§ Device registry + API for communicating with devices + automated actions (Rules)

§ Authentication of devices

§ Devices can send current state and retrieve desired state over MQTT, Websocket

§ Can perform actions based on rules (e.g. Temperature reading from a specific sensor is out of bounds)

Integrate with devices

PRICING: Amount of messages

Page 14: Helsinki Serverless Meetup 15.6.2016 : AWS Services
Page 15: Helsinki Serverless Meetup 15.6.2016 : AWS Services

CLOUD NATIVE APPLICATION ARCHITECTURE À LA SC5

Reference Architecture

AWS IoT

AmazonS3

AmazonDynamoDB

AmazonRDS

AmazonSNS

Amazon API Gateway

AWSLambda

E.g.App assets(HTML5)

App Notifications

App Data(REST)

Device data(MQTT)

Compute Database

Serverless DevelopmentFramework

Page 16: Helsinki Serverless Meetup 15.6.2016 : AWS Services

SERVERLESS FRAMEWORK

16

Page 17: Helsinki Serverless Meetup 15.6.2016 : AWS Services

SERVERLESS FRAMEWORK

§ Node.js based framework for development and deploymentof AWS Lambda-basedsolutions

§ Extendible via plugins

§ Initially JAWS but rebrandedto Serverless in Dec 2015

> npm install –g serverless> sls project create> sls resources deploy> sls function create> sls function deploy> sls endpoint deploy> …

Page 18: Helsinki Serverless Meetup 15.6.2016 : AWS Services

SC5 BRIEFLY

CLOUD SOLUTIONS

BUSINESS APPLICATIONS

DIGITALDESIGN

10YEARS

60+CUSTOMERS

200+ PROJECTS

HELJKL

75HACKERS

DESIGNERS

6MEUR2015

Page 19: Helsinki Serverless Meetup 15.6.2016 : AWS Services

THANKS A LOT!https://sc5.io

19