This document discusses connecting devices in motion to the cloud. It outlines some of the challenges with devices in motion like constrained resources, unreliable connections, and location data. It then describes how AWS IoT can help address these challenges through its scalable MQTT broker, device shadowing capability, security features, and integration with services like DynamoDB, RDS, and Elasticsearch that support geospatial queries and mapping. The presentation concludes with a demo of how these techniques could be applied to a connected car safety application.
2. What to Expect from the Session
• Understand the challenges
• Architecture building blocks
• Architecture patterns
• Examples
• Demos
• Practical experience and guidelines
3. IoT in Motion at Monsanto
Danny Williams, @djwilli3
Mark Sparks, @markdsparks Monsanto IoT, @MonsantoIoT
4. IoT creates new opportunities in
precision agriculture
4
Plan
Experiment
Plant
Monitor/applyHarvest
Analyze
5. Monsanto tests products all around
the world
5
Data needs to be reliably gathered from various equipment in
remote locations where data connectivity is unreliable
Plan
Plant
MonitorHarvest
Analyze
Plan
Plant
MonitorHarvest
Analyze
Plan
Plant
MonitorHarvest
Analyze
Plan
Plant
MonitorHarvest
Analyze
Plan
Plant
MonitorHarvest
Analyze
6. The formula for reliable data transfer
and processing
6
Store and
forward on
edge
Low overhead
communication
protocol
Broker-based
processing in
cloud
7. Data ingestion and storage
Analytics Cloud code
Communication
Rest API Visualizations
HTTP
11. Devices in motion carry a lot of value
• Automated harvesting
• Automated transport
• Connected cars and vehicles
• Aviation
• Sports, gaming, leisure
• Medical and public service
• Tourism
12. Technical characteristics
• Mobile networks: kBit/s
• Lightweight:
Every gram, every watt counts
Low RAM, low CPU, low power
• Near real-time: Seconds count
• Location-based
• Large-impact use cases
13. Dash streams more than 1 TB of real-time data per day
Dash connects your smartphone to your car with a
simple, low-cost device which provides real-time road
safety information to drivers.
As a startup, using AWS has
allowed us to scale nicely and use
resources without spending a lot
of capital.
Brian Langel
CTO, Dash
”
“ • Real-time information for drivers
• Streams more than 1 TB of real-time
data per day over Amazon Kinesis
• Processes billions records using
Amazon DynamoDB
• Thousands of updates per second
during spikes
• Reduced operating costs by
$200,000 per year
14. Devices in motion: Challenges
• How to handle constrained resources?
• How to manage millions of things?
• How to communicate securely?
• How to deal with unreliable connections?
• How to handle geo-location?
• How to deal with map data?
?
15. Devices in motion: Challenges
• How to handle constrained resources?
• How to manage millions of things?
• How to communicate securely?
• How to deal with unreliable connections?
• How to handle Geo-Location?
• How to deal with map data?
?
16. MQTT
MQTT vs HTTPS:
• 93x faster throughput
• 11.89x less battery to send
• 170.9x less battery to receive
• 50% less power to keep connected
• 8x less network overhead
Source:
http://stephendnicholas.com/archives/1217
• OASIS standard protocol (v3.1.1)
• Lightweight, pub-sub, transport protocol
that is useful for connected devices
• MQTT is used on oil rigs, connected
trucks, and many more sensitive and
resource-sensitive scenarios
• Customers have needed to build,
maintain, and scale a broker to use
MQTT with cloud applications
17. Devices in motion: Challenges
• How to handle constrained resources?
• How to manage millions of things?
• How to communicate securely?
• How to deal with unreliable connections?
• How to handle Geo-Location?
• How to deal with map data?
?
✔
18. Highly scalable
Pub/Sub broker
MQTT
Subscribers
Publishers
Secure by default
Connect securely via X509 certs and
TLS v1.2 client mutual auth
Multi-protocol message gateway
Millions of devices and apps can connect
over MQTT or HTTP
topic
Elastic Pub/Sub broker
Go from 1 to 1 billion long-lived, bi-directional
connections with zero provisioning
AWS IoT: Securely connect devices
21. Devices in motion: Challenges
• How to handle constrained resources?
• How to manage millions of things?
• How to communicate securely?
• How to deal with unreliable connections?
• How to handle Geo-Location?
• How to deal with map data?
?
✔
✔
22. AWS IoT security
Authentication Authorization
MQTT/HTTP over TLS v1.2
(X.509 certs) cipher suites
TLS mutual auth:
(Client/server certificates for things)
HTTPS over sigv4 (for apps)
Amazon Cognito/IAM (for mobile apps)
Certificates are attached to policies
Policies (JSON) give granular access
to AWS IoT control and data plane
Policies allow and deny permissions on
specific resources
(rules, shadows, topics)
24. Devices in motion: Challenges
• How to handle constrained resources?
• How to manage millions of things?
• How to communicate securely?
• How to deal with unreliable connections?
• How to handle Geo-Location?
• How to deal with map data?
?
✔
✔
✔
26. AWS IoT Device Shadows flow
Shadow
Thing
SDK
1. Device publishes current state
2. Persist JSON data store
3. App requests device’s current state
4. App requests change the state
5. Device Shadow syncs
updated state
6. Device publishes current state
7. Device Shadow confirms state change
27. Devices in motion: Challenges
• How to handle constrained resources?
• How to manage millions of things?
• How to communicate securely?
• How to deal with unreliable connections?
• How to handle geo-location?
• How to deal with map data?
?
✔
✔
✔
✔
28. Geo-location and mapping use cases
• Tracking
• Geo-fencing
• Find nearby objects
• Alert nearby things
• Map matching
• Routing
29. Geohashing
• Easy to compute
• Arbitrary precision
• Similar positions yield
similar prefixes
• Removing characters reduces
precision
• Simple way to look up and manage
geo objects
Picture: https://github.com/stephenlb/geohash-chat-by-proximity
30. Distribute messages to geo-located things with
topic tiles
• One topic per geohash
• Things subscribe to their
current geohash tile’s topic
as they move
• Send messages to tile topics
• Use geohash lengths to
change area impact of
message
31. Geo library for Amazon DynamoDB
• Ready-to-use Java JAR
• Library and sample apps
available on GitHub
• Supports GeoJSON
• Uses geohashes for
DynamoDB local
secondary indexes
• Simplifies box and radius
queries
32. AWS IoT Service and DynamoDB with
Geohashing Architecture
Rules Engine
Send
lat/lon AWS Lambda +
Geo library for
Amazon DynamoDB
Look up
geohash
Moving
thing
Amazon
DynamoDB
Return
matches
1 2
34
5
33. Amazon RDS for PostgreSQL with PostGIS
• Powerful support for:
• Geo data formats
• Geometric projections
• Transform operations
• Query functions
• Well understood, easy
to use
• Supported on Amazon
RDS for PostgreSQL
34. AWS IoT and Amazon RDS for PostgreSQL
Rules Engine
Send
lat/lon AWS Lambda
Geo-
queries
Moving
thing
Amazon RDS
for PostgreSQL
Return
matches
1 2
34
5
35. Processing map graphs with TitanDB
• Scalable graph database
• Import maps as graphs
• Supports routing and
other complex map
queries
• Amazon DynamoDB
storage back end for
TitanDB available
36. AWS IoT and
Amazon DynamoDB for TitanDB
Rules Engine
Send
lat/lon AWS Lambda
Map
queries
Moving
thing
Amazon
DynamoDB
Return
matches
1 2
34
5
TitanDB +
Amazon DynamoDB
back end
37. Amazon Elasticsearch Service
• Powerful, real-time, distributed, open-source
• Supports geolocation searches:
• Geo-points, geohashes, geo-aggregations, geoshapes
Amazon Elasticsearch Service
• Managed service
• Easy to set up, scale, operate
38. AWS IoT and Amazon Elasticsearch Service
architecture
Rules Engine
Send
lat/lon AWS Lambda
Run
queries
Moving
thing
Amazon
Elasticsearch
Service
Return
matches
1 2
34
5
39. Devices in motion: Challenges
• How to handle constrained resources?
• How to manage millions of things?
• How to communicate securely?
• How to deal with unreliable connections?
• How to handle geo-location?
• How to deal with map data?
✔
✔
✔
✔
✔
✔
40. Summary
• Use AWS IoT to manage and communicate with your
things
• Scalable, easy to use MQTT pub/sub message broker
• Powerful AWS IoT Rules Engine
• Use AWS IoT Device Shadows for unreliable connections
• Take advantage of AWS Lambda to connect to geo-aware
services:
• Amazon DynamoDB with geohash and/or TitanDB support
• Amazon RDS for PostgreSQL with PostGIS
• Amazon Elasticsearch Service
45. Don’t Miss These Other AWS IoT Deep Dive Talks!
• MBL203 State of the Union – San Polo 3501B 11:00 AM
• MBL203 Everything about AWS IoT – Venetian H 12:15 PM
• MBL311 AWS IoT Security – Palazzo A 1:30 PM
• MBL312 Rules and Shadow – Palazzo A 2:45 PM
• MBL313 Devices SDK and Kits – Palazzo A 4:15 PM
• MBL303 Mobile Devices and IoT – Delfino 4005 4:15 PM
• MBL305 IoT Data and Analytics – Delfino 4005 11:30 AM