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.
- 29tables and feeds, from 32 across the two use cases: 3 drawn once; 553 columns between them
- 20steps, from 21: the two poll steps are one; 389 output columns, each with its expression
- 3 · 17 · 9tables serving both paths, online only, offline only
- 4 in · 1 back · 4 outaccount crossings, the union of both contracts; the public feed and the totals file counted once
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 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
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.
| Step | Path | What it does | Reads | Writes | Runs as | When | Columns mapped |
|---|---|---|---|---|---|---|---|
| T1 | online | 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 | online | 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 | online | 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 | online | 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 | offline | Land the fare export | PRESTO fare export | Raw fare export | S3 raw landing | nightly, when the export arrives | 20 |
| T6 | offline | 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 |
| T7 | offline | 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 |
| T8 | offline | 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 |
| T9 | both paths | Poll every registered party's live feed into the lane and the archive | GTFS-Realtime feeds, Registry | Live lane, Feed archive | ECS on Fargate · poller; Data Firehose writes the archive | every 10 s; the archive batched within 5 minutes | 44 |
| T10 | online | Fetch each party's timetable when it changes | GTFS timetables, Registry | Timetables | ECS on Fargate · poller | when the published zip changes (its hash) | 42 |
| T11 | online | Archive the lane as TIDES vehicle_locations | Live lane | TIDES vehicle_locations | Data Firehose → S3 + Iceberg | batched, within 5 minutes | 19 |
| T12 | offline | 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 |
| T13 | online | 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 |
| T14 | online | 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 |
| T15 | offline | 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 |
| T16 | offline | 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 |
| T17 | online | 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 |
| T18 | online | 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 |
| T19 | online | Serve the open alerts a reader may see | Alerts | Live alert feed | API Gateway + Lambda; Verified Permissions | on request | 14 |
| T20 | offline | Serve the four reports a reader may see | Regional transfer table | Report API | Athena · queries; API Gateway; Verified Permissions | on request; cached | 20 |
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 one | Path | What was compared, and the result |
|---|---|---|
| Registry | both paths | One table, column for column, in both use cases already (decision 61); drawn once. |
| Regional transfer table | both paths | The 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 feeds | both paths | One 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 archive | both paths | Two 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 step | both paths | The 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 home | both paths | One 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_locationsin 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_visitsevery 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.
| Path | Way | What | Shape | When | Key | Who |
|---|---|---|---|---|---|---|
| both paths | In | Public feeds | GTFS-Realtime, as published | every 10 s, pulled by the region | none: open | every registered party |
| online | In | Timetables | GTFS, as published | when they change | none: open | every registered party |
| online | In | 5-minute loads | TIDES passenger_events, summed | every 5 min, pushed by the adapter | region's, on arrival; 24 hours | full sharers only |
| both paths | In | Nightly transfer totals | TIDES station_activities plus extras: the contract's row | nightly, by 06:00, pushed by the adapter; read by the nightly lookup too | agency's; the region holds a revocable grant | full sharers only |
| offline | 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 |
| online | Out | Alerts | the contract's shape; no TIDES home | as they happen | each receiver's own | the party, the region, named neighbours |
| online | Out | Live alert feed | JSON | on request | region's; allow-or-deny per reader | signed-in control rooms and views |
| offline | Out | Rejected file | the reason | as it happens | region's | the sending agency |
| offline | 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, 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.