flowchart LR
event[Physical event] --> sample[Sample and timestamp]
sample --> queue[Local queue and retries]
queue --> decide{Who can meet the budget?}
decide -->|Immediate action| edge[Edge owns response]
decide -->|Site coordination| fog[Fog owns response]
decide -->|Delay tolerated| cloud[Cloud owns response]
edge --> evidence[Retain evidence and retest trigger]
fog --> evidence
cloud --> evidence
evidence --> fallback[Define fallback when the path misses]
2 Latency Budgets for Tier Choice
Build Measured Response Budgets Before Choosing a Tier
2.1 Start Simple
Imagine a vibration sensor notices a motor fault and must stop a machine before damage spreads. The first question is not where the code is fashionable; it is how many milliseconds the whole loop can spend from sensing to actuation. Everyday IoT latency work starts by timing that loop, then moving only the responsibilities that miss the budget closer to the device. Start with one event, one deadline, one fallback action, and one owner for the measurement.
2.2 Learning Objectives
After this chapter, you should be able to:
- define a latency budget from physical event to useful response;
- separate immediate response ownership from later review evidence;
- identify the path segments that belong in a latency decision record;
- explain why averages can hide placement failures;
- state when edge, fog, cloud, or a hybrid split is defensible.
2.3 Start the Clock at the Physical Event
A latency budget starts when the physical condition changes, not when the dashboard receives a message. A cold-room door sensor may need a local alarm within a site-defined window, while the supervisor dashboard and monthly energy review can wait. If local firmware can alarm reliably during backhaul loss, the edge can own the immediate response. The fog gateway can still coordinate nearby devices and buffer records, while the cloud receives the event later for reporting.
Build a response budget first, then assign ownership to the closest tier that can meet it and preserve review evidence.
2.4 Tier Ownership From the Budget
2.4.1 Edge Owns Immediate Response
Use edge ownership when the device must respond locally, such as a safety stop, local lockout, fast warning, or minimum safe fallback during an upstream outage.
2.4.2 Fog Owns Site Coordination
Use fog ownership when the decision needs a gateway, local policy, multiple nearby devices, protocol translation, buffering, or a site-wide view.
2.4.3 Cloud Owns Fleet Review
Use cloud ownership when the response can wait and the value comes from long-term storage, dashboards, model training, governance, or cross-site comparison.
2.5 Measure the Path, Not the Label
A latency decision record should show the start event, stop event, path segments, measurement method, stressed condition, accepted percentile, owner, and retest trigger. The record should explain why the chosen tier is acceptable and what evidence must remain visible after deployment.
Path Segment
Evidence to Measure
Common Mistake
Retest Trigger
Sensing
Sampling interval, interrupt behavior, timestamp source, sensor warm-up, debounce, and local queue delay.
The response clock starts at message receipt instead of the physical event.
Sensor, firmware, sampling policy, calibration, timestamp source, or event definition changes.
Network and gateway
Radio delay, retries, queueing, gateway buffering, protocol translation, uplink outage behavior, and replay rules.
One healthy link measurement is treated as proof for congested, weak-signal, or outage conditions.
Topology, gateway, backhaul, antenna, channel, retry policy, protocol, or site load changes.
Processing and command
Rule or model execution time, queue priority, command authorization, actuator command delivery, and fallback behavior.
Model inference is measured alone while preprocessing, postprocessing, and actuation are ignored.
Model, rule, device class, actuator, command policy, security check, or software version changes.
Review evidence
Logs, trace IDs, retained samples, decision version, owner, incident record, and cloud or site upload behavior.
Fast response works, but later reviewers cannot reconstruct what happened or why.
Retention, privacy policy, upload path, dashboard, audit rule, ownership, or incident workflow changes.
Prefer percentile evidence over averages when the workload is safety-related, control-related, or user-facing. The relevant percentile depends on the risk and operating agreement; the decision record should state which percentile is accepted and what load condition it represents.
Latency decision record Workload: physical event, required response, and user or equipment impact. Start and stop points: what starts the timer and what counts as successful response. Segment budget: sensing, network, queueing, processing, command, actuation, and evidence upload. Tier owner: edge, fog, cloud, or hybrid ownership with fallback behavior. Measurement evidence: normal load, stressed load, tail latency, jitter, missing records, and failed-path behavior. Retest trigger: sensor, firmware, model, gateway, topology, network, actuator, policy, workload, or ownership change.
2.6 Tail Latency Is Where Placement Fails
Many placement failures hide in the slow cases. A path may look acceptable when a device is idle, a gateway is nearby, a queue is empty, and the cloud service is healthy. The same path may miss its response budget during radio retries, gateway overload, cold starts, model loading, authentication checks, congestion, actuator delay, or an upstream outage.
For a tail-latency review, trace one event through every boundary. A vibration threshold might wait for the next sensor sample, retry on a noisy radio link, sit behind a gateway upload, run a model, request command authorization, and then wait for the actuator to respond. Each segment can be small alone, yet the combined slow path can exceed the budget. Placement is credible only when the measured trace includes those waits and the fallback path.
2.6.1 Queue Boundaries
Queues form at sensors, gateways, brokers, cloud workers, command paths, and actuators. A queue that preserves throughput can still break a response budget.
2.6.2 Clock Boundaries
Mixed clocks can make evidence misleading. Response records should preserve enough timestamps or trace IDs to reconstruct the path.
2.6.3 Fallback Boundaries
When a path misses the budget, the system needs a defined local fallback, degraded mode, retry policy, or human-review route.
Cloud is not wrong for latency-sensitive systems; it is wrong as the sole owner of an immediate physical response unless the measured path proves it. A common hybrid pattern is edge for the minimum safe action, fog for site coordination and buffering, and cloud for history, comparison, governance, and model improvement.
The under-the-hood rule is to review the worst useful path, not the happiest path. If the design depends on an edge model, measure preprocessing, inference, postprocessing, command output, and fallback. If the design depends on a gateway, measure local queueing and outage behavior. If the design depends on cloud, measure the full upstream and downstream path under the relevant operating condition.
2.7 Response Budget Flow
2.8 Summary
- Edge-fog latency is an end-to-end response budget from physical event to useful system response.
- The path includes sensing, queueing, network transfer, gateway behavior, processing, command delivery, actuation, and retained evidence.
- Edge ownership fits immediate local action; fog ownership fits site coordination; cloud ownership fits history, governance, training, and fleet review when delay is acceptable.
- A latency decision record should state start and stop points, segment budgets, measurement conditions, accepted percentile, owner, fallback, and retest trigger.
- Averages can hide the slow cases that matter; tail latency, jitter, congestion, retries, and outages need explicit review.
- Retest latency after sensor, firmware, model, gateway, topology, network, actuator, command policy, workload, or ownership changes.
Choose edge, fog, or cloud ownership from measured response budgets. The correct tier is the one that meets the workload’s timing need, preserves evidence, and has a defined fallback when the path weakens.
2.9 See Also
Edge, Fog, and Cloud Architecture
Map response ownership into device, gateway, site, regional, and cloud layers.
Edge Bandwidth Optimization
Review what should cross constrained links after latency ownership is clear.
Edge-Fog Decision Framework
Combine latency with bandwidth, privacy, autonomy, power, operations, and governance evidence.
Edge-Fog Labs
Practice measuring local response, site coordination, evidence retention, and failure behavior.