References
https://d1.awsstatic.com/whitepapers/Designing_MQTT_Topics_for_AWS_IoT_Core.pdf
MQTT Communication Patterns
- Point to Point
- different devices subscribe to the topic relevant to itself
- Broadcast
- multiple devices subscribe to same topic
- Fan-in
- multiple devices publish to same topic
- avoid using fan-in to a single end device (?); use fan-in to route a large fleet of messages via IoT Rules Engine.
- because this routing may hit a non-adjustable limit on a single device MQTT connection (!!!)
MQTT Communication Patterns
- device to device
- device to cloud
- cloud to device
- include session information for tracking purpose
- device to/from users
MQTT Design Best Practices
General Best Practices
- topic level: lowercase letters, numbers and dashes
- general to specific
- include any relevant routing information in topic
- prefix to distinguish data and command topics
- document topic structure as operation practices
- use IoT Thing name as MQTT client ID – easy to correlate for logging and policy purpose
- including Thing Name in any MQTT message published by a thing or sending to a specific thing
- review the limitations
- include contextual information in payload messages
- avoid fan-in to a single device – do not allow a single device subscribe to a shared topic (!!!)
- never allow device to subscribe to all topics (#); Use single level wildcard (+) for IoT Rules