Skip to content

Instantly share code, notes, and snippets.

@routevegetable
Last active March 4, 2016 23:25
Show Gist options
  • Save routevegetable/9e93c8c70ce834204019 to your computer and use it in GitHub Desktop.
Save routevegetable/9e93c8c70ce834204019 to your computer and use it in GitHub Desktop.
MQTT Data Types
Status: retained messages signalling the current state and liveness, republished any time and always on change.
Edge: definite change notifications (easily available from status)
Delta: stream of summary messages, summarizing a prior time slice.
Status messages convey liveness information via a heartbeat policy. A null message forces a status topic to 'expire'.
Edge topics are not retained.
Deltas can be aggregated arbitrarily via summing to make larger deltas.
Boolean and summable/averageable status messages convert trivially to deltas by assigning the time between two messages to the first message.
Does publishing deltas hold an advantage over just publishing status messages?
Are they more robust? No, as a device dropout between status updates has the same consequences as dropout during a delta recording.
In situations with frequent status changes (which aren't individually important), deltas are a good choice. They also have a hard limit to publishing rate.
Useful would be a software library for use on a data producer or consumer which can convert from status updates to deltas.
There's no real advantage in publishing edges over status updates, but this is something else standard we could use on the consumer side.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment