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.
- 12tables and feeds, from the fare export to the report API; 198 columns between them
- 9steps, each its own element; 135 output columns, every one with the expression that makes it
- 2 in · 1 back · 2 outaccount crossings: feeds and one nightly file in; the arrivals read back in place; a rejection and the reports out
- 5 cardsthe smallest count in any row that leaves an agency; the card itself never does
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 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
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.
| Step | What it does | Reads | Writes | Runs as | When | Columns mapped |
|---|---|---|---|---|---|---|
| T1 | Land the fare export | PRESTO fare export | Raw fare export | S3 raw landing | nightly, when the export arrives | 20 |
| T2 | Translate the taps to TIDES fare_transactions; hash the card | Raw fare export | TIDES fare_transactions | Glue ETL · translate (or Databricks) | 02:00, after the export lands | 17 |
| T3 | Count the transfers and time the waits | TIDES fare_transactions, Public arrivals | Nightly transfer totals | Glue ETL · count and time (or Databricks); Athena reads the arrivals in place | 02:30, nightly | 8 |
| T4 | Push the nightly file to the region's inbox | Nightly transfer totals | Inbox: nightly files | the adapter, in the agency's account; S3 copy with SSE-KMS | by 06:00 | 14 |
| T5 | Poll every registered party's live feed into the archive | GTFS-Realtime feeds, Registry | Feed archive | ECS on Fargate · poller; Data Firehose writes Parquet | every 10 s; batched within 5 minutes | 24 |
| T6 | Derive the arrival at each stop; attach the stop crosswalk | Feed archive, Registry | Public arrivals | Glue ETL · derive arrivals (or Databricks) | nightly, 01:00, for the service day ended | 14 |
| T7 | Check each file against its contract | Inbox: nightly files, Registry | Rejected files | Lambda · contract check, on the file-arrived event | as each file lands; the alarm at 06:00 | 7 |
| T8 | Add the accepted files up into the regional table | Inbox: nightly files, Registry | Regional transfer table | Glue ETL · add up (or Databricks) | 06:30, with what has landed | 11 |
| T9 | Serve the four reports a reader may see | Regional transfer table | Report API | Athena · queries; API Gateway; Verified Permissions | on request; cached | 20 |
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_transactionsplus three named extras: the transfer operator, the route, the hashed card. - At the region the public arrivals in TIDES
stop_visitsshape, 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.
| 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 | Nightly transfer totals | TIDES station_activities plus extras: the contract's row | nightly, by 06:00, pushed by the adapter | agency's; the region holds a revocable grant | full sharers only |
| Back | Public arrivals, with the stop crosswalk | TIDES stop_visits, times only | read in place, by grant, when the agency counts | region's; a Lake Formation grant per contract | every full sharer |
| Out | Rejected file | the reason | as it happens | region's | the sending agency |
| Out | Reports | JSON: matrix, waits, crossing points, connection times | on request | region's; allow-or-deny per reader | signed-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.