Problem: Fire-and-forget UDP: on cellular handoff, gap between last and next received point could be 8–12 minutes. Vehicles disappeared and reappeared at new locations. Regulated cargo compliance required unbroken chain of custody.
Solution: Go edge collector on gateway device: GPS frames written to local SQLite with monotonic sequence numbers, forwarded with ACK. No ACK in 5 seconds = retransmit from last unacknowledged sequence. On reconnect: batch-send all buffered points. Cloud-side Kafka topic partitioned by vehicle ID for ordering. Stream processor detected sequence gaps and requested replay from edge SQLite buffer (72-hour retention).
Technology: Go · SQLite · Kafka · Kubernetes · Protobuf · QUIC
Optimisation pattern: fire-and-forget-udp-to-sequence-numbered-outbox-with-server-reconciliation
Outcomes:
Zero GPS point gaps in 6-month post-launch audit (vs ~340/day). Handoff recovery time: 8–12 min → under 30 seconds. Peak ingest: 12M points/hour. Compliance audit (regulated cargo): passed.