Ankit Patel
WritingPapersLabsAboutContact
Distributed Systems & Data··2 min read·575 views

Noon Arrives at Three

A visit happens at noon, the counting window closes, and the phone delivers its report hours later from the other side of a tunnel

A phone records a store visit at noon inside a subway station, stays offline for three hours, and uploads the batch at three. Every mobile event carries two timestamps: when the physical event happened and when the ingestion fleet received it.

A dashboard published at one o'clock obviously missed that noon visit. The real architectural question is what happens to the numbers at three.

Event-time stream processors group records by occurrence time despite out-of-order network delivery, yet no stateful operator can hold window state in memory forever. Sooner or later, the pipeline advances its watermark, emits an aggregate and reclaims state.

For mobile telemetry, a watermark is an engineering cutoff rather than proof of completeness. A streaming cluster cannot know which phones are still underground, in airplane mode or waiting on OS background upload budgets.

Operator defaults make silent data loss easy to miss. In Apache Flink 1.15's event-time windows, allowed lateness defaults to zero: once the watermark passes a window's close, straggling events for that window are dropped unless explicitly routed to a side output.

Cluster health metrics stay completely green while that happens. Consumer lag, checkpoint duration and task restarts say nothing about how many valid afternoon visits arrived past the watermark.

Make late-data volume a first-class metric first. Route late arrivals to a durable side output, track event-to-ingest delay distributions, and slice those delays by operating system, permission state and geography. Underground transit corridors, rural coverage gaps and aggressive Android battery savers do not drop events uniformly across venues.

Extending allowed lateness lets windows emit updated aggregates as stragglers arrive, which immediately changes downstream semantics. When noon's visit count emits 100 at 1:00 p.m. and 101 at 3:05 p.m., a naive consumer appending both messages records 201 visits. Retractions, upserts keyed by window ID, or versioned snapshots have to be part of the schema from day one.

Location products avoid endless reconciliation headaches when they publish two explicit tiers: a low-latency provisional stream for live operational awareness and a settled daily dataset cut after a documented arrival window.

Even a 24-hour cutoff stabilizes a report without making it omniscient. Some devices upload days later on Wi-Fi, and others never upload at all.

When a customer asks why Tuesday's settled table differs from Tuesday's live feed, 'the pipeline was green' has never satisfied me as an answer. At three o'clock, when that noon visit finally lands, the architecture should state unambiguously whether it updates a mutable view, waits for the daily settlement run, or sits in a late-arrival audit log.

Continue in Distributed Systems & Data