Sending instructions.
WHAT MAKES IT HARDER THAN SENDING DATA
The device may be asleep, disconnected, or unreachable behind a network.
WHAT THE APPROACHES ARE
A persistent connection the device maintains Polling by the device for pending commands Waking the device by a network mechanism
WHAT PERSISTENT CONNECTIONS COST
Power, continuously.
WHAT POLLING COSTS
Latency, determined by the interval.
WHAT TO CHOOSE
Based on how quickly commands must take effect.
WHAT EVERY COMMAND NEEDS
A unique identifier An expiry, after which it should not be executed Acknowledgement of receipt Reporting of the outcome
WHY EXPIRY MATTERS
A command delivered days late may be harmful.
WHAT TO MAKE COMMANDS
Idempotent, so repeated delivery is harmless.
WHY
Delivery may be retried after uncertain acknowledgement.
WHAT DESIRED-STATE MODELS PROVIDE
The platform holding the intended configuration, and the device converging to it.
WHY THAT IS PREFERABLE TO COMMANDS
A disconnected device catches up on reconnection, with no queued instructions to replay.
WHAT TO REPORT
The device's actual state, separately from the desired one.
WHAT TO MONITOR
Divergence between them.