serverless IoT-Applications BED-Con 2017 Niko Will, innoQ - - PowerPoint PPT Presentation

serverless iot applications
SMART_READER_LITE
LIVE PREVIEW

serverless IoT-Applications BED-Con 2017 Niko Will, innoQ - - PowerPoint PPT Presentation

serverless IoT-Applications BED-Con 2017 Niko Will, innoQ @n1ko_w1ll about me > Developer since 2005 > living in a Smarthome since 2012 > became an IoT Geek > before: worked on Bosch IoT Suite for 2 years > now: Consultant at


slide-1
SLIDE 1

serverless IoT-Applications

BED-Con 2017

Niko Will, innoQ @n1ko_w1ll

slide-2
SLIDE 2

@n1ko_w1ll

about me

> Developer since 2005 > living in a Smarthome since 2012

> became an IoT Geek

> before: worked on Bosch IoT Suite for 2 years > now: Consultant at innoQ > follow me on Twitter: @n1ko_w1ll

slide-3
SLIDE 3

@n1ko_w1ll

agenda

> microservices approach > AWS, Lambda & IoT > use-cases

> JITR | on-boarding | pairing > list / search things | command & control | telemetry > connected / disconnected / LWT > encrypted fjle transfer | fjrmware update

slide-4
SLIDE 4

@n1ko_w1ll

microservice approach

slide-5
SLIDE 5

@n1ko_w1ll

microservices approach

> fault tolerance > scalability > agility > visibility > security > cost-effjciency

slide-6
SLIDE 6

@n1ko_w1ll

microservices approach

thing mobile client browser IoT-application

API Gateway MQTT Broker

database Users Devices Policies Rules Analytics …

slide-7
SLIDE 7

@n1ko_w1ll

microservices approach

API Gateway MQTT Broker

database Devices … microservices Devices Devices … … Message Broker Service Discovery IAM Keystore

API Gateway API Gateway MQTT Broker MQTT Broker

Service Discovery Service Discovery Message Broker Message Broker IAM IAM Keystore HSM docker / kubernetes

slide-8
SLIDE 8

@n1ko_w1ll

microservices approach

Devices microservices docker / kubernetes Alert Manager prometheus Grafana fluentd Kibana elasticsearch

  • perations

(DevOps) logging monitoring alerting

slide-9
SLIDE 9

@n1ko_w1ll

source: https://www.memecenter.com/fun/5802169/what-could-possibly-go-wrong

slide-10
SLIDE 10

@n1ko_w1ll

AWS

slide-11
SLIDE 11

@n1ko_w1ll

AWS

Amazon S3 Amazon Elasticsearch Amazon Kinesis Amazon SNS Amazon SQS Amazon DynamoDB Amazon Cognito Amazon API Gateway AWS Lambda Amazon CloudWatch AWS IoT

State Fast Data

slide-12
SLIDE 12

@n1ko_w1ll

AWS Lambda

slide-13
SLIDE 13

@n1ko_w1ll

AWS Lambda

> Functions-as-a-Service (FaaS)

> serverless > „small“ functions

> stateless compute containers > event-driven

slide-14
SLIDE 14

@n1ko_w1ll

AWS Lambda

> advantages

> scalable > pay-per-execution / pay-as-you-go

> no upfront capacity planning

> signifjcantly reduce operational cost

slide-15
SLIDE 15

@n1ko_w1ll

AWS Lambda

> disadvantages

> vendor lock-in > startup latency > testing > debugging > execution duration

slide-16
SLIDE 16

@n1ko_w1ll

slide-17
SLIDE 17

@n1ko_w1ll

AWS IoT

slide-18
SLIDE 18

@n1ko_w1ll

AWS IoT

> managed service > message broker > rules engine > shadows > registry > security

slide-19
SLIDE 19

@n1ko_w1ll

message broker

> topic based > publish / subscribe

> topic wildcards

> protocols

> MQTT > MQTT + WebSockets > HTTP

$aws/events/presence/connected/clientId $aws/events/presence/disconnected/clientId $aws/things/thingName/shadow/update $aws/things/thingName/shadow/update/delta

slide-20
SLIDE 20

@n1ko_w1ll

rules engine

> SQL-like syntax > augument or fjlter data > rule actions

> state stores > fast data pipelines > CloudWatch > Lambda > republish

SELECT *, newuuid() AS requestId, clientId() AS clientId, timestamp() AS timestamp, topic(2) AS deviceId, topic(4) AS sensorId FROM 'device/+/sensor/+/v1' WHERE temperature > 50 AND color <> 'red'

slide-21
SLIDE 21

@n1ko_w1ll

shadows

> JSON document > current state of thing > connection independent > supports client tokens > supports versioning > MQTT topics > RESTful API

{ "state" : { "desired" : { "color" : "RED" }, "reported" : { "color" : „GREEN" } }, "metadata" : { "desired" : { "color" : { "timestamp" : 12345 } }, "reported" : { "color" : { "timestamp" : 12345 } } }, "version" : 10, "clientToken" : "UniqueClientToken", "timestamp": 123456789 }

slide-22
SLIDE 22

@n1ko_w1ll

registry

> manage your things

> physical device or sensor > logical entity

> attributes > thing types

{ "version": 3, "thingName": "MyLightBulb", "defaultClientId": "MyLightBulb", "thingTypeName": "LightBulb", "attributes": { "model": "123", "wattage": "75" } }

slide-23
SLIDE 23

@n1ko_w1ll

security

> mutual authentication with X509 certifjcates + TLS 1.2

> or SigV4 for HTTPS and WebSockets

> bring your own certifjcate

> JITR > Atmel ECC508

> policy based access with dynamic values > role based rules action execution

slide-24
SLIDE 24

@n1ko_w1ll

use-cases

slide-25
SLIDE 25

@n1ko_w1ll

just in time registration (JITR)

thing AWS IoT Device Registry $aws/events/certifjcates/ registered/caCertifjcateID IoT Policy IoT Rule AWS Lambda

slide-26
SLIDE 26

@n1ko_w1ll

  • n-boarding

thing AWS IoT AWS Lambda custom/clientId/register IoT Rule IoT Policy Device Shadow Amazon DynamoDB

slide-27
SLIDE 27

@n1ko_w1ll thing IoT Policy Device Shadow mobile client AWS Lambda Amazon Cognito Amazon API Gateway AWS IoT

thing pairing

exchange OAuth token for AWS credentials

slide-28
SLIDE 28

@n1ko_w1ll

list / search things

things mobile client AWS Lambda Amazon Cognito Amazon API Gateway AWS IoT Amazon DynamoDB

slide-29
SLIDE 29

@n1ko_w1ll

command & control

thing mobile client AWS Lambda Amazon Cognito Amazon API Gateway AWS IoT Device Shadow

slide-30
SLIDE 30

@n1ko_w1ll

command & control

thing mobile client Amazon Cognito AWS IoT Device Shadow

slide-31
SLIDE 31

@n1ko_w1ll

command & control

thing Amazon Cognito AWS IoT Amazon Echo AWS Lambda Alexa Skill Device Shadow

slide-32
SLIDE 32

@n1ko_w1ll

telemetry

AWS IoT things Amazon Kinesis Amazon DynamoDB telemetry rule telemetry topic Amazon EMR

slide-33
SLIDE 33

@n1ko_w1ll

{ "state": { "reported": { "connected": true } } } { "state": { "reported": { "connected": true } } }

connected / disconnected / LWT

Device Shadow thing AWS IoT shadow update topic

slide-34
SLIDE 34

@n1ko_w1ll

{ "state": { "reported": { "connected": true } } } { "state": { "reported": { "connected": false } } } { "state": { "reported": { "connected": false } } }

connected / disconnected / LWT

Device Shadow thing AWS IoT shadow update topic

slide-35
SLIDE 35

@n1ko_w1ll

{ "state": { "reported": { "connected": true } } } { "state": { "reported": { "connected": false } } }

connected / disconnected / LWT

Device Shadow thing AWS IoT LWT rule custom LWT topic

LWT

{ "state": { "reported": { "connected": false } } }

shadow update topic

republish

slide-36
SLIDE 36

@n1ko_w1ll

encrypted fjle transfer

Amazon S3 thing AWS IoT AWS Lambda AWS KMS

slide-37
SLIDE 37

@n1ko_w1ll

fjrmware update

Device Shadow AWS Lambda thing AWS IoT Amazon S3 Amazon DynamoDB

slide-38
SLIDE 38

@n1ko_w1ll

summary

> scalable plattform > common IoT use-cases > w/o own infrastructure > w/o upfront capacity planning > very secure > very extensible

slide-39
SLIDE 39

@n1ko_w1ll

Thank you. Questions? Comments @n1ko_w1ll

Niko Will niko.will@innoq.com

innoQ Deutschland GmbH

  • Krischerstr. 100

40789 Monheim am Rhein Germany Phone: +49 2173 3366-0 innoQ Schweiz GmbH

  • Gewerbestr. 11

CH-6330 Cham Switzerland Phone: +41 41 743 0116

www.innoq.com

Ohlauer Straße 43 10999 Berlin Germany Phone: +49 2173 3366-0

  • Ludwigstr. 180E

63067 Ofgenbach Germany Phone: +49 2173 3366-0 Kreuzstraße 16
 80331 München Germany Phone: +49 2173 3366-0