HomeCase studiesSub-Second Real-Time Delivery Tracking and Live ETA...

Case study · Singapore, Singapore

Sub-Second Real-Time Delivery Tracking and Live ETA Streaming Architecture with React Native, Go, and Redis

Live Courier Telemetry & Customer ETAs

High-density urban courier networks lose customer trust when live tracking maps freeze, jump erratically between tower blocks, or drain driver phone batteries before mid-shift. We engineered a real-time delivery tracking platform uniting a battery-aware React Native courier app, high-concurrency Go telemetry and WebSocket services, and Redis Geo/Streams pipelines. Couriers emit adaptive GPS heartbeats that pass through road-snapping filters and geofence evaluators in milliseconds, streaming smooth live markers and dynamically updated ETAs to recipients and dispatchers simultaneously.

Industry
Live Courier Telemetry & Customer ETAs
Solution
A low-latency courier telemetry and customer tracking platform built with React Native, Go, Redis Streams/Geo, WebSockets, and PostgreSQL.
Platforms
Cross-platform · Web & API
Stack
React Native · Go · Redis · WebSockets · PostgreSQL · NATS
Location
Singapore, Singapore · delivered remotely
Role
Engineering, with the team behind for mobile and QA

Delivered remotely for a business based in Singapore, Singapore. Names withheld by agreement.

Project Overview

In dense metropolitan corridors like Singapore—where multi-story residential estates, underground expressways, and towering commercial districts compress thousands of simultaneous deliveries into tight districts—a sluggish tracking map destroys customer confidence fast. Recipients watching a stalled courier icon call support desks repeatedly, while riders forced to run aggressive GPS polling apps watch their phones overheat and shut down mid-afternoon.

We architected a real-time delivery tracking system powered by React Native, Go, and Redis. The platform delivers adaptive, battery-conscious courier telemetry from mobile devices, smooths noisy urban coordinates on the fly, and fans out sub-second WebSocket updates to both dispatchers and end-customer tracking links.

Urban Telemetry Challenges

Building live tracking for high-density multi-drop couriers exposed four subtle engineering bottlenecks:

  • Urban canyon GPS scatter: Signals bouncing off glass towers and expressway overpasses placed riders inside neighboring blocks or across water channels, causing erratic pin jumps and premature arrival alerts.
  • Broadcast fan-out storms: When popular merchant windows triggered thousands of concurrent recipients opening live map links, naive database-backed polling saturated API connections immediately.
  • Mobile battery exhaustion: Constant high-accuracy GPS locking combined with chatty HTTP requests drained courier handsets long before evening shifts finished.
  • Out-of-order tunnel reconnects: Riders emerging from subterranean parking garages or tunnels flushed buffered coordinates out of order, making map markers briefly snap backward.

Architectural Strategy

We treated live location as an ephemeral, high-velocity stream separate from durable order transactions. The React Native courier app buffers coordinates locally in a compact ring queue and batches uploads over persistent connections via native Android foreground services and iOS significant-motion bridges.

On the backend, stateless Go services sit directly behind the load balancer. Go goroutines validate incoming batches, discard physically impossible GPS spikes, update Redis Geo indexes and hot hash state, publish coordinates to NATS and Redis Pub/Sub channels, and push delta frames down thousands of open customer WebSockets. PostgreSQL stays insulated from high-frequency coordinate writes, receiving only milestone state transitions and downsampled trip summaries asynchronously.

Core Capabilities

  • Adaptive Courier Telemetry: Modulates GPS accuracy and batching frequency using accelerometer motion detection, battery state, and proximity to the active drop-off pin.
  • Coordinate Smoothing & Road Snapping: Filters multipath GPS outliers and snaps active trajectories cleanly onto road segments so customer maps animate smoothly along streets.
  • Proximity Geofence Triggers: Evaluates approaching-stop rings in Go against Redis Geo state to fire "courier arriving nearby" alerts without polling overhead.
  • Scoped Live Customer Tracking: Serves zero-install TypeScript React tracking URLs with live marker interpolation, real-time traffic ETA recalculation, and masked rider privacy.
  • Tamper-Evident Proof of Delivery: Captures offline-capable signature pads, timestamped doorstep photos, and exact drop-off coordinates inside React Native before syncing to PostgreSQL.

Technical Architecture

Courier devices emit compressed JSON/Protobuf location batches to a Go ingestion service. After sequence verification and Kalman/plausibility smoothing, Go updates the rider's active coordinate in Redis and emits a stream event onto NATS JetStream. Dedicated Go WebSocket gateway nodes subscribe only to active order channels requested by connected browsers and dispatch consoles, keeping fan-out traffic tightly bounded.

Flow: React Native Courier App (Native Background GPS) → Go Telemetry Ingestion & Smoothing → Redis Geo & Hot State + NATS JetStream → Go WebSocket Fan-Out Hub + Geofence Worker → TypeScript Customer Map & PostgreSQL Archive

Downstream workers consume NATS streams at their own pace to archive breadcrumb trails in PostgreSQL and trigger push/SMS milestone notifications, ensuring slow third-party SMS providers never backpressure live map streaming.

Technology Stack

Category Technology detail
Courier Mobile App React Native client with native background location modules, proof-of-delivery capture, and offline buffer
Telemetry & Socket Core Go microservices ingesting courier GPS pings, running map-matching, and fanning out WebSocket frames
Hot Geo & Stream Bus Redis Geo, Hashes, and Streams tracking live rider coordinates and triggering geofence transitions
Internal Event Mesh NATS JetStream decoupling telemetry ingestion from notification dispatch and analytics archiving
Persistent Order Store PostgreSQL recording delivery tasks, chain-of-custody timestamps, POD signatures, and breadcrumb archives
Customer Tracking Web App TypeScript React live map portal interpolating smooth courier motion and live countdown ETAs
Map & Routing SDK Google Maps SDK providing road-snapped polylines, traffic-aware ETA refreshes, and geocoded pins
Push & SMS Alerts Worker consumers sending milestone notifications on pickup, approaching-stop, and drop-off events

Engineering Trade-offs & Solutions

Engineering Challenge Solution & Trade-off
React Native JS bridge stalls under continuous native GPS callbacks Moved location buffering and motion-state throttling into native Swift/Kotlin modules that wake JavaScript only for batched syncs or UI updates, trading modest native code upkeep for high battery efficiency.
Calling commercial Directions APIs on every 5-second ping creates steep cost spikes Recomputed full traffic-aware ETAs only when distance moved, remaining stops, or deviation thresholds exceed bounds, interpolating countdowns locally between refreshes.
Raw GPS pings replayed after tunnel exits cause markers to jump backward Enforced monotonic device sequence timestamps in Go so stale buffered points archive to historical trails without overwriting newer live Redis coordinates.
Thousands of idle WebSocket viewers magnify broadcast CPU load Sharded WebSocket room subscriptions per active order token in Go and sent compact coordinate/bearing deltas only when displacement exceeds a few meters.

Privacy & Telemetry Security

Real-time location streams carry strict personal privacy requirements for both couriers and recipients. Customer tracking URLs rely on unguessable cryptographic tokens with automatic expiration shortly after delivery completion; once an order closes, the WebSocket room terminates immediately and historical rider paths become inaccessible to the recipient.

Courier mobile sessions authenticate via short-lived JWTs paired with device-bound refresh tokens. Inside the tracking portal, exact home addresses and recipient phone numbers stay masked unless explicitly authorized for support supervisors, while all telemetry transit enforces TLS 1.3 encryption.

Concurrency & Burst Resilience

Lunchtime food surges and evening e-commerce waves multiply active socket counts sharply within minutes. Because Go multiplexes each WebSocket connection onto minimal-stack goroutines managed by epoll/kqueue, individual gateway nodes sustain tens of thousands of concurrent viewers cleanly behind horizontal autoscaling.

If a WebSocket pod restarts during deployment, the TypeScript client applies jittered exponential backoff on reconnect and immediately hydrates the latest coordinate from Redis Hash state—preventing thundering-herd reconnect spikes against PostgreSQL.

Operational Outcomes

Moving live tracking onto an event-driven Go and Redis core elevated reliability across courier and consumer touchpoints:

  • Smooth urban map accuracy: Road-aware outlier filtering eliminates jarring cross-building marker jumps in dense high-rise zones.
  • Full-shift mobile endurance: Adaptive sensor batching inside React Native preserves courier phone battery across long multi-stop runs without sacrificing arrival precision.
  • Quiet customer support queues: Reliable live tracking links and timely approaching-stop alerts give recipients clear visibility without needing "where is my order" calls.
  • Isolated failure domains: Decoupling NATS archiving and SMS workers from Go streaming gateways keeps live maps fluid even during external notification slowdowns.

01 — Questions

asked about this kind of project

Why write the location ingestion and WebSocket fan-out server in Go instead of a dynamically typed runtime?

Thousands of concurrent riders sending location updates while tens of thousands of consumers watch live tracking links create heavy socket concurrency. Go's lightweight goroutines and predictable memory footprint sustain persistent WebSocket hubs and Redis pipelines at low tail latency without garbage-collection pauses.

How does the React Native app avoid draining rider phone batteries across 10-hour shifts?

Native iOS and Android background geolocation bridges dynamically adapt sampling cadence based on motion sensors and active task state—slowing pings when stationary at a loading bay and tightening intervals only when approaching a drop-off.

Why does urban tracking telemetry jump across streets in dense high-rise districts, and how did you fix it?

Multipath GPS reflections between tall towers introduce lateral coordinate spikes. Our Go pipeline applies speed-plausibility filtering and lightweight HMM/Kalman smoothing against road geometry before broadcasting coordinates to customer browsers.

How do you secure public customer tracking URLs so unauthenticated users cannot enumerate other deliveries?

Tracking links use high-entropy, time-bounded opaque tokens scoped strictly to a single order ID. WebSocket subscriptions strip all unrelated rider shifts, revealing courier motion only during the active last-mile delivery leg.

What prevents Redis memory from growing unbounded during peak meal or parcel surges?

Redis holds only active shift coordinates, ephemeral stream windows with capped `MAXLEN`, and short-TTL order views. Completed breadcrumbs flush asynchronously via NATS workers into PostgreSQL partitioned tables.

03 — Similar project?

describe what is different about yours

Build yours.

Tell me what exists, what you need and the deadline. Fixed price for a defined scope, or $55/day (8–9 hours work) with a written plan first.

Solitaire Corporate Park, Makarba, Ahmedabad, Gujarat 380015, India · IST (UTC+5:30) · --:-- IST · Mon–Fri 09:00–18:00 IST · US & EU overlap daily

No newsletter, no CRM. Just a reply.