Digital twin · anomaly detection · data architecture · planned
Anomaly detection: the data.
The solution architecture says which services run. This page says what data they hold, down to the column: where each table comes from (its lineage), which step builds it and from which fields, which layer it sits in, whose account and key it rests under, and what crosses between parties. The open standards are the table shapes, not an export at the end.
- 20tables and feeds, from the vendor exports to the live alert feed; 411 columns between them
- 12steps, each its own element; 254 output columns, every one with the expression that makes it
- 4 in · 2 outaccount crossings: feeds, loads and totals in; alerts and the alert feed out
- 0fare cards read anywhere in this use case
Lineage: from a vendor file to an alert, column by column.
Three lanes are three places data rests; five columns are the layers. A box is a table; a pill is a step, numbered and named with a verb; blue arrows cross an account border. Hover anything and only its neighbours stay lit. Hold Shift to see the fields joined, or everything a step does.
Hover a table to see what feeds it and what it feeds.
- Source
- Bronze
- Silver
- Gold
- Out
- tested on the sample
- replayed on the sample
- already standard
- the sample files
- planned
- T3a step: a numbered transformation with a verb
stop_visits has been built by an exploration. Nothing is deployed. The planned weather input is dashed and uncosted (decision 52). The regional tables' columns are a proposal (decision 57).The 12 steps.
Named as a lineage tool would name them. Each one's full detail, every output column with its expression, the joins, filters, dedup, nulls, units, privacy rule and key, opens on the picture with Shift.
| Step | What it does | Reads | Writes | Runs as | When | Columns mapped |
|---|---|---|---|---|---|---|
| T1 | Land the vendor exports | AVL stop times, APC counters | Raw AVL export, Raw APC export | S3 landing | monthly in the sample; nightly in a live agency | 48 |
| T2 | Conform the exports to TIDES stop_visits and trips_performed | Raw AVL export, Raw APC export, GTFS timetables | TIDES stop_visits, TIDES trips_performed | the adapter (Glue ETL or Lambda) | per service day | 34 |
| T3 | Sum the visits into 5-minute loads | TIDES stop_visits, TIDES trips_performed | 5-minute loads | the adapter (Lambda) | every 5 minutes, for the window just closed | 9 |
| T4 | Push the loads to the live lane | 5-minute loads | Live lane | the adapter (Lambda), in the agency's account | every 5 minutes, within 2 of the window closing | 13 |
| T5 | Poll every registered party's live feed | GTFS-Realtime feeds, Registry | Live lane | ECS on Fargate · poller | every 10 s | 20 |
| T6 | Fetch each party's timetable when it changes | GTFS timetables, Registry | Timetables | ECS on Fargate · poller | when the published zip changes (its hash) | 42 |
| T7 | Archive the lane as TIDES vehicle_locations | Live lane | TIDES vehicle_locations | Data Firehose → S3 + Iceberg | batched, within 5 minutes | 19 |
| T8 | Keep the last state per vehicle and counter; run the rules | Live lane | Last state per vehicle | Lambda · rules | on every record; rules checked each minute | 16 |
| T9 | Match each position to its timetable; one delay and load value per route per window | Live lane, Timetables | Delay and load per route | Lambda · delay and load | every 5 minutes | 11 |
| T10 | Build who is affected from shared stops and transfer totals | Regional transfer table, Registry, Timetables | Who is affected | Athena, nightly → DynamoDB | nightly, after the transfer totals land | 10 |
| T11 | Build the alert: kind, where, since, expected and seen, who is affected | Last state per vehicle, Delay and load per route, Who is affected, Weather and events | Alerts | Lambda · build the alert | when a rule fires or a band breaks | 18 |
| T12 | Serve the open alerts a reader may see | Alerts | Live alert feed | API Gateway + Lambda; Verified Permissions | on request | 14 |
Columns mapped counts output columns; a step reads more columns than it writes. Steps T1 to T4 run in the agency's account, T5 to T12 in the region's. T5 and T6 sit on the border because the poller reads across it.
Bronze, Silver, Gold, in two accounts.
The agency refines its own data at home; the region refines what it is allowed to see. Each layer's rule is the same in both places.
Bronze: as received
Silver: the standard shapes
- At home TIDES
stop_visitsandtrips_performed: one row per trip per stop, times and counts together; one row per trip with its route and timetable trip. - At the region TIDES
vehicle_locationsas the feed archive, and every party's GTFS as published. - Rule a table takes the standard's shape or names its extra columns in the contract.
The agency's Bronze and Silver are its own business: the region never reads them (decision 5). The sample stands in for a live feed, so stop-level arrivals play the part of positions.
What crosses, and under whose key.
Six flows cross an account border. Everything else stays where it was made.
| Way | What | Shape | When | Key | Who |
|---|---|---|---|---|---|
| In | Public feeds | GTFS-Realtime, as published | every 10 s, pulled by the region | none: open | every registered party |
| In | Timetables | GTFS, as published | when they change | none: open | every registered party |
| In | 5-minute loads | TIDES passenger_events, summed | every 5 min, pushed by the adapter | region's, on arrival; 24 hours | full sharers only |
| In | Transfer totals | TIDES station_activities plus extras | nightly | agency's; read by revocable grant | full sharers only |
| Out | Alerts | the contract's shape; no TIDES home | as they happen | each receiver's own | the party, the region, named neighbours |
| Out | Live alert feed | JSON | on request | region's; allow-or-deny per reader | signed-in control rooms and views |
- Stays home
- Counter records, stop-level history, the vendor files. The agency's key; the region receives totals only.
- Regional, agency's key
- Transfer totals, read by a revocable grant. Revoke it and the who-is-affected lookup loses that agency at the next nightly rebuild.
- Regional, region's key
- The live lane, the loads on it for 24 hours, metrics, vehicle state, alerts. Counts that name nobody; the trade-off decision 54 proposes.
- Public
- Timetables and live feeds, mirrored; a leaver's part dropped. No key, the data is open.