TSTier SlateAll templates

Location & logistics

Fleet tracking - 21,600 writes per vehicle per day

Teaches how a continuous position firehose is split into a tiny live picture and an enormous history, and how retention rather than hardware decides what it costs.

  • System design
  • core
  • 8 step walkthrough
  • 5 tables

Share

  • Facebook
  • X

What this board gets wrong on purpose

The tension

History is downsampled from 4 seconds to 30 at ingest, which turns 518 GB a day into 69 GB and is the single reason the storage bill is five figures rather than seven. It is also irreversible and it is applied before anyone has agreed what the history is for. Thirty seconds is fine for "where was this lorry at 14:00" and useless for the questions that pay for telematics: harsh braking lasts under two seconds and is invisible at 30 s, a stop that is 45 s long may be sampled once or twice depending on phase, and an insurance dispute about a collision needs the second before impact, which by then is gone. The board papers over this with a 7-day full-resolution buffer and an event-triggered keep-everything window around detected incidents - which only works if the detector fires, and the detector runs on the downsampled stream for everything older than a week. The retention tiers are also global rather than per customer, so the fleet paying for forensic-grade telematics gets the same 30-second history as the one that only wants a map, and the only lever anybody has is to make it worse for everybody or more expensive for everybody.

1 · Requirements

Half a million vehicles reporting continuously, and a handful of dispatchers looking at a map. The load and the product are on completely different scales, and the design is mostly about keeping them apart.

Ask these before designing

  • How often does a vehicle report, and who decides? 4 s, 10 s and 60 s are the same product and a 15x difference in every number on the capacity page. This is the first question and it is usually answered by a firmware default nobody revisits.
  • What is the history FOR? A map replay needs 30 s. A harsh-braking score needs 1 s. A collision reconstruction needs 10 Hz accelerometer data this board does not even carry. Downsampling is irreversible, so this question must be answered before ingest, not after.
  • Does the customer see live, or recent? "Live" means a push channel and a write path that cannot lag. "Within a minute" means a poll and a much cheaper system.
  • How long must data be kept, and by whom is that mandated? Tachograph and hours-of-service rules put a legal floor under retention that no amount of cost engineering may go below.
  • Is the vehicle ever offline? Long-haul trucks lose signal for hours. Either the device buffers and back-fills - which means out-of-order arrivals of thousands of points - or the history has holes. Both are real designs; only one of them is usually considered.
  • Per-customer retention, or one global policy? Per-customer is the right answer commercially and the expensive one architecturally, because it makes every partition boundary a per-tenant decision.

Functional

  • Ingest positions from 500,000 devices, tolerate duplicates and out-of-order back-fill.
  • Answer "where is every vehicle in this map viewport" in under 200 ms.
  • Push live position updates to open consoles.
  • Replay any vehicle’s track for any day within retention.
  • Segment the raw stream into trips (ignition on to ignition off) and daily rollups.
  • Raise alerts - speeding, geofence-adjacent, idling, harsh braking - from the stream rather than from the history.

Non-functional

  • Ingest must never reject. A device that cannot deliver retries, and 500,000 devices retrying together is the only real way to take this system down. Accept, acknowledge, and sort it out downstream.
  • Last-known position fresh within one report interval (4 s).
  • Viewport query p99 under 200 ms with up to 20,000 vehicles in frame.
  • Ingest availability 99.99%; console availability 99.9%. They are different numbers because dropping the map is an inconvenience and dropping the stream is a hole in a legal record.
  • Writes are idempotent on (vehicle_id, reported_at) - the only defence against back-fill that works.

Explicitly out of scope

Geofence evaluation and enter/exit events (that is the geofencing board), route planning and navigation, driver identity and payroll, video telematics, maintenance scheduling.

The rest of this board

Board preview

Available on Tier Slate

This page publishes the question. The answer — 5 more written pages, an 8-step narrated walkthrough and a 5-table schema — is the board itself, and it opens in Tierslate.

  • 5written pages
  • 8walkthrough steps
  • 5tables36 columns

5 pages behind this one

  • Capacity estimation
  • Storage estimation
  • Availability
  • How it works
  • Deployment plan
Open this board in TierslateBrowse every board

More boards

Geospatial indexes, matching and moving things.

  • Geofencing - many points against many polygons
  • Maps routing - precompute, then watch it go stale
  • Proximity search - the index is the design
  • Ride matching - the nearest car is the wrong car
All 50 templatesOpen Tierslate
Tierslate

tierslate.com

HomeTemplatesPrivacyTerms