Handling data

Handling data — classify what you've got, then pick your methods

A flow's data isn't one thing. First classify each signal — by shape, purpose, and direction — then select the handling methods each kind needs. Building a flow you'll usually reach for more than one: separate the paths, pace the flow, hold state in context, manage config. Start in the first tab; the rest are the methods you choose from.

Know what kind of data you're handling — before you pick any method, name each signal by its shape, its purpose, and its direction. What a signal is decides how you move it, how fast, and where it's stored. Mixing kinds — and polling everything at the fastest rate — is what creates load a controller can't sustain.

Every point you touch is some combination of the three:

By shape — is it an event or a stream?

  • Event — something happened at a moment: a button press, a state change, a fault, a batch complete. Discrete and irregular, and each one matters on its own. You handle it when it fires — you don't poll for it.
  • Stream — a continuous series of readings sampled on a clock: temperature, flow, level, vibration. Regular and high-volume, where the latest value usually matters more than any single earlier one. You read it at a cadence and often only keep the trend.

By purpose — what is the value for?

a signalevent or streamTelemetryobserve & trend · latency-tolerantControldrives a decision · time-criticalConfigshapes the app · written rarely
  • Telemetry — readings you observe and trend. Continuous and latency-tolerant: a second late only moves a timestamp.
  • Control — a value that drives a decision or an actuator. Small and time-critical: a second late changes an outcome.
  • Config — a setting that shapes how the app runs. Written rarely, read often.

By direction — read or write?

Reading a value out of a device and writing one back into it are not the same cost or risk. Writes touch the process; treat them with more care and a tighter path than the reads you take for observation.

Put it together — for each point, ask: event or stream? Does a delay change a decision or only a timestamp? Read or write? Those three answers set its rate, its path, and its store — and point you at the methods in the next tabs. The common mistake is treating every point as one population and polling all of it at the fastest rate; usually only a handful genuinely need the fast path, and the rest just starve the ones that do.