TransitAI Core

Digital twin · transfer analysis · data architecture · planned

Transfer analysis: 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 card serial is read once, at home, hashed, and never written to anything that leaves.

The lineageTables, keys and rules

Lineage: from a tap to the regional matrix, 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, 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
Dots mark status: fare_transactions was built by an exploration; the nightly totals were replayed by the sample analysis. Nothing is deployed. Stop visits are not drawn: this use case does not read them. The regional tables' columns are a proposal (decision 58).

The 9 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.

StepWhat it doesReadsWritesRuns asWhenColumns mapped
T1Land the fare exportPRESTO fare exportRaw fare exportS3 raw landingnightly, when the export arrives20
T2Translate the taps to TIDES fare_transactions; hash the cardRaw fare exportTIDES fare_transactionsGlue ETL · translate (or Databricks)02:00, after the export lands17
T3Count 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
T4Push 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
T5Poll every registered party's live feed into the archiveGTFS-Realtime feeds, RegistryFeed archiveECS on Fargate · poller; Data Firehose writes Parquetevery 10 s; batched within 5 minutes24
T6Derive 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
T7Check each file against its contractInbox: nightly files, RegistryRejected filesLambda · contract check, on the file-arrived eventas each file lands; the alarm at 06:007
T8Add the accepted files up into the regional tableInbox: nightly files, RegistryRegional transfer tableGlue ETL · add up (or Databricks)06:30, with what has landed11
T9Serve the four reports a reader may seeRegional transfer tableReport APIAthena · queries; API Gateway; Verified Permissionson request; cached20

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 T9 in the region's; T5 sits on the border because the poller reads across it. The timetables are not needed here: arrivals come from the feeds' own stop fields.

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

  • At home the fare export, untouched, the card serial still in it, under the agency's key.
  • At the region the feed archive as polled, and the inbox: each agency's nightly file under that agency's key.
  • Rule never edited, so Silver can be rebuilt from it.

Silver: the standard shapes

  • At home TIDES fare_transactions plus three named extras: the transfer operator, the route, the hashed card.
  • At the region the public arrivals in TIDES stop_visits shape, with the stop crosswalk, read in place by each agency.
  • Rule a table takes the standard's shape or names its extra columns in the contract.

Gold: one purpose each

  • At home the nightly totals: the only Gold table that leaves, rows under 5 cards already gone.
  • At the region the regional table, six files a night added up, each agency's rows under its own key.
  • Out the four reports, and a rejected file's reason back to its sender.

The agency's Bronze and Silver are its own business: the region never reads them (decision 5). The card is read in T2 only, hashed with a secret the agency keeps, and dropped (decision 48).

What crosses, and under whose key.

Five flows cross an account border. Everything else stays where it was made.

WayWhatShapeWhenKeyWho
InPublic feedsGTFS-Realtime, as publishedevery 10 s, pulled by the regionnone: openevery registered party
InNightly transfer totalsTIDES station_activities plus extras: the contract's rownightly, by 06:00, pushed by the adapteragency's; the region holds a revocable grantfull sharers only
BackPublic 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
OutRejected filethe reasonas it happensregion'sthe sending agency
OutReportsJSON: 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. The agency's key; the region receives totals only (decision 8).
Regional, agency's key
The nightly file in the inbox and that agency's rows in the regional table, read by a revocable grant. Revoke it and they go dark; the off-boarding run deletes them, expires snapshots and purges the cache (decisions 41, 43, 50).
Regional, region's key
The feed archive, the public arrivals, the registry, the rejection queue, the reports.
Public
Live feeds, mirrored; a leaver's part dropped. No key, the data is open.

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