Daniel VossProduct engineer

Harbor Logistics · 2023

Harbor

A tracking pipeline that dropped events under load and could not say which ones. I rebuilt the ingest path and made loss visible before it became a support ticket.

ClientHarbor Logistics
RoleBackend engineer
Year2023
StackGo, Kafka

Challenge

Harbor tracked shipments for 340 freight forwarders. Every scan from every warehouse arrived as an event, and the pipeline that carried them was a queue, a consumer and a hope. When a carrier sent a burst, the consumer fell behind, the queue dropped the oldest events, and the first anyone knew was a customer asking where their container was.

The pipeline had no dead letter path, no per-carrier metrics, and no way to replay a day.

Approach

I replaced the single consumer with Kafka partitioned by shipment ID, which keeps events for one shipment in order and lets consumers scale horizontally. Ingest writes to ClickHouse in batches with an idempotency key, so a replay is safe and a duplicate is a no-op.

Every stage emits counts by carrier and by result, and a dead letter topic takes anything that fails three times with the original payload intact. A replay tool takes a time range and a carrier and puts those events back through, which turned a two-day investigation into a fifteen-minute job.

Cost came down as a side effect: ClickHouse compresses the event table hard, so we replaced a managed search cluster with a smaller one and cut ingest spend by 28%.

Result

The pipeline has held 99.98% uptime across eighteen months and 2.1 million events a day, including two carrier bursts that would previously have dropped events silently.

Support tickets for missing scans fell by roughly two thirds. The replay tool is now used by the operations team without engineering involvement.

2.1Mevents a day
99.98%pipeline uptime
−28%ingest cost
“We used to find out about lost events from customers. Now we find out from a dashboard, usually before they do.”
Ines Duarte, Director of Operations, Harbor Logistics

Stack

Go services on Kubernetes, Kafka with per-shipment partitioning, ClickHouse for the event store, Prometheus and Grafana for per-carrier metrics.

GoKafkaClickHouseKubernetes