5 Acquisition Timing and Buffer Contracts
More
Depth: Practitioner
Progress saves as you read. Mark sections complete as you go; your progress appears in the sidebar.
5.1 Start With the Story
This section: Start With the Story — Imagine a vibration sensor that records a machine jolt during a network outage.
Imagine a vibration sensor that records a machine jolt during a network outage. The reading has an event time, an arrival time, and a place in a waiting queue. A buffer is temporary storage for data that cannot be handled at once. A gateway is a local bridge from devices to another system.
Start with how late a reading may arrive and still be useful. Record the clock source, event time, arrival time, order rule, and buffer limit. Then test a full buffer, a clock jump, a repeated record, and a long outage. The system should mark lost or late data instead of quietly changing the story.
Use a timing ledger for one record. Write when the event happened. Write which clock made that time. Write when the device saved it. Write when the next service received it. Keep a unique record key. State how late is too late. Set the queue size. State which record is dropped first. Mark gaps and repeats. Set the recovery send rate. Protect new urgent data during a backlog.
Measure a normal burst and an outage burst. If the buffer cannot hold the needed window, narrow the claim or add storage. Do not let delayed data look live.
This simple queue assumes a known rate and one path. Real devices burst, clocks drift, and services recover at different speeds. The Practitioner section builds timing and buffer contracts. Under the Hood derives queue, clock, and recovery limits.
Set the queue and clock contract against burst rates and recovery delays so late readings stay identifiable.
Acquisition timing and buffers narrated tour
Follow a sampled jolt through an outage, a full gateway buffer, and delayed replay. Play, pause, replay a beat, or choose a still frame with Reduced motion. Record shapes and motion are schematic; the storage comparison uses the chapter’s worked example.
Full transcript — acquisition timing and buffers (8 beats)
B1 — Outage and jolt
You are the engineer responsible for a machine’s vibration records when its cellular connection fails. A sensor records a jolt during the outage. Afterward, someone must decide whether the evidence is complete or missing. Your gateway, the local bridge between devices and another system, has limited room to keep those readings.
B2 — Event and receive time
A buffer is temporary storage for data waiting to be handled. When possible, keep two times for each reading. Event time records when the measurement happened, as close to the sensor as possible. Receive time records when the gateway or server received it. Keeping both makes network and buffer delays identifiable.
B3 — Incoming data rate
Suppose the gateway receives one hundred vibration summaries each second, with forty-eight bytes in each record. Multiply one hundred by forty-eight: four thousand eight hundred bytes arrive every second, or four point eight kilobytes per second. During the outage, those records need local storage while they wait for transmission.
B4 — Capacity versus outage
The available buffer holds sixty-four kilobytes. Divide sixty-four by four point eight: it holds about thirteen seconds of readings. A two-minute outage produces about five hundred seventy-six kilobytes of backlog. The buffer cannot retain that whole history. Its capacity forces a decision long before the connection returns.
B5 — Drop oldest and mark gaps
Declare the full-buffer rule before the outage. With a policy called drop oldest, recent readings stay, while older evidence may be lost. Mark the dropped intervals in the record metadata, the information describing the readings. Your later review can then identify which part of the machine’s history is missing.
B6 — Delayed does not mean new
The misconception is that a reading arriving after recovery describes the machine at that moment. Arrival includes time spent waiting in the buffer and travelling through the network. A delayed reading still belongs to its original event time. Receiving it later does not make the old jolt a new event.
B7 — Controlled recovery
When the connection returns, the old jolt keeps its original event time and carries a delayed label. Its unique record key lets your later review identify repeated copies. Meanwhile, a controlled send rate leaves room for new urgent readings as stored history travels onward.
B8 — Trustworthy history
For your gateway, about thirteen seconds of storage cannot preserve two minutes of readings unchanged. The record must carry the consequences of the chosen policy. A trustworthy record tells you when the jolt happened and which parts of its history are missing.
5.2 Learning Objectives
This section: Learning Objectives
After this page, you should be able to:
- Explain why event time, receive time, and clock source must be recorded separately.
- Choose NTP, PTP, or hardware timestamping based on sensor timing tolerance.
- Design bounded buffers and backpressure policies before outages or bursts occur.
- Pass acquisition metadata downstream so analytics can distinguish real events from timing, drift, or queue artifacts.
5.3 Why This Follows Edge Data Architecture
This section: Why This Follows Edge Data Architecture — Edge Data Architecture classifies IoT device categories, connectivity paths, data volumes, and acquisition strategies.
Edge Data Architecture classifies IoT device categories, connectivity paths, data volumes, and acquisition strategies. This page narrows in on the deeper contract that makes those architectures trustworthy: how samples are timed, buffered, synchronized, and described before they reach analytics.
Use it when a gateway, sensor fleet, or analytics pipeline must combine multiple sources, survive link outages, or support post-incident review where the difference between event time and arrival time matters.
5.4 Analytics Inherits Acquisition
This section: Analytics Inherits Acquisition — Every analytics result rests on the data acquisition pipeline that produced its inputs.
Every analytics result rests on the data acquisition pipeline that produced its inputs. That pipeline runs from the physical phenomenon to a clean, timestamped, buffered stream: transducer → signal conditioning → ADC sampling → timestamping → buffering → local processing → transmission. Each stage can quietly corrupt the data, and downstream analytics will faithfully compute on the corruption.
One stage is deceptively critical: the timestamp. A value without an accurate time is nearly useless for correlating events or fusing sensors, and accurate timestamps require the devices' clocks to be synchronised. Getting acquisition right — especially time — is the unglamorous foundation of trustworthy analytics.
Intuition: analytics is only as honest as its raw inputs. A brilliant model fed mistimed, poorly conditioned samples produces confident nonsense — garbage in, garbage out, dressed up in charts.
Worked example: a greenhouse controller reads a soil-moisture probe through an ADC, a Modbus temperature sensor through a gateway, and a camera through Wi-Fi. If the ADC channel is sampled every minute, the Modbus poll runs every five minutes, and the camera reports only motion summaries, the analytics layer must preserve those differences instead of pretending all evidence is equivalent. The acquisition record should say which device produced the value, how it was conditioned, when it was sampled at the source, what local filter or aggregation was applied, and whether the gateway forwarded a raw value, a rolling average, or an event record.
That record is what lets an engineer debug a bad recommendation later. If plant-stress alerts appear ten minutes late, the fault may be the sampling interval, gateway buffering, clock drift, or a cloud model threshold. Without the acquisition contract, every downstream component can look correct while the system still acts on stale or misaligned measurements.
Overview Knowledge Check
The mathematical gist. A catalog-typical 500 Hz vibration band needs at least 1,000 raw samples per second before it becomes this chapter’s 100 Hz summary stream. A 12-bit, 3.3 V ADC adds a separate 0.806 mV step and 0.233 mV RMS rounding noise. The chapter’s 50 ppm clock then drifts 180 ms in one hour, equal to 18 intervals in the 100 Hz stream. Sampling, quantization, and time alignment are independent ledger lines: fixing one does not repair either of the others.
5.5 Why Timestamps Need Sync
This section: Why Timestamps Need Sync — Worked example continuation: imagine the same gateway also receives pressure samples at 10 Hz and vibration samples at 100 Hz.
To compare or fuse data from multiple sensors, their timestamps must share a common time base, which means synchronising clocks:
NTP (Network Time Protocol): syncs clocks over a network to ~milliseconds
PTP / IEEE 1588 (Precision Time Protocol): sub-microsecond on a LAN with
hardware timestamping
Timestamp at the SOURCE (event time), not on arrival (arrival is delayed)
Worked example: a 50 ms clock skew wrecks a fusion
Two sensors each sample a shared 100 Hz signal (one sample every 10 ms). Their clocks differ by 50 ms. 50 ms / 10 ms = 5 samples of misalignment. When you fuse or correlate them, features line up 5 samples apart -> the fusion sees a phantom lag, cross-correlations peak in the wrong place, and event matching fails. NTP (~ms) may be borderline here; PTP (sub-microsecond) removes the skew entirely for tight multi-sensor work.
The lesson is that time is data. An accurate value at the wrong time is a wrong value for any analysis that combines sources, so clock sync is not a nicety — it is part of the measurement.
Worked example continuation: imagine the same gateway also receives pressure samples at 10 Hz and vibration samples at 100 Hz. If the system stores only arrival order, a network burst can make an older pressure sample look newer than a vibration sample that was actually captured later. A practical design stores source event time, clock source, sampling rate, and gateway receive time for every record. Then the fusion job can resample onto a common timeline, reject stale values, and flag when the clock source is outside tolerance instead of silently correlating the wrong measurements. The operator view can also show a clock-health badge, so a maintenance engineer knows when a strange correlation came from the plant rather than from the timing system.
Practitioner Knowledge Check
5.6 Event Time, Buffers, and Drift
This section: Event Time, Buffers, and Drift — The acquisition layer should store two times when it can: event time, captured as close to the sensor as possible, and receive time, recorded by the gateway or server.
The acquisition layer should store two times when it can: event time, captured as close to the sensor as possible, and receive time, recorded by the gateway or server. Event time orders the physical process; receive time diagnoses network and buffer delay. When both are present, a later analytics job can tell whether a point was genuinely late, delayed in transit, or replayed after an outage.
Clock drift turns into real alignment error quickly. A modest 50 ppm oscillator can drift about 180 ms in one hour because 3600 seconds times 50 / 1,000,000 equals 0.18 seconds. For a slow temperature trend that may be tolerable. For a 100 Hz vibration stream, where samples are 10 ms apart, the same one-hour drift is 18 samples of timing error. That is enough to break correlation, phase estimates, and event matching even when every value is numerically correct.
Buffers need the same explicit design. Suppose a gateway receives 100 Hz vibration summaries at 48 bytes per record, or 4.8 kB/s. A 64 kB buffer holds only about 13 seconds of that stream before it must block, drop, or aggregate. During a two-minute cellular outage, the raw backlog would be about 576 kB, far beyond that small buffer. The architecture therefore needs a declared policy: keep newest raw samples, downsample older data, emit min/max/RMS summaries, or mark gaps.
The contract passed downstream should include the sample rate, source timestamp, clock source, sequence number, gateway receive time, buffer policy, and quality flags. These fields are not bureaucratic metadata; they are how a dashboard distinguishes a real plant event from clock drift, link congestion, gateway reboot, or silent packet loss.
Event time vs arrival time
Network and buffering delays make the moment data arrives an unreliable clock. Timestamp at the source (event time) so ordering and analysis reflect when things happened, not when they showed up.
Buffering and backpressure
A bounded buffer smooths bursty acquisition against a slower link. When it fills, you must drop, block, or aggregate — a deliberate policy, because an unmanaged full buffer silently loses data.
Clocks drift
Cheap oscillators drift by parts per million, so a one-time synchronisation degrades over hours. Clocks must be re-synced periodically to keep timestamps accurate over a long deployment.
The acquisition contract
Downstream stages assume samples are properly conditioned, sampled at a known rate, and accurately timestamped. Break that contract quietly and every later analytic inherits the flaw with no warning.
So the acquisition architecture is a contract, not a formality: condition the signal, sample at a known rate, timestamp at the source on a synchronised clock, and manage the buffer explicitly. Honour it and analytics can trust its inputs; break any clause — especially time — and the most sophisticated model downstream is computing on data that never meant what it claims.
Worked example: a gateway with a 1,000-record ring buffer receives vibration samples faster than its cellular link can upload during a network outage. A good architecture declares the policy before the outage: keep the newest second of raw samples, aggregate older samples into min/max/RMS summaries, and mark any dropped intervals in metadata. A weak architecture just overwrites records silently. Both systems may show a smooth dashboard later, but only the first one tells the analyst which evidence is complete, summarized, or missing. That distinction matters when a post-incident review asks whether the vibration spike was absent, averaged away, or lost during backpressure.
Under-the-Hood Knowledge Check
5.7 Release Checklist
This section: Release Checklist
Before shipping an acquisition timing contract, verify these records:
- Each record carries source event time, gateway receive time, clock source, sequence number, and sample rate.
- Clock synchronization tolerance is matched to the fastest signal being fused, and drift is monitored after startup.
- Bounded buffers declare what happens when full: block, drop newest, drop oldest, aggregate, or mark gaps.
- Store-and-forward replay preserves original event time and records delayed receive or replay status.
- Downstream dashboards and models can see quality flags for stale, delayed, summarized, dropped, or clock-uncertain samples.
5.8 See Also
This section: See Also
- Edge Data Architecture for device categories, data volumes, and acquisition strategies.
- Edge Acquisition Sampling and Compression for data-reduction methods.
- Radio Budget and Gateway Aggregation Contracts for radio and gateway summary tradeoffs.
- Multi-Sensor Data Fusion for downstream fusion requirements.
5.9 Next
This section: Next — Return to Edge Data Architecture, then continue to Edge Acquisition Sampling and Compression to reduce data volume while preserving timing evidence.
Return to Edge Data Architecture, then continue to Edge Acquisition Sampling and Compression to reduce data volume while preserving timing evidence.
Find help
3 reviewed answers.
Where should I start in a module?
Open the module page from the sidebar to see its chapters in order. Use the module map to return to a topic you need.
Modules and pathsReviewed
What can I try when a project does not work?
Check the symptom, then work through the diagnostic steps. Keep the error message and the smallest example that reproduces it.
When you are stuckReviewed
How do interactive examples work?
Use the interactive guide to check how examples and simulations work before changing your project.
Interactive examples guideReviewed
