Device Shadow
also called Digital Twin, Reported and Desired State
A cloud-side representation of a device's last reported state and its intended state, letting applications interact with devices that are asleep or offline.
The pattern solves the fundamental awkwardness of IoT: devices are frequently unreachable — asleep to conserve battery, out of coverage, or on a duty cycle that connects for ten seconds an hour — and applications need to read state and request changes now.
The shadow holds two documents. Reported state is what the device last told the cloud. Desired state is what an application has requested. The difference between them is the pending work, and when the device next connects it receives the delta and acts on it, then updates reported state to confirm.
This decouples every application from device availability, which is what makes the rest of the architecture tractable: no service needs to know whether a device is currently online.
The semantics that must be handled explicitly are around staleness and conflict. Reported state has an age, and applications displaying it without that age imply a currency they do not have. A desired change that has been pending for three weeks may no longer be wanted, so pending intents need expiry. And when two applications set conflicting desired states, the last one wins silently unless the model includes versioning.