Home / Insights / Architecture and Modernization

Architecture and Modernization

Real-Time Shipment Tracking Architecture: Events, IoT Telematics and Customer Notifications

Customers expect to see where their delivery is and when it will arrive. Behind a simple tracking page sits a pipeline of device messages, scan events, status rules and notifications, and most tracking problems come from how those parts are designed, not from the map.

TopicsArchitecture and ModernizationMobile App DevelopmentBusiness Operations and Integration

Key takeaways

  • Separate raw telemetry (frequent GPS and sensor readings) from business events (picked up, delayed, delivered). They have different volumes, retention needs and consumers.
  • Design for unreliable connectivity: devices and driver apps will go offline, send duplicates and deliver messages out of order, so every consumer must be idempotent and order-aware.
  • A shared event envelope, such as CloudEvents, keeps scan events, telematics and partner updates consistent across services and makes later integration cheaper.
  • Customer notifications should be driven by meaningful status changes and ETA shifts, with throttling and collapse rules, not by every location update.
  • Start with a clear status model and a small set of events end to end, then add sensors, prediction and partner feeds once the core pipeline is observable and reliable.

Real-time shipment tracking has moved from a nice extra to a basic expectation. Shippers want visibility across carriers, receivers want an accurate arrival window, and operations teams want to know about delays before the customer calls. The tracking page is the visible part. Underneath it sits an architecture that has to ingest location and sensor data from vehicles and handheld devices, combine it with scan and proof-of-delivery events, decide what each shipment’s status really is, and tell the right people at the right moment.

This article is for CTOs, architects and product leads at logistics companies, couriers, fleet operators and shippers building or rebuilding tracking. It explains the core building blocks, the protocol and event-model choices, how to turn raw data into reliable statuses and ETAs, how to design customer notifications, and what to plan for in scale, cost and operations. It reflects the technology available in July 2025. PoliteTech’s logistics software work covers dispatch dashboards, driver apps, shipment tracking and notifications, and our Hire & Ride e-scooter platform, built with a Singapore team, involved similar real-time location and fleet problems.

What are the building blocks of a real-time tracking system?

Most tracking platforms, whatever their scale, have the same layers. Naming them explicitly helps you decide what to build, what to buy and where the boundaries sit.

  1. Data sources: vehicle telematics units, driver and courier mobile apps, handheld scanners, IoT sensors (temperature, door, shock), warehouse systems and carrier or partner APIs.
  2. Ingestion: a device gateway or message broker for telemetry, and APIs or webhooks for app and partner events.
  3. Event backbone: a durable stream or queue that decouples producers from consumers.
  4. Processing: enrichment (which shipment is on which vehicle), geofencing, status rules and ETA calculation.
  5. Stores: a time-series or location store for raw positions, an operational database for shipments and statuses, and an archive for audit and analytics.
  6. Delivery channels: customer tracking pages, push notifications, SMS and email, operations dashboards and outbound webhooks to shippers.

Telemetry versus business events

The most important design decision is to treat these as two different kinds of data. Telemetry is frequent, low-value per message and mostly needed for a short time: a GPS fix every few seconds or minutes. Business events are infrequent, high-value and must be kept: picked up, arrived at depot, out for delivery, delivery attempted, delivered. Mixing them in one table or topic creates cost and confusion. Telemetry should be processed into business events, not shown to customers raw.

Action: draw your current or planned system against these six layers and mark which components you will build, buy or integrate.

How should telematics and device data be ingested?

Vehicles and handheld devices work on mobile networks that drop, reconnect and change speed constantly. The ingestion layer must accept that reality.

MQTT for devices, HTTPS for apps and partners

MQTT is the usual choice for constrained devices because it is lightweight and designed for unreliable networks. The OASIS MQTT 5.0 standard defines three delivery levels: at most once (QoS 0), at least once (QoS 1, duplicates possible) and exactly once (QoS 2). It also defines a Will message that the broker publishes if a client disconnects unexpectedly, which is useful for marking a device as offline, and session and message expiry intervals that control how long state and messages remain valid.

Managed brokers do not always support every feature. For example, AWS IoT Core’s MQTT documentation states that it supports QoS 0 and 1 but not QoS 2, keeps unacknowledged QoS 1 messages for persistent sessions while a device is offline (with a default expiry of one hour that can be increased), and stores one retained message per topic for last-known state. Those details shape the design: if exactly-once delivery is unavailable, consumers must handle duplicates themselves.

Data typeSuggested transportDelivery levelNotes
Frequent GPS positionsMQTTQoS 0 or 1Losing an occasional fix is acceptable; batch on the device when offline
Sensor alarms (temperature, door)MQTTQoS 1Must arrive; consumers de-duplicate by event ID
Scans and proof of delivery from driver appsHTTPS API with offline queueRetry until acknowledgedInclude device timestamp and a unique event ID
Carrier and partner updatesWebhooks or polling APIsRetry with back-offNormalise into your own event format immediately

Offline-first driver apps

Drivers scan parcels in basements, rural areas and loading docks with poor signal. The app should store events locally, timestamp them on the device, and sync when connectivity returns. The backend must accept late events and place them correctly in the shipment timeline.

Action: list every data source with its expected frequency, connectivity conditions and the delivery guarantee you need. This list drives broker selection and costs.

What event model keeps the pipeline consistent?

Once data is inside the platform, consistency matters more than any individual technology choice. Each event should carry enough context to be processed independently, replayed and audited.

Use a common envelope

CloudEvents, a CNCF specification that reached graduated status in January 2024, defines a common way to describe event metadata such as source, type, ID and time. Adopting it, or a close equivalent, means scan events, telematics-derived events and partner updates all look the same to downstream services, and SDKs exist in several languages.

Fields every tracking event needs

  • Event ID: unique and generated at the source, so duplicates can be discarded.
  • Event time and received time: when it happened on the device versus when the platform received it. Both are needed to handle late data.
  • Subject: shipment, consignment, parcel, vehicle or device identifier.
  • Type: from a controlled vocabulary, for example shipment.picked_up or vehicle.geofence_entered.
  • Location and source: coordinates, facility or address, and which system or device produced it.
  • Data: type-specific details such as signature reference, temperature reading or failure reason.

Idempotency and ordering

With at-least-once delivery and offline devices, the same event can arrive twice and events can arrive out of order. Consumers should ignore event IDs they have already processed, and status logic should compare event times rather than arrival order. A “delivered” event that arrives before a late “out for delivery” event must not move the shipment backwards.

Record these decisions in writing. Our article on architecture decision records explains a lightweight way to do that so later teams understand why the event model looks the way it does.

Action: write the event catalogue, with types, required fields and owners, before building consumers.

How do you turn raw data into reliable statuses and ETAs?

Customers do not want coordinates; they want to know whether their delivery is on time. The processing layer translates telemetry and scans into meaningful states.

Status as a state machine

Define a shipment state machine with allowed transitions, for example created, picked up, in transit, at depot, out for delivery, delivery attempted, delivered, returned or exception. Each incoming event either triggers a valid transition or is recorded without changing state. This makes behaviour predictable and testable, and it stops contradictory statuses from appearing on the tracking page.

Geofences and enrichment

Geofences around depots, hubs and delivery addresses convert positions into events such as “arrived at depot”. Enrichment links vehicles to the shipments currently on board, using route or manifest data, so a vehicle position can update many shipments at once.

ETA approaches

ApproachHow it worksStrengthsLimitations
Planned scheduleETA from route plan and stop sequenceSimple, available before departureIgnores real-time delays
Routing service with live positionRemaining stops and travel times from a routing APIReflects traffic and current positionAPI cost per call; needs stop durations
Learned modelPredicts arrival from historical stops, time of day and areaCaptures local patterns, such as long dwell times at certain sitesNeeds good history and ongoing monitoring

Many teams start with planned schedules plus routing updates at key points, then add learned adjustments for stop duration once enough history exists. Show arrival windows rather than exact minutes, and widen the window when confidence is low.

Action: agree the state machine and the ETA display rules with customer service before engineering starts. They handle the calls when statuses confuse customers.

How should customer notifications be designed?

Notifications are where tracking either builds trust or creates noise. The rule is to notify on changes a customer can act on, not on every update.

Choose the triggers

  • Shipment dispatched or out for delivery, with an arrival window.
  • Significant ETA change beyond an agreed threshold.
  • Delivery attempted or failed, with options to rearrange.
  • Delivered, with proof of delivery where appropriate.
  • Exceptions that need action, such as address problems or customs holds.

Channel behaviour matters

Push notifications have platform rules worth designing around. Google’s Firebase Cloud Messaging documentation explains that collapsible messages can be replaced by a newer message with the same collapse key if the earlier one has not been delivered, which suits “latest ETA” updates. It also sets a 4 KB limit on data message payloads, lets you set a time to live so stale messages are dropped, and distinguishes normal from high priority, where high priority can wake a sleeping device and uses more battery. An ETA update that arrives an hour late is worse than none, so a short time to live is often right.

Throttling and preferences

Apply per-shipment and per-customer limits, quiet hours where appropriate, and channel preferences. Keep a notification log linked to the triggering event, so customer service can see exactly what the customer was told and when.

Proactive updates also reduce inbound “where is my order?” contacts, a topic our article on order tracking automation covers from the customer service side.

Action: write the notification matrix: trigger, channel, message template, throttle rule and time to live. Review it with customer service and legal for consent and messaging requirements in each market.

What should you plan for in scale, reliability and cost?

Volumes are driven by telemetry

Business events scale with shipments; telemetry scales with devices multiplied by reporting frequency. Reporting intervals are therefore a cost lever. Reporting more often when moving and less often when stationary, or more often near the destination, keeps accuracy where it matters without paying for constant updates.

Retention by data type

Keep business events for as long as contracts and audit require. Keep detailed raw positions only for as long as they are useful for disputes, analytics and model training, then aggregate or delete. Location data about drivers is personal data in many jurisdictions, so retention and access rules need privacy review.

Observability

Track end-to-end latency from device event to tracking page, message backlog, devices offline, duplicate rates and status transitions rejected by the state machine. Our article on observability with OpenTelemetry covers how to trace events across services without tying yourself to one vendor.

Cost drivers

  • Message broker and ingestion charges, which scale with message count and size. AWS notes, for example, that messages stored for offline persistent sessions are billed again on delivery.
  • Routing and mapping API calls for ETAs and maps.
  • SMS charges, which are typically far higher per message than push.
  • Storage of raw telemetry.
  • Engineering effort for device integration and partner normalisation.

Managed IoT services reduce operational effort but tie you more closely to a provider; our article on cloud vendor lock-in discusses how to keep exit options reasonable.

Action: estimate message volume from device count and reporting frequency for current and three-year volumes, and model broker, mapping and SMS costs before choosing services.

How should you phase the build, and what should you check?

Tracking projects fail when they try to integrate every device, partner and prediction model at once. A phased approach delivers value early and reduces risk.

Suggested phases

  1. Core status pipeline: driver app scans and proof of delivery, the state machine, a customer tracking page and basic notifications.
  2. Live location: telematics or app location, geofences and routing-based ETAs.
  3. Partner feeds: carrier and subcontractor updates normalised into your event model.
  4. Sensors and exceptions: temperature and door sensors, alarms and exception workflows for operations.
  5. Prediction: learned ETA and delay risk once enough history exists.

For example, a regional courier with a few hundred vehicles might reach phase two within a first release and run partner feeds through a manual exception queue until volumes justify full integration. This is an illustrative sequence, not a benchmark.

Architecture checklist

  • Telemetry and business events separated in topics, stores and retention.
  • Event catalogue with a common envelope, unique IDs and both event and received times.
  • All consumers idempotent; status logic based on event time, not arrival order.
  • Shipment state machine documented and tested with out-of-order and duplicate events.
  • Driver app works offline and syncs late events safely.
  • Notification matrix with throttling, time to live and a notification log.
  • Location data retention and access reviewed for privacy.
  • End-to-end latency, backlog and offline-device monitoring in place.
  • Cost model based on message volumes, mapping calls and SMS.

Action: use the checklist as review criteria at the end of each phase, not just at launch.

Frequently asked questions

Do we need dedicated telematics hardware, or can the driver app provide location?

Driver apps can provide location during active jobs and are often enough to start. Dedicated telematics units give continuous vehicle data independent of phones and can include sensors, but add hardware and connectivity costs. Many fleets use both.

Should we use a managed IoT service or run our own MQTT broker?

Managed services reduce operational work and include device authentication and scaling, but check feature support, such as QoS levels, and pricing at your volumes. Running your own broker gives more control and portability but needs operations capacity.

How real-time does tracking need to be?

It depends on the decision it supports. Customers usually need an accurate arrival window, not second-by-second movement. Operations teams may want faster updates for exceptions. Set reporting frequencies by use case to control cost.

How do we integrate tracking from third-party carriers?

Map each carrier’s statuses and webhooks or APIs into your own event model as soon as they arrive. Keep the original payload for audit, and expect differences in timeliness and detail between carriers.

Is driver location data a privacy concern?

Yes, in many jurisdictions it is personal data. Limit collection to working periods, define retention, restrict access and inform drivers. Take local legal advice for each market you operate in.

Sources and methodology

Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.

  1. OASIS: MQTT Version 5.0 Standard (March 2019) — accessed 9 November 2026. QoS 0, 1 and 2 delivery guarantees, Will messages, and session and message expiry intervals.
  2. AWS: AWS IoT Core MQTT documentation — accessed 9 November 2026. Supported QoS levels (no QoS 2), persistent sessions and default expiry, retained messages and re-billing of stored messages.
  3. CNCF: CloudEvents specification — accessed 9 November 2026. Common event envelope and its CNCF graduated status (January 2024).
  4. Google: Firebase Cloud Messaging message options — accessed 9 November 2026. Collapsible messages, time to live, message priority and the 4 KB data payload limit.

Is your tracking pipeline ready for offline devices, late events and partner feeds?

Tell us about your fleet, devices and customers. We will review your tracking architecture and suggest a phased plan with a cost model.