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 innoQ > follow me on Twitter: @n1ko_w1ll @n1ko_w1ll
agenda > microservices approach > AWS, Lambda & IoT > use-cases > JITR | on-boarding | pairing > list / search things | command & control | telemetry > connected / disconnected / LWT > encrypted fj le transfer | fj rmware update @n1ko_w1ll
microservice approach @n1ko_w1ll
microservices approach > fault tolerance > scalability > agility > visibility > security > cost-e ffj ciency @n1ko_w1ll
microservices approach IoT-application mobile client thing Users Devices Policies MQTT Broker API Gateway Rules Analytics … browser database @n1ko_w1ll
microservices approach microservices Service Message Service Message Service Message Discovery Broker Discovery Broker Discovery Broker Devices … Devices … Devices … MQTT Broker API Gateway MQTT Broker API Gateway MQTT Broker API Gateway docker / kubernetes IAM Keystore IAM Keystore IAM HSM database @n1ko_w1ll
microservices approach monitoring microservices logging fluentd prometheus Devices elasticsearch docker / kubernetes Alert Grafana Kibana Manager operations (DevOps) alerting @n1ko_w1ll
@n1ko_w1ll source: https://www.memecenter.com/fun/5802169/what-could-possibly-go-wrong
AWS @n1ko_w1ll
AWS State Fast Data AWS Lambda Amazon DynamoDB Amazon SQS Amazon Elasticsearch Amazon SNS AWS IoT Amazon Kinesis Amazon API Gateway Amazon S3 Amazon Cognito Amazon CloudWatch @n1ko_w1ll
AWS Lambda @n1ko_w1ll
AWS Lambda > Functions-as-a-Service (FaaS) > serverless > „small“ functions > stateless compute containers > event-driven @n1ko_w1ll
AWS Lambda > advantages > scalable > pay-per-execution / pay-as-you-go > no upfront capacity planning > signi fj cantly reduce operational cost @n1ko_w1ll
AWS Lambda > disadvantages > vendor lock-in > startup latency > testing > debugging > execution duration @n1ko_w1ll
@n1ko_w1ll
AWS IoT @n1ko_w1ll
AWS IoT > managed service > message broker > rules engine > shadows > registry > security @n1ko_w1ll
message broker > topic based $aws/events/presence/connected/clientId $aws/events/presence/disconnected/clientId > publish / subscribe $aws/things/thingName/shadow/update > topic wildcards $aws/things/thingName/shadow/update/delta > protocols > MQTT > MQTT + WebSockets > HTTP @n1ko_w1ll
rules engine > SQL-like syntax SELECT *, > augument or fj lter data newuuid() AS requestId, clientId() AS clientId, > rule actions timestamp() AS timestamp, topic(2) AS deviceId, > state stores topic(4) AS sensorId FROM 'device/+/sensor/+/v1' > fast data pipelines WHERE temperature > 50 AND color <> 'red' > CloudWatch > Lambda > republish @n1ko_w1ll
shadows > JSON document { "state" : { > current state of thing "desired" : { "color" : "RED" }, "reported" : { "color" : „GREEN" } }, > connection independent "metadata" : { "desired" : { "color" : { "timestamp" : 12345 } }, > supports client tokens "reported" : { "color" : { "timestamp" : 12345 } } }, > supports versioning "version" : 10, "clientToken" : "UniqueClientToken", "timestamp": 123456789 > MQTT topics } > RESTful API @n1ko_w1ll
registry > manage your things { "version": 3, > physical device or sensor "thingName": "MyLightBulb", "defaultClientId": "MyLightBulb", > logical entity "thingTypeName": "LightBulb", "attributes": { "model": "123", > attributes "wattage": "75" } > thing types } @n1ko_w1ll
security > mutual authentication with X509 certi fj cates + TLS 1.2 > or SigV4 for HTTPS and WebSockets > bring your own certi fj cate > JITR > Atmel ECC508 > policy based access with dynamic values > role based rules action execution @n1ko_w1ll
use-cases @n1ko_w1ll
just in time registration (JITR) IoT Policy AWS Lambda AWS IoT thing IoT Rule $aws/events/certi fj cates/ Device Registry registered/ caCerti fj cateID @n1ko_w1ll
on-boarding IoT Policy Device Shadow AWS IoT thing Amazon DynamoDB AWS Lambda IoT Rule custom/ clientId /register @n1ko_w1ll
thing pairing mobile client Amazon Cognito AWS IoT thing exchange OAuth token for AWS credentials Amazon API Gateway AWS Lambda IoT Policy Device Shadow @n1ko_w1ll
list / search things mobile client Amazon Cognito AWS IoT things Amazon API Gateway AWS Lambda Amazon DynamoDB @n1ko_w1ll
command & control mobile client Amazon Cognito AWS IoT thing Amazon API Gateway AWS Lambda Device Shadow @n1ko_w1ll
command & control mobile client Amazon Cognito AWS IoT thing Device Shadow @n1ko_w1ll
command & control Amazon Echo AWS Lambda AWS IoT thing Alexa Skill Amazon Cognito Device Shadow @n1ko_w1ll
telemetry Amazon Kinesis telemetry rule telemetry topic AWS IoT Amazon EMR Amazon DynamoDB things @n1ko_w1ll
connected / disconnected / LWT { "state": { AWS IoT thing "reported": { "connected": true } } } { "state": { "reported": { "connected": true } } shadow update topic Device Shadow } @n1ko_w1ll
connected / disconnected / LWT { "state": { AWS IoT thing "reported": { "connected": false } } } { { "state": { "state": { "reported": { "reported": { "connected": false "connected": true } } } } shadow update topic Device Shadow } } @n1ko_w1ll
connected / disconnected / LWT LWT LWT rule custom LWT topic AWS IoT thing republish { { "state": { "state": { { "reported": { "reported": { "state": { "connected": true "connected": false "reported": { } } "connected": false } } } shadow update topic Device Shadow } } } } @n1ko_w1ll
encrypted fj le transfer AWS Lambda AWS IoT thing AWS KMS Amazon S3 @n1ko_w1ll
fj rmware update Amazon S3 AWS Lambda AWS IoT thing Amazon DynamoDB Device Shadow @n1ko_w1ll
summary > scalable plattform > common IoT use-cases > w/o own infrastructure > w/o upfront capacity planning > very secure > very extensible @n1ko_w1ll
Thank you. @n1ko_w1ll Niko Will Questions? niko.will@innoq.com Comments innoQ Deutschland GmbH innoQ Schweiz GmbH Krischerstr. 100 Ohlauer Straße 43 Ludwigstr. 180E Kreuzstraße 16 Gewerbestr. 11 40789 Monheim am Rhein 10999 Berlin 63067 O fg enbach 80331 München CH-6330 Cham Germany Germany Germany Germany Switzerland www.innoq.com @n1ko_w1ll Phone: +49 2173 3366-0 Phone: +49 2173 3366-0 Phone: +49 2173 3366-0 Phone: +49 2173 3366-0 Phone: +41 41 743 0116
Recommend
More recommend