← Back to the chapter · Previous detail
Technical detail · Edge Computing Platforms
Edge as Distributed State
30.7 Edge as Distributed State
An edge system has state in several places: the device, gateway, local screen, and cloud. Decide who owns each state and what happens when they disagree. A late reading must not silently replace a newer alarm acknowledgement.
Each place can use a different clock. The device may stamp a reading, while the gateway and cloud record when they receive it. A late packet may appear after a newer local action. Record the source of each time, clock health, any sequence number, and the replay and stale-data rules. Test the order after a restart and a lost link.
Record who sent each command and whether it was allowed. Check its preconditions, action, acknowledgement, rejection, and safe fallback. If approval normally comes from upstream, state what happens when the link fails: block, queue, or permit a defined local action. For model-led actions, keep the model version, input, threshold, and human override with the event.
A full disk or busy processor can delay or discard events. Set limits for CPU, memory, storage, power, and heat. Then test at those limits and record whether the system slows input, keeps urgent events, drops data, restarts a service, or warns an operator. Include normal, lost-link, restart, pressure, and recovery cases in the handoff.
NTP and PTP are protocols that help clocks agree; record their health because a timestamp can still be wrong. An idempotency key identifies a command so a retry can be recognized as the same request instead of performing an action twice.
A monotonic sequence is a record number that increases in order. When timestamps disagree, the sequence can establish the order of records from the same source, provided resets and wraparound are handled.
Clock boundary: record device timestamp, gateway receipt timestamp, monotonic sequence, NTP/PTP state, late arrival rule, and stale-state label.
Command boundary: define local preconditions, authorization, idempotency key, actuator acknowledgement, rejection reason, safe fallback, and upstream reconciliation.
Resource boundary: budget CPU, memory, disk, thermal headroom, GPU/NPU use, network bandwidth, cellular data, power loss behavior, and log growth.
Sync boundary: define retained raw data, aggregated data, alarms, model outputs, local acknowledgements, conflict resolution, deletion policy, and upstream schema version.
A strong edge prototype can lose the WAN, restart the gateway, refill the buffer, reject bad input, recover sync, and still explain what the local actor saw and what the gateway did.