TransitAI Core

Digital twin · merged platform · data architecture · proposed

One platform, both use cases: the data.

The merged architecture says which services run once for both paths. This page says what data they hold, down to the column: every table of transfer analysis and anomaly detection drawn once, each tagged with the path that reads it, the shared ones kept identical by construction. The online path reads the same Silver tables at home that the nightly count reads; at the region, one registry, one regional transfer table and one feed archive serve both.

The lineageTables, keys and rulesThe proposal

Lineage: both paths, column by column, on one picture.

Three lanes are three places data rests; five columns are the layers. A box is a table; a pill is a step; blue arrows cross an account border. Each box and pill carries its path. The filter above the picture shows one path at a time; what is tagged both stays lit in every view. Hover anything and only its neighbours stay lit; hold Shift for the fields joined, or everything a step does.

Hover a table, a step or an arrow. Hold Shift while hovering for the entity-relationship view of the tables, or the full detail of a step. Esc or moving away closes it. Click to pin.The specification (JSON)

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
  • both paths
  • online
  • offline
Dots mark status: stop_visits and fare_transactions were built by explorations; the loads and the totals were replayed. Nothing is deployed. The weather input is dashed and uncosted (decision 52). The regional tables' columns are proposals (decisions 57, 58); the merge is decision 62, proposed.

The 20 steps.

Renumbered for one picture: the agency's online steps, then its offline ones, then the region's in the order data reaches them. Each one's full detail opens on the picture with Shift.

StepPathWhat it doesReadsWritesRuns asWhenColumns mapped
T1onlineLand the vendor exportsAVL stop times, APC countersRaw AVL export, Raw APC exportS3 landingmonthly in the sample; nightly in a live agency48
T2onlineConform the exports to TIDES stop_visits and trips_performedRaw AVL export, Raw APC export, GTFS timetablesTIDES stop_visits, TIDES trips_performedthe adapter (Glue ETL or Lambda)per service day34
T3onlineSum the visits into 5-minute loadsTIDES stop_visits, TIDES trips_performed5-minute loadsthe adapter (Lambda)every 5 minutes, for the window just closed9
T4onlinePush the loads to the live lane5-minute loadsLive lanethe adapter (Lambda), in the agency's accountevery 5 minutes, within 2 of the window closing13
T5offlineLand the fare exportPRESTO fare exportRaw fare exportS3 raw landingnightly, when the export arrives20
T6offlineTranslate the taps to TIDES fare_transactions; hash the cardRaw fare exportTIDES fare_transactionsGlue ETL · translate (or Databricks)02:00, after the export lands17
T7offlineCount the transfers and time the waitsTIDES fare_transactions, Public arrivalsNightly transfer totalsGlue ETL · count and time (or Databricks); Athena reads the arrivals in place02:30, nightly8
T8offlinePush the nightly file to the region's inboxNightly transfer totalsInbox: nightly filesthe adapter, in the agency's account; S3 copy with SSE-KMSby 06:0014
T9both pathsPoll every registered party's live feed into the lane and the archiveGTFS-Realtime feeds, RegistryLive lane, Feed archiveECS on Fargate · poller; Data Firehose writes the archiveevery 10 s; the archive batched within 5 minutes44
T10onlineFetch each party's timetable when it changesGTFS timetables, RegistryTimetablesECS on Fargate · pollerwhen the published zip changes (its hash)42
T11onlineArchive the lane as TIDES vehicle_locationsLive laneTIDES vehicle_locationsData Firehose → S3 + Icebergbatched, within 5 minutes19
T12offlineDerive the arrival at each stop; attach the stop crosswalkFeed archive, RegistryPublic arrivalsGlue ETL · derive arrivals (or Databricks)nightly, 01:00, for the service day ended14
T13onlineKeep the last state per vehicle and counter; run the rulesLive laneLast state per vehicleLambda · ruleson every record; rules checked each minute16
T14onlineMatch each position to its timetable; one delay and load value per route per windowLive lane, TimetablesDelay and load per routeLambda · delay and loadevery 5 minutes11
T15offlineCheck each file against its contractInbox: nightly files, RegistryRejected filesLambda · contract check, on the file-arrived eventas each file lands; the alarm at 06:007
T16offlineAdd the accepted files up into the regional tableInbox: nightly files, RegistryRegional transfer tableGlue ETL · add up (or Databricks)06:30, with what has landed11
T17onlineBuild who is affected from shared stops and transfer totalsRegional transfer table, Registry, TimetablesWho is affectedAthena, nightly → DynamoDBnightly, after the transfer totals land10
T18onlineBuild the alert: kind, where, since, expected and seen, who is affectedLast state per vehicle, Delay and load per route, Who is affected, Weather and eventsAlertsLambda · build the alertwhen a rule fires or a band breaks18
T19onlineServe the open alerts a reader may seeAlertsLive alert feedAPI Gateway + Lambda; Verified Permissionson request14
T20offlineServe the four reports a reader may seeRegional transfer tableReport APIAthena · queries; API Gateway; Verified Permissionson request; cached20

Steps T1 to T8 run in the agency's account, T9 onwards in the region's; T9 and T10 sit on the border because the poller reads across it. 1 step serves both paths, 11 the online path, 8 the offline one.

What the merge made one.

Every table and step that existed in both use cases, and what the merge found when it compared them. A difference between the two generators fails this page's script, so the shared definitions cannot drift apart again.

Made onePathWhat was compared, and the result
Registryboth pathsOne table, column for column, in both use cases already (decision 61); drawn once.
Regional transfer tableboth pathsThe transfer use case's Gold is the anomaly use case's input; columns, grain, keys, partitioning, retention and custody identical (pinned); drawn once, in Gold.
GTFS-Realtime feedsboth pathsOne public feed. Transfer analysis read a subset of its fields; the merged table carries the full list. Three field descriptions differed between the generators and were aligned at the source.
Feed archiveboth pathsTwo layers of one store (decision 61): Bronze as polled, which the arrivals are derived from; Silver TIDES vehicle_locations from the lane, which replays use. Both drawn, both written by the one poller and the lane.
Poll stepboth pathsThe two poll steps are one: the poller writes the lane (positions) and the archive (positions and trip updates) in one pass.
Bronze and Silver at homeboth pathsOne raw landing and one standard-table store hold the AVL, APC and fare exports and their TIDES tables; each table keeps the path that reads it.
Where the two disagreed
Only on the feed archive's layer: Bronze as polled in transfer analysis, Silver vehicle_locations in anomaly detection. Kept as two layers of one store, as decision 61 proposed. The transfer-totals contract and the anomaly's reading of the regional table agree on retention (3 years, agency's key) and on the rule for a missing party (unknown, never zero).
What a shared store means here
The AWS and system design views tag a store "both" when it holds tables of both paths. This page tags each table by the path that reads it, so the raw landing holds online tables (the AVL and APC exports) and an offline one (the fare export) side by side.
Open
One Silver with two write cadences: the online path sums stop_visits every 5 minutes, the offline count reads them nightly; the adapter's conform step must run continuously for both. One service-day definition (taps before 04:00). Whether the alert log and the regional totals share one table layout. Listed on the proposal page.

What crosses, and under whose key.

The union of both contracts: 9 flows cross an account border. The public feed and the nightly totals file cross once and serve both paths.

PathWayWhatShapeWhenKeyWho
both pathsInPublic feedsGTFS-Realtime, as publishedevery 10 s, pulled by the regionnone: openevery registered party
onlineInTimetablesGTFS, as publishedwhen they changenone: openevery registered party
onlineIn5-minute loadsTIDES passenger_events, summedevery 5 min, pushed by the adapterregion's, on arrival; 24 hoursfull sharers only
both pathsInNightly transfer totalsTIDES station_activities plus extras: the contract's rownightly, by 06:00, pushed by the adapter; read by the nightly lookup tooagency's; the region holds a revocable grantfull sharers only
offlineBackPublic arrivals, with the stop crosswalkTIDES stop_visits, times onlyread in place, by grant, when the agency countsregion's; a Lake Formation grant per contractevery full sharer
onlineOutAlertsthe contract's shape; no TIDES homeas they happeneach receiver's ownthe party, the region, named neighbours
onlineOutLive alert feedJSONon requestregion's; allow-or-deny per readersigned-in control rooms and views
offlineOutRejected filethe reasonas it happensregion'sthe sending agency
offlineOutReportsJSON: matrix, waits, crossing points, connection timeson requestregion's; allow-or-deny per readersigned-in planners and the journey view
Stays home
Taps, cards, the hashed card, the fare class, counter records, stop-level history, the vendor files. The agency's key; the region receives totals and counts only (decisions 5, 8).
Regional, agency's key
The nightly file in the inbox and that agency's rows in the regional transfer table, read by one revocable grant for both the reports and the nightly who-is-affected lookup. Revoke it and both lose that agency at once (decisions 41, 50, 54).
Regional, region's key
The live lane and the loads on it for 24 hours, both layers of the feed archive, the public arrivals, metrics, vehicle state, alerts, the registry, the rejection queue, the reports.
Public
Timetables and live feeds, mirrored; a leaver's part dropped. No key, the data is open.

↑ ↓ to move · ↵ to open · esc to close