Some device are only intermittently online. To allow other components to interact with them regardless of their connection state, store a persistent virtual representation of the devices online. Use this representation for all communication and synchronize it with the device once it is back online.
Thing Shadow, Virtual Device
Devices, such as Constrained Devices, Semi-Constrained Devices, and Unconstrained Devices, are often Normally-Sleeping Devices or Always-On Devices. Either because of their operation modes or because of external circumstances, these devices might be offline at various times.
Some devices will be only intermittently online in order to save energy or because of network outages. Other components want to interact with them but do not know when they will be reachable.
Availability: Sending commands to or reading state from offline devices is not possible.
Timeliness: Waiting for currently offline device to come online again to send or receive data in a synchronous fashion can lead to long idle times and should be avoided.
Consistency: Often a slightly out-of-date state is better than no state.
Store a persistent virtual representation of each device on some backend server. Include the latest received state from the device, as well as commands not yet sent to the device. Do all communication from and to the device through this virtual version. Synchronize the virtual representation with the actual device state when the device is online.
- L. Reinfurt, U. Breitenbücher, M. Falkenthal, F. Leymann, and A. Riegg, “Internet of Things Patterns,” in Proceedings of the 21st European Conference on Pattern Languages of Programs (EuroPLoP), ACM, 2016. Available at http://dl.acm.org/citation.cfm?id=3011789